Skip to content

chore: bump version to 0.2.0 #12

chore: bump version to 0.2.0

chore: bump version to 0.2.0 #12

Workflow file for this run

# Automated tagging for CLX releases.
#
# On every push to main, compares the workspace version in Cargo.toml
# against existing git tags. If the version doesn't have a corresponding
# tag, creates one β€” which triggers release.yml β†’ build β†’ GitHub Release β†’ Homebrew.
#
# To release: bump the version in Cargo.toml (workspace.package.version),
# merge to main, and this workflow handles the rest.
#
# Requires RELEASE_PLZ_TOKEN secret (Fine-Grained PAT with Contents write).
# GITHUB_TOKEN cannot create tags that trigger other workflows.
name: Auto-Tag Release
on:
push:
branches:
- main
paths:
- "Cargo.toml"
jobs:
auto-tag:
name: Create release tag
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.RELEASE_PLZ_TOKEN }}
- name: Check version and create tag
run: |
set -euo pipefail
# Extract version from workspace Cargo.toml
VERSION=$(grep -m1 'version = ' Cargo.toml | head -1 | sed 's/.*version = "\(.*\)"/\1/')
TAG="v${VERSION}"
echo "Workspace version: ${VERSION}"
echo "Expected tag: ${TAG}"
# Check if tag already exists
if git rev-parse "${TAG}" >/dev/null 2>&1; then
echo "Tag ${TAG} already exists β€” nothing to do."
exit 0
fi
echo "Tag ${TAG} does not exist β€” creating it."
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag -a "${TAG}" -m "Release ${TAG}"
git push origin "${TAG}"
echo "Created and pushed tag ${TAG}"