fix:amend workflow #16
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
| # See https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/ | |
| # for a detailed guide | |
| name: Publish to PyPI | |
| on: | |
| push: | |
| branches: [main] | |
| jobs: | |
| release-please: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| outputs: | |
| release_created: ${{ steps.release.outputs.release_created }} | |
| steps: | |
| - uses: googleapis/release-please-action@5c625bfb5d1ff62eadeeb3772007f7f66fdcf071 # v4.4.1 | |
| id: release | |
| test: | |
| needs: [release-please] | |
| if: ${{ needs.release-please.outputs.release_created }} | |
| uses: ./.github/workflows/test.yml | |
| build: | |
| needs: [release-please, test] | |
| if: ${{ needs.release-please.outputs.release_created }} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 | |
| with: | |
| python-version: '3.14' | |
| - run: uv build | |
| # Smoke tests with ready-to-publish package. | |
| - run: uv run --isolated --no-project --with dist/*.whl python -c "import draftail_text_utils; print('OK')" | |
| - run: uv run --isolated --no-project --with dist/*.tar.gz python -c "import draftail_text_utils; print('OK')" | |
| - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| path: ./dist | |
| publish: | |
| needs: [release-please, build] | |
| if: ${{ needs.release-please.outputs.release_created }} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: none | |
| id-token: write # required for trusted publishing | |
| environment: pypi | |
| steps: | |
| - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| - uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # release/v1 | |
| with: | |
| packages-dir: artifact/ | |
| print-hash: true |