-
Notifications
You must be signed in to change notification settings - Fork 79
91 lines (74 loc) · 1.96 KB
/
freeze-release-publish.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: Freeze, Release & Publish
on:
push:
branches:
- master
tags:
- v*
pull_request:
branches:
- master
jobs:
freeze:
name: "Freeze: ${{ matrix.os }}"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install tox
run: pip install tox
- name: Build binary
run: tox -e freeze
- name: Pack binary (Windows)
if: ${{ runner.os == 'Windows' }}
run: 7z a shub-Windows.zip dist_bin/shub.exe
- name: Pack binary (Linux/macOS)
if: ${{ runner.os != 'Windows' }}
run: tar -czvf shub-${{ runner.os }}.tar.gz dist_bin/shub
- name: Upload binary
uses: actions/upload-artifact@v2
with:
name: shub-${{ runner.os }}
path: |
shub-${{ runner.os }}.tar.gz
shub-${{ runner.os }}.zip
release:
if: startsWith(github.ref, 'refs/tags/v')
needs: freeze
runs-on: ubuntu-latest
steps:
- name: Download binaries
uses: actions/download-artifact@v2
with:
path: binaries
- name: Display structure of downloaded files
run: ls -R binaries
- name: Draft release
uses: softprops/action-gh-release@v1
with:
draft: true
files: binaries/**
publish:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Publish to PyPI
run: |
pip install --upgrade pip
pip install --upgrade setuptools wheel twine
python setup.py sdist bdist_wheel
export TWINE_USERNAME=__token__
export TWINE_PASSWORD=${{ secrets.PYPI_TOKEN }}
twine upload dist/*