7
7
8
8
jobs :
9
9
10
- prod :
11
- name : Release version
10
+ wait :
11
+ name : Wait for tests
12
12
runs-on : ubuntu-latest
13
13
14
14
steps :
15
- - name : Wait for tests
16
- uses :
fountainhead/[email protected]
15
+ -
uses :
fountainhead/[email protected]
17
16
id : wait-for-tests
18
17
with :
19
18
token : ${{ secrets.GITHUB_TOKEN }}
20
- checkName : Run tests
19
+ checkName : Tests done
21
20
ref : ${{ github.ref }}
22
21
timeoutSeconds : 3600
23
22
24
23
- name : Fail the Build
25
24
uses : cutenode/action-always-fail@v1
26
25
if : steps.wait-for-tests.outputs.conclusion != 'success'
27
26
27
+ build :
28
+ name : Build package
29
+ runs-on : ubuntu-latest
30
+ needs : [wait]
31
+ strategy :
32
+ matrix :
33
+ python-version : ['2.7', '3.6']
34
+
35
+ steps :
28
36
- name : Checkout code
29
37
uses : actions/checkout@v2
30
38
33
41
34
42
- name : Set up Python ${{ matrix.python-version }}
35
43
uses : actions/setup-python@v2
44
+ with :
45
+ python-version : ${{ matrix.python-version }}
36
46
37
47
- name : Cache pip
38
48
uses : actions/cache@v2
@@ -48,15 +58,28 @@ jobs:
48
58
- name : Upgrade pip
49
59
run : python -m pip install --upgrade pip setuptools wheel twine
50
60
51
- - name : Download artifacts
52
- uses : dawidd6/action-download-artifact@v2
53
- with :
54
- github_token : ${{ secrets.GITHUB_TOKEN }}
55
- workflow : test.yml
56
- workflow_conclusion : success
57
- name : dist
58
- path : ./dist/
61
+ - name : Install dependencies
62
+ run : pip install -r requirements.txt
63
+
64
+ - name : Build package
65
+ run : python setup.py bdist_wheel sdist
66
+
67
+ - name : Check package
68
+ run : twine check dist/*
69
+
70
+ - name : Publish package
71
+ env :
72
+ TWINE_USERNAME : ${{ secrets.PYPI_USERNAME }}
73
+ TWINE_PASSWORD : ${{ secrets.PYPI_PASSWORD }}
74
+ run : |
75
+ twine upload --skip-existing dist/*
76
+
77
+ release :
78
+ name : Release version
79
+ runs-on : ubuntu-latest
80
+ needs : [wait, build]
59
81
82
+ steps :
60
83
- name : Create release
61
84
id : create_release
62
85
uses : actions/create-release@v1
66
89
tag_name : ${{ github.ref }}
67
90
release_name : ${{ github.ref }}
68
91
draft : false
69
- prerelease : false
70
-
71
- - name : Build and publish
72
- env :
73
- TWINE_USERNAME : ${{ secrets.PYPI_USERNAME }}
74
- TWINE_PASSWORD : ${{ secrets.PYPI_PASSWORD }}
75
- TWINE_REPOSITORY_URL : dolfinus/setuptools-git-versioning
76
- run : |
77
- twine upload dist/*
92
+ prerelease : false
0 commit comments