77name : Deploy and Publish
88
99on :
10- workflow_run :
11- workflows : ["Build and Test"]
12- branches : [ master ]
13- types :
14- - completed
15- # Allows you to run this workflow manually from the Actions tab
16- workflow_dispatch :
10+ push :
11+ branches :
12+ - master
1713
1814jobs :
1915 deploy :
@@ -22,38 +18,39 @@ jobs:
2218 runs-on : ubuntu-latest
2319
2420 steps :
25- - uses : actions/checkout@v2
26- with :
27- persist-credentials : false
28- - name : Set up Python
29- uses : actions/setup-python@v2
30- with :
31- python-version : ' 3.8'
32- - name : Setup Node
33- uses : actions/setup-node@v1
34- with :
35- node-version : 12
36- - name : Install Semantic Release dependencies
37- run : |
38- sudo apt-get install bumpversion
39- npm install -g semantic-release
40- npm install -g @semantic-release/changelog
41- npm install -g @semantic-release/exec
42- npm install -g @semantic-release/git
43- npm install -g @semantic-release/github
44- npm install -g @semantic-release/commit-analyzer
45- npm install -g @semantic-release/release-notes-generator
46- - name : Publish to Git Releases and Tags
47- run : npx semantic-release # --dry-run --branches 9388_gha Uncomment for testxing purposes
48- env :
49- GITHUB_TOKEN : ${{ secrets.GH_TOKEN }}
50- NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
51- - name : Build binary wheel and a source tarball
52- run : |
53- pip3 install setuptools wheel twine build
54- python -m build --sdist --outdir dist/
55- - name : Publish distribution to PyPI
56- uses :
pypa/[email protected] # Try to update version tag every release 57- with :
58- password : ${{ secrets.PYPI_TOKEN }}
59- repository_url : https://upload.pypi.org/legacy/ # This must be changed if testing deploys to test.pypi.org
21+ - uses : actions/checkout@v2
22+ with :
23+ persist-credentials : false
24+ - name : Set up Python
25+ uses : actions/setup-python@v2
26+ with :
27+ python-version : ' 3.7'
28+ - name : Install dependencies
29+ run : |
30+ python -m pip install --upgrade pip
31+ if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
32+ if [ -f requirements_dev.txt ]; then pip install -r requirements_dev.txt; fi
33+ - name : Test with pytest
34+ run : |
35+ pytest
36+ - name : Setup Node
37+ uses : actions/setup-node@v1
38+ with :
39+ node-version : 16
40+ - name : Install Semantic Release dependencies
41+ run : |
42+ sudo apt-get install bumpversion
43+ npm install -g semantic-release
44+ npm install -g @semantic-release/changelog
45+ npm install -g @semantic-release/exec
46+ npm install -g @semantic-release/git
47+ npm install -g @semantic-release/github
48+ npm install -g @semantic-release/commit-analyzer
49+ npm install -g @semantic-release/release-notes-generator
50+ npm install -g semantic-release-pypi
51+ - name : Publish to Git Releases and Tags
52+ run : npx semantic-release
53+ env :
54+ GITHUB_TOKEN : ${{ secrets.GH_TOKEN }}
55+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
56+ PYPI_TOKEN : ${{ secrets.PYPI_TOKEN }}
0 commit comments