v11.20.1 #58
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 Python Package | |
| on: | |
| release: | |
| types: [created] | |
| jobs: | |
| build-n-publish: | |
| name: Build and publish Python 🐍 distributions 📦 to PyPI | |
| runs-on: ubuntu-latest | |
| environment: release | |
| permissions: | |
| # this permission is mandatory for trusted publishing | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Set up Python | |
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| with: | |
| python-version: '3.10' | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 | |
| - name: Install project dependencies | |
| run: uv sync --locked | |
| - name: Compute release version | |
| run: echo "NMDC_VERSION=$(uvx uv-dynamic-versioning)" >> "$GITHUB_ENV" | |
| - name: Generate project files | |
| run: | | |
| make clean schema-build | |
| sed -i "s/^version: .*/version: ${NMDC_VERSION}/" src/nmdc_submission_schema/schema/nmdc_submission_schema.yaml | |
| make gen-project | |
| cp -r project src/nmdc_submission_schema | |
| - name: Build source and wheel archives | |
| run: uv build | |
| - name: Publish distribution 📦 to PyPI | |
| uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0 |