Repository navigation
Update to version 4.4.0 on 2026-11-01 #3
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
| # Written by DocSpring/docspring's api_clients/scripts/generate from api_clients/github_workflows/python/release.yml: | |
| # change it there. | |
| # | |
| # Builds the package on every push and pull request. A v* tag (pushed by the monorepo's api_clients/scripts/release) | |
| # also publishes it to PyPI with trusted publishing, in the release environment, and waits until PyPI serves it. | |
| # OpenAPI Generator's python.yml runs the package's tests. | |
| name: Release | |
| on: | |
| push: | |
| branches: ['**'] | |
| tags: ['v*'] | |
| pull_request: | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3 | |
| - name: Check the tag matches the package version | |
| if: github.ref_type == 'tag' | |
| run: | | |
| VERSION="$(python3 -c 'import tomllib; print(tomllib.load(open("pyproject.toml", "rb"))["project"]["version"])')" | |
| if [ "v$VERSION" != "$GITHUB_REF_NAME" ]; then | |
| echo "::error::The tag is $GITHUB_REF_NAME, but the package version is $VERSION" | |
| exit 1 | |
| fi | |
| - run: uv build --wheel | |
| - run: uvx twine check --strict dist/* | |
| - if: github.ref_type == 'tag' | |
| uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 | |
| with: | |
| name: package | |
| path: dist/ | |
| if-no-files-found: error | |
| publish: | |
| needs: build | |
| if: github.ref_type == 'tag' | |
| runs-on: ubuntu-latest | |
| environment: release | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 | |
| with: | |
| name: package | |
| path: dist/ | |
| - uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3 | |
| verify: | |
| needs: publish | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Wait until PyPI serves the version | |
| run: | | |
| VERSION="${GITHUB_REF_NAME#v}" | |
| for _ in $(seq 60); do | |
| if curl -fsS -o /dev/null "https://pypi.org/pypi/docspring/$VERSION/json"; then | |
| echo "PyPI serves docspring $VERSION" | |
| exit 0 | |
| fi | |
| sleep 10 | |
| done | |
| echo "::error::PyPI doesn't serve docspring $VERSION after 10 minutes" | |
| exit 1 |