| name: Publish to PyPI | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| build-n-publish: | |
| if: github.event_name == 'workflow_dispatch' | |
| name: Build and publish Python distributions to PyPI | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/specforgeee | |
| permissions: | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - uses: actions/setup-python@v2 | |
| with: | |
| python-version: '3.11' | |
| - run: python setup.py sdist build | |
| # publish to PyPI if executed on the main branch | |
| - name: Publish package to PyPI | |
| id: publish | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| user: __token__ | |
| password: ${{ secrets.PYPI_TOKEN }} | |
| verbose: true | |