Skip to content

Add sync_timing tool, slim CLAUDE.md by deferring to registry (v0.10.1) #13

Add sync_timing tool, slim CLAUDE.md by deferring to registry (v0.10.1)

Add sync_timing tool, slim CLAUDE.md by deferring to registry (v0.10.1) #13

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
version:
description: 'Version to release (e.g., 0.4.0). Leave empty to read from toolkit-registry.json'
required: false
type: string
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Full history for changelog generation
- name: Get version
id: version
run: |
if [ -n "${{ github.event.inputs.version }}" ]; then
VERSION="${{ github.event.inputs.version }}"
elif [[ "${{ github.ref }}" == refs/tags/v* ]]; then
VERSION="${{ github.ref_name }}"
VERSION="${VERSION#v}"
else
VERSION=$(jq -r '.version' _internal/toolkit-registry.json)
fi
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "tag=v$VERSION" >> $GITHUB_OUTPUT
echo "Releasing version: $VERSION"
- name: Check tag exists (for manual dispatch)
if: github.event_name == 'workflow_dispatch'
run: |
TAG="v${{ steps.version.outputs.version }}"
if git rev-parse "$TAG" >/dev/null 2>&1; then
echo "Tag $TAG already exists"
else
echo "Creating tag $TAG"
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag "$TAG"
git push origin "$TAG"
fi
- name: Get previous tag
id: prev_tag
run: |
CURRENT_TAG="v${{ steps.version.outputs.version }}"
PREV_TAG=$(git tag --sort=-version:refname | grep -v "$CURRENT_TAG" | head -n 1)
if [ -z "$PREV_TAG" ]; then
# No previous tag, use first commit
PREV_TAG=$(git rev-list --max-parents=0 HEAD)
fi
echo "prev_tag=$PREV_TAG" >> $GITHUB_OUTPUT
echo "Previous tag: $PREV_TAG"
- name: Generate changelog
id: changelog
run: |
CURRENT_TAG="v${{ steps.version.outputs.version }}"
PREV_TAG="${{ steps.prev_tag.outputs.prev_tag }}"
echo "## What's Changed" > changelog.md
echo "" >> changelog.md
# Get commits since previous tag
git log --pretty=format:"* %s (%h)" "$PREV_TAG".."$CURRENT_TAG" 2>/dev/null >> changelog.md || \
git log --pretty=format:"* %s (%h)" "$PREV_TAG"..HEAD >> changelog.md
echo "" >> changelog.md
echo "" >> changelog.md
echo "**Full Changelog**: https://github.com/${{ github.repository }}/compare/${PREV_TAG}...${CURRENT_TAG}" >> changelog.md
cat changelog.md
- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.version.outputs.version }}
name: v${{ steps.version.outputs.version }}
body_path: changelog.md
draft: false
prerelease: false
generate_release_notes: false