v0.5.0 — Document Ingestion + Data Curation Pipeline #5
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 | |
| on: | |
| release: | |
| types: [published] | |
| # No workflow-level permissions — each job declares the minimal set it needs. | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read # checkout needs read access to the release ref | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.11" | |
| - name: Install build tools | |
| run: pip install build | |
| - name: Build sdist and wheel | |
| run: python -m build | |
| - name: Verify package | |
| run: | | |
| pip install twine | |
| twine check dist/* | |
| - uses: actions/upload-artifact@v5 | |
| with: | |
| name: dist | |
| path: dist/ | |
| # TestPyPI: triggered by pre-release tags (e.g., v0.3.0-rc1, v0.3.0-beta) | |
| # or releases created from test/development branches | |
| publish-testpypi: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| if: github.event.release.prerelease == true | |
| environment: | |
| name: testpypi | |
| url: https://test.pypi.org/p/forgelm | |
| permissions: | |
| contents: read # download-artifact reads workflow run state | |
| id-token: write # required for trusted publishing to TestPyPI | |
| steps: | |
| - uses: actions/download-artifact@v5 | |
| with: | |
| name: dist | |
| path: dist/ | |
| - name: Publish to TestPyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| repository-url: https://test.pypi.org/legacy/ | |
| # PyPI: triggered by stable releases (non-prerelease) from main | |
| publish-pypi: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| if: github.event.release.prerelease == false | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/forgelm | |
| permissions: | |
| contents: read # download-artifact reads workflow run state | |
| id-token: write # required for trusted publishing to PyPI | |
| steps: | |
| - uses: actions/download-artifact@v5 | |
| with: | |
| name: dist | |
| path: dist/ | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 |