Skip to content

Release new minor version 0.3.0 (#187) #53

Release new minor version 0.3.0 (#187)

Release new minor version 0.3.0 (#187) #53

Workflow file for this run

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:
release:
if: ${{ github.ref_type == 'tag' }}
name: Release to PyPI
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
persist-credentials: false
- uses: astral-sh/setup-uv@v6
with:
enable-cache: true
- 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 --out-dir dist
- name: Publish package distributions
uses: pypa/gh-action-pypi-publish@release/v1
- name: 'Create a GitHub release'
uses: ncipollo/release-action@v1.16.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@v4
with:
submodules: true
fetch-depth: 0
- uses: astral-sh/setup-uv@v6
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