10
10
auto-release :
11
11
runs-on : ubuntu-latest
12
12
if : " !contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')"
13
- outputs :
14
- auto-version : ${{ steps.auto-version.outputs.version }}
15
13
steps :
16
14
- name : Checkout source
17
15
uses : actions/checkout@v2
@@ -24,54 +22,18 @@ jobs:
24
22
wget -O- "$auto_download_url" | gunzip > ~/auto
25
23
chmod a+x ~/auto
26
24
27
- - name : Check whether a release is due
28
- id : auto-version
29
- run : |
30
- version="$(~/auto version)"
31
- echo "::set-output name=version::$version"
32
- env :
33
- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
34
-
35
- - name : Create release
36
- run : ~/auto shipit
37
- env :
38
- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
39
-
40
- pypi :
41
- runs-on : ubuntu-latest
42
- needs : auto-release
43
- if : " needs.auto-release.outputs.auto-version != ''"
44
- steps :
45
- # By default, actions/checkout will checkout the commit that that was
46
- # pushed to master and triggered the workflow, but this does not include
47
- # the commit & tag created by `auto`. In order to get that, we need to
48
- # look up the tag for the latest release.
49
- - name : Get tag of latest release
50
- id : latest-release
51
- run : |
52
- latest_tag="$(curl -fsSL https://api.github.com/repos/$GITHUB_REPOSITORY/releases/latest | jq -r .tag_name)"
53
- echo "::set-output name=tag::$latest_tag"
54
-
55
- - name : Checkout source
56
- uses : actions/checkout@v2
57
- with :
58
- fetch-depth : 0
59
- ref : ${{ steps.latest-release.outputs.tag }}
60
-
61
25
- name : Set up Python
62
26
uses : actions/setup-python@v2
63
27
with :
64
28
python-version : ' ^3.6'
65
29
66
- - name : Install build & twine
30
+ - name : Install Python dependencies
67
31
run : python -m pip install build twine
68
32
69
- - name : Build
70
- run : python -m build
71
-
72
- - name : Upload
73
- run : twine upload dist/*
33
+ - name : Create release
34
+ run : ~/auto shipit
74
35
env :
36
+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
75
37
TWINE_USERNAME : __token__
76
38
TWINE_PASSWORD : ${{ secrets.PYPI_TOKEN }}
77
39
0 commit comments