Yuxuan 'fishy' Wang | 84b35ff | 2024-02-07 17:42:39 -0800 | [diff] [blame^] | 1 | name: "PyPI publishing" |
| 2 | |
| 3 | on: |
| 4 | release: |
| 5 | types: [published] |
| 6 | |
| 7 | jobs: |
| 8 | pypi-publish: |
| 9 | name: Publish release to PyPI |
| 10 | runs-on: ubuntu-latest |
| 11 | # Specifying a GitHub environment is optional, but strongly encouraged |
| 12 | environment: release |
| 13 | permissions: |
| 14 | # IMPORTANT: this permission is mandatory for trusted publishing |
| 15 | id-token: write |
| 16 | steps: |
| 17 | - uses: actions/checkout@v4 |
| 18 | |
| 19 | - name: Set up Python |
| 20 | uses: actions/setup-python@v5 |
| 21 | with: |
| 22 | python-version: "3.8" |
| 23 | |
| 24 | - name: Build |
| 25 | run: | |
| 26 | cd lib/py |
| 27 | python setup.py sdist |
| 28 | |
| 29 | - name: Publish package distributions to PyPI |
| 30 | uses: pypa/gh-action-pypi-publish@release/v1 |
| 31 | with: |
| 32 | packages-dir: lib/py/dist/ |