File tree
Expand file treeCollapse file tree1 file changed
+42
-0
lines changed Expand file treeCollapse file tree1 file changed
+42
-0
lines changed Original file line number | Diff line number | Diff line change |
---|
|
| 1 | +name: Publish Python Package |
| 2 | + |
| 3 | +on: |
| 4 | +# trigger when publishing a release |
| 5 | +release: |
| 6 | +types: [published] |
| 7 | + |
| 8 | +# also allow triggering this workflow manually for testing |
| 9 | +workflow_dis: |
| 10 | + |
| 11 | +jobs: |
| 12 | +publish: |
| 13 | + |
| 14 | +runs-on: ubuntu-latest |
| 15 | + |
| 16 | +steps: |
| 17 | +- name: Checkout |
| 18 | +uses: actions/checkout@v2 |
| 19 | +with: |
| 20 | +# just fetching 1 commit is not enough for setuptools-scm, so we fetch all |
| 21 | +fetch-depth: 0 |
| 22 | +- name: Set up Python |
| 23 | +uses: actions/setup-python@v2 |
| 24 | +with: |
| 25 | +python-version: '3.x' |
| 26 | +- name: Install dependencies |
| 27 | +run: | |
| 28 | +pip install setuptools setuptools_scm |
| 29 | + - name: Build package |
| 30 | +run: | |
| 31 | +python setup.py sdist |
| 32 | +rm dist/*.orig # clean sdist_upip noise |
| 33 | + - name: Publish to Test PyPI |
| 34 | +uses: pypa/gh-action-pypi-publish@release/v1 |
| 35 | +with: |
| 36 | +password: ${{ secrets.TEST_PYPI_API_TOKEN }} |
| 37 | +repository_url: https://test.pypi.org/legacy/ |
| 38 | +- name: Publish to PyPI |
| 39 | +uses: pypa/gh-action-pypi-publish@release/v1 |
| 40 | +if: .event.release.tag_name # only when releasing a new version |
| 41 | +with: |
| 42 | +password: ${{ secrets.PYPI_API_TOKEN }} |
You can’t perform that action at this time.
0 commit comments