Skip to content

Create Release

Create Release #1

name: Create Release
on:
workflow_dispatch:
inputs:
version:
type: string
description: Version number of new release in form '0.2.0'
required: true
jobs:
create-release:
runs-on: ubuntu-latest
steps:
- name: Validate version input
run: |
echo "${{ inputs.version }}" | grep -qEo '[0-9]+\.[0-9]+\.[0-9]+'
if [ $? -ne 0 ]; then
echo "Invalid version number. Please use the format '0.2.0'"
exit 1
fi
- name: Checkout the code
uses: actions/checkout@v4
- name: Install `uv`
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Bump package version
run: |
sed -i 's/^\(version = \).*$/\1'\"${{ inputs.version }}\"'/' pyproject.toml
uv sync
- name: Commit, tag and push
run: |
git config --global user.email "github-actions[bot]"
git config --global user.name "41898282+github-actions[bot]@users.noreply.github.com"
git add -A .
git commit -m "chore: bump version to ${{ inputs.version }}"
git tag -a "${{ inputs.version }}" -m "${{ inputs.version }}"
git push origin main "${{ inputs.version }}"