Release v3.1.0 #41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| run-name: Release v${{ inputs.version }} | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Release version (e.g., 1.6.0)' | |
| required: true | |
| permissions: | |
| contents: write | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| environment: production | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: main | |
| - name: Validate version | |
| run: | | |
| VERSION="${{ inputs.version }}" | |
| # Must be valid semver (MAJOR.MINOR.PATCH with optional pre-release suffix) | |
| if ! echo "$VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.]+)?$'; then | |
| echo "::error::Invalid version format '$VERSION'. Must be MAJOR.MINOR.PATCH (e.g., 1.6.0, 2.0.0-beta.1)" | |
| exit 1 | |
| fi | |
| # Must be greater than current version | |
| CURRENT=$(jq -r '.version' plugins/carbonlog/.claude-plugin/plugin.json) | |
| if [ "$(printf '%s\n' "$CURRENT" "$VERSION" | sort -V | tail -1)" = "$CURRENT" ]; then | |
| echo "::error::Version $VERSION is not greater than current version $CURRENT" | |
| exit 1 | |
| fi | |
| echo "Releasing $CURRENT → $VERSION" | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: '1.3.6' | |
| - run: bun install | |
| - run: bun run typecheck | |
| - run: bun run test | |
| - name: Update plugin versions | |
| run: | | |
| VERSION="${{ inputs.version }}" | |
| for plugin_json in plugins/*/.claude-plugin/plugin.json; do | |
| jq --arg v "$VERSION" '.version = $v' "$plugin_json" > tmp.json && mv tmp.json "$plugin_json" | |
| done | |
| for pkg_json in plugins/*/package.json; do | |
| jq --arg v "$VERSION" '.version = $v' "$pkg_json" > tmp.json && mv tmp.json "$pkg_json" | |
| done | |
| - name: Commit and tag release | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add plugins/*/.claude-plugin/plugin.json plugins/*/package.json | |
| git commit --no-verify -m "chore: release ${{ inputs.version }} [skip ci]" | |
| git tag "v${{ inputs.version }}" | |
| git push origin main --tags | |
| - name: Create GitHub Release | |
| run: gh release create "v${{ inputs.version }}" --generate-notes | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |