release: v2.12.0 -- service restart deploy hook, defers while tasks run #9
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 | |
| # Trusted Publishing (OIDC) -- no API token. Configure the trusted | |
| # publisher on PyPI with: owner=nerdocs, repo=ntasker, | |
| # workflow=publish.yml, environment=pypi. | |
| # | |
| # Publishing is triggered by pushing a version tag (v*). Bump the version | |
| # first, commit, then `git tag vX.Y.Z && git push origin vX.Y.Z` -- PyPI | |
| # rejects a re-upload of an existing version. | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| name: Build distribution | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.12" | |
| - name: Install build tooling | |
| run: python -m pip install --upgrade build babel | |
| - name: Compile i18n catalogs | |
| # The binary .mo MUST exist on disk before the build -- hatchling | |
| # only packages files that are already present, so a missing | |
| # compile step ships a wheel without translations. | |
| run: pybabel compile -d src/ntasker/locale -D ntasker | |
| - name: Build sdist + wheel | |
| run: python -m build | |
| - name: Upload distributions | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: dist | |
| path: dist/ | |
| publish: | |
| name: Publish to PyPI | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/ntasker | |
| permissions: | |
| id-token: write # OIDC token for PyPI Trusted Publishing | |
| steps: | |
| - name: Download distributions | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: dist | |
| path: dist/ | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 |