Yuxuan 'fishy' Wang | 0ca1ed9 | 2024-02-07 17:25:16 -0800 | [diff] [blame] | 1 | name: "PyPI publishing" |
| 2 | |
| 3 | on: |
| 4 | pull_request: |
| 5 | branches: ["*"] |
| 6 | |
| 7 | jobs: |
| 8 | pypi-publish: |
| 9 | name: upload 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: | |
Yuxuan 'fishy' Wang | 9791a3f | 2024-02-08 10:58:15 -0800 | [diff] [blame^] | 26 | python -m pip install --upgrade pip |
| 27 | python -m pip install setuptools |
Yuxuan 'fishy' Wang | 0ca1ed9 | 2024-02-07 17:25:16 -0800 | [diff] [blame] | 28 | cd lib/py |
| 29 | python setup.py sdist |
| 30 | |
| 31 | - name: Publish package distributions to PyPI |
| 32 | uses: pypa/gh-action-pypi-publish@release/v1 |
| 33 | with: |
| 34 | repository-url: https://test.pypi.org/legacy/ |
| 35 | packages-dir: lib/py/dist/ |
| 36 | |