Bump the development group with 4 updates (#360) #204
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: release | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| on: | |
| push: | |
| branches: [main] | |
| tags: ['v*'] | |
| defaults: | |
| run: | |
| shell: bash | |
| env: | |
| UV_LOCKED: 1 | |
| UV_NO_SYNC: 1 | |
| jobs: | |
| wheels: | |
| if: ${{ github.ref_type == 'tag' }} | |
| uses: ./.github/workflows/_build-wheels.yml | |
| with: | |
| cibw_build: "cp310-* cp311-* cp312-* cp313-* cp314-*" | |
| version: ${{ github.ref_name }} | |
| release: | |
| if: ${{ github.ref_type == 'tag' }} | |
| name: Release to PyPI | |
| needs: [wheels] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| contents: write | |
| env: | |
| UV_LOCKED: 0 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| submodules: true | |
| persist-credentials: false | |
| - uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| - name: Bump project version to match tag | |
| id: automatic-version | |
| run: | | |
| set -Eeuxo pipefail | |
| version="${GITHUB_REF#refs/tags/v}" | |
| uv version "$version" | |
| - name: Validate tag | |
| id: validate-tag | |
| run: | | |
| set -Eeuxo pipefail | |
| project_version=v$(uv version --short) | |
| tag=${GITHUB_REF#refs/tags/} | |
| [[ "$tag" == "$project_version" ]] || { | |
| echo "Tag $tag does not match project version $project_version" | |
| exit 1 | |
| } | |
| - name: Build package distributions | |
| id: build | |
| run: uv build --sdist --out-dir dist | |
| - name: Download wheel artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| pattern: wheels-* | |
| path: dist | |
| merge-multiple: true | |
| - name: Publish package distributions | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| skip-existing: false | |
| verbose: true | |
| - name: 'Create a GitHub release' | |
| uses: ncipollo/release-action@v1.21.0 | |
| with: | |
| prerelease: false | |
| draft: false | |
| makeLatest: true | |
| tag: "${{ github.ref_name }}" | |
| name: "${{ github.ref_name }}" | |
| generateReleaseNotes: true | |
| release-docs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| submodules: true | |
| fetch-depth: 0 | |
| - uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| - name: Deploy site | |
| run: | | |
| set -Eeuxo pipefail | |
| export TAG='${{ github.ref_name }}' | |
| uv sync --group docs | |
| git fetch origin gh-pages --depth=1 | |
| git config user.name github-actions[bot] | |
| git config user.email github-actions[bot]@users.noreply.github.com | |
| if [[ $TAG == v* ]] | |
| then | |
| V_MAJOR=`echo ${TAG#v} | awk -F '.' '{print $1}'` | |
| V_MINOR=`echo ${TAG#v} | awk -F '.' '{print $2}'` | |
| uv run mike deploy --push --alias-type=redirect --update-aliases "${V_MAJOR}.${V_MINOR}.x" stable "${TAG#v}" | |
| else | |
| uv run mike deploy --push --alias-type=redirect --title "Development version" --update-aliases dev latest | |
| fi |