File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Publish Python 🐍 distributions 📦 to PyPI and TestPyPI
2+
3+ on :
4+ push :
5+ tags :
6+ - ' *'
7+ jobs :
8+ build-n-publish :
9+ name : Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
10+ runs-on : ubuntu-latest
11+ steps :
12+ - uses : actions/checkout@master
13+ - name : Get the version
14+ id : get_version
15+ run : echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
16+ - name : Replace version
17+ run : |
18+ echo Changing version in setup.py to ${{ steps.get_version.outputs.VERSION }}
19+ sed -i 's/VERSION = ".*"/VERSION = "${{ steps.get_version.outputs.VERSION }}"/g' setup.py
20+ - name : Set up Python 3.9
21+ uses : actions/setup-python@v1
22+ with :
23+ python-version : 3.9
24+ - name : Install pypa/build
25+ run : >-
26+ python -m
27+ pip install
28+ build
29+ --user
30+ - name : Build a binary wheel and a source tarball
31+ run : >-
32+ python -m
33+ build
34+ --sdist
35+ --wheel
36+ --outdir dist/
37+ - name : Publish distribution 📦 to PyPI
38+ if : startsWith(github.ref, 'refs/tags')
39+ uses : pypa/gh-action-pypi-publish@release/v1
40+ with :
41+ password : ${{ secrets.PYPI_API_TOKEN }}
Original file line number Diff line number Diff line change 3939 with :
4040 password : ${{ secrets.TEST_PYPI_API_TOKEN }}
4141 repository-url : https://test.pypi.org/legacy/
42- attestations : false
43- - name : Publish distribution 📦 to PyPI
44- if : startsWith(github.ref, 'refs/tags')
45- uses : pypa/gh-action-pypi-publish@release/v1
46- with :
47- password : ${{ secrets.PYPI_API_TOKEN }}
48- attestations : false
You can’t perform that action at this time.
0 commit comments