Skip to content

chore: bump version to 0.2.0 #4

chore: bump version to 0.2.0

chore: bump version to 0.2.0 #4

Workflow file for this run

name: Auto Tag and Release
on:
push:
branches: [main]
jobs:
auto-tag:
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
tag: ${{ steps.tag.outputs.tag }}
created: ${{ steps.tag.outputs.created }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create tag if needed
id: tag
run: |
VERSION=$(grep '^version = ' pyproject.toml | sed 's/version = "\(.*\)"/\1/')
TAG="v${VERSION}"
echo "Detected version: $VERSION"
echo "Tag: $TAG"
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
if git rev-parse "$TAG" >/dev/null 2>&1; then
echo "Tag $TAG already exists. Nothing to do."
echo "created=false" >> "$GITHUB_OUTPUT"
exit 0
fi
echo "Creating and pushing tag $TAG"
git tag "$TAG"
git push origin "$TAG"
echo "created=true" >> "$GITHUB_OUTPUT"
release:
needs: auto-tag
if: needs.auto-tag.outputs.created == 'true'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create "${{ needs.auto-tag.outputs.tag }}" \
--title "Release ${{ needs.auto-tag.outputs.tag }}" \
--generate-notes