-
Notifications
You must be signed in to change notification settings - Fork 3
49 lines (47 loc) · 1.57 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Sastre_Release
on:
push:
tags:
- 'v[0-9]+\.[0-9]+\.[0-9]+-rc[0-9]+'
- 'v[0-9]+\.[0-9]+\.[0-9]+'
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Set up Python 2.7
run: |
sudo apt update
sudo apt install python2 python2-dev
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py
sudo python2 get-pip.py
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 1
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 2
printf '1\n' | sudo update-alternatives --config python
- name: Get tag
id: tag
uses: dawidd6/action-get-tag@v1
with:
strip_v: false
- name: Generate binary
run: |
pip install pyinstaller==3.3.1
pip install -e .
pyinstaller --onefile -n sastre apply_pr/cli.py
- name: Creating a realease/pre-release
id: create_release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: dist/sastre
tag_name: ${{steps.tag.outputs.tag}}
draft: false
prerelease: ${{ contains(github.ref, '-rc') }}
generate_release_notes: true
- run: rm -r dist
- name: Publish a Python distribution to PyPI
if: ${{ contains(github.ref, '-rc') }} == false
uses: conchylicultor/pypi-build-publish@v1
with:
pypi-token: ${{ secrets.PYPI_TOKEN }}