HARDAX v5.7.1 #14
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish to PyPI | |
| # Triggers: | |
| # release: published -> uploads the built wheel + sdist to real PyPI | |
| # workflow_dispatch -> manual run; choose 'testpypi' for a dry run | |
| # or 'pypi' to retry the real publish | |
| # | |
| # Authentication is via PyPI Trusted Publishing (OIDC). No API token is | |
| # stored anywhere in this repo. The trusted publisher must be configured on | |
| # pypi.org and (for the testpypi target) on test.pypi.org with: | |
| # Owner: V33RU | |
| # Repository: hardax | |
| # Workflow filename: publish.yml | |
| # Environment: (blank) | |
| on: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| inputs: | |
| target: | |
| description: "Where to publish" | |
| required: true | |
| default: testpypi | |
| type: choice | |
| options: | |
| - testpypi | |
| - pypi | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| name: Build wheel and sdist | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 | |
| with: | |
| python-version: "3.10" | |
| - name: Install build | |
| run: python -m pip install --upgrade build | |
| - name: Build distributions | |
| run: python -m build | |
| - name: Smoke-install the wheel | |
| run: | | |
| python -m pip install dist/*.whl | |
| hardax --version | |
| python -m hardax --version | |
| - name: Upload built distributions as workflow artifact | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | |
| with: | |
| name: dist | |
| path: dist/ | |
| if-no-files-found: error | |
| publish-to-testpypi: | |
| name: Upload to TestPyPI | |
| needs: build | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'workflow_dispatch' && inputs.target == 'testpypi' | |
| permissions: | |
| id-token: write | |
| steps: | |
| - name: Download built distributions | |
| uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4 | |
| with: | |
| name: dist | |
| path: dist/ | |
| - name: Upload to TestPyPI | |
| uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # release/v1 | |
| with: | |
| repository-url: https://test.pypi.org/legacy/ | |
| attestations: true | |
| publish-to-pypi: | |
| name: Upload to PyPI | |
| needs: build | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && inputs.target == 'pypi') | |
| permissions: | |
| id-token: write | |
| steps: | |
| - name: Download built distributions | |
| uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4 | |
| with: | |
| name: dist | |
| path: dist/ | |
| - name: Upload to PyPI | |
| uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # release/v1 | |
| with: | |
| attestations: true |