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+ # This workflow will upload a Python Package to PyPI when a release is published
2+ # For more information see:
3+ # - https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
4+ # - https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
5+
6+ name : Upload Python Package
7+
8+ on :
9+ push
10+
11+ jobs :
12+ build-n-publish :
13+ name : Build and publish to PyPI
14+ runs-on : ubuntu-latest
15+ steps :
16+ - name : Checkout code
17+ uses : actions/checkout@v2
18+ - name : Set up Python
19+ uses : actions/setup-python@v2
20+ with :
21+ python-version : " 3.x"
22+ - name : Install pypa/build
23+ run : |
24+ python -m pip install --upgrade pip
25+ pip install --upgrade build
26+ - name : Build package
27+ run : |
28+ python -m build
29+ - name : Publish package to Test PyPI
30+ uses : pypa/gh-action-pypi-publish@release/v1.4.2
31+ with :
32+ user : __token__
33+ password : ${{ secrets.TEST_PYPI_API_TOKEN }}
34+ - name : Publish package to PyPI
35+ if : startsWith(github.ref, "refs/tags")
36+ uses : pypa/gh-action-pypi-publish@release/v1.4.2
37+ with :
38+ user : __token__
39+ password : ${{ secrets.PYPI_API_TOKEN }}
You can’t perform that action at this time.
0 commit comments