Skip to content

Make a release

Make a release #70

Workflow file for this run

name: Make a release
on:
workflow_dispatch:
inputs:
version_bump:
description: 'Overide the automatic version bump (default: automatic)'
required: true
default: 'minor'
type: choice
options:
- patch
- minor
- major
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Python 3.14
uses: actions/setup-python@v2
with:
python-version: 3.14
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Sync Python dependencies
run: uv sync --dev
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '22'
cache: 'npm'
- name: Install npm dependencies
run: npm install
- name: Run npm check
run: npm run check
- name: Tests and release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION_BUMP: ${{ github.event.inputs.version_bump }}
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
git config --global user.name "github-actions"
git config --global user.email "action@github.com"
# print the version bump
echo "Version bump: $VERSION_BUMP"
if [ "$VERSION_BUMP" = "automatic" ]; then
uv run semantic-release -v version
fi
if [ "$VERSION_BUMP" = "patch" ]; then
uv run semantic-release -v version --patch
fi
if [ "$VERSION_BUMP" = "minor" ]; then
uv run semantic-release -v version --minor
fi
if [ "$VERSION_BUMP" = "major" ]; then
uv run semantic-release -v version --major
fi
uv run semantic-release -v publish
uv publish --token "$PYPI_TOKEN"