name: Release on: push: tags: ['v*'] permissions: contents: write jobs: release: name: Create Release runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: fetch-depth: 0 - name: Setup Node.js uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 with: node-version: '20.x' - name: Install dependencies run: npm ci - name: Verify OpenCode package payload run: node tests/scripts/build-opencode.test.js - name: Validate version tag run: | if ! [[ "${REF_NAME}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then echo "Invalid version tag format. Expected vX.Y.Z" exit 1 fi env: REF_NAME: ${{ github.ref_name }} - name: Verify plugin.json version matches tag env: TAG_NAME: ${{ github.ref_name }} run: | TAG_VERSION="${TAG_NAME#v}" PLUGIN_VERSION=$(grep -oE '"version": *"[^"]*"' .claude-plugin/plugin.json | grep -oE '[0-9]+\.[0-9]+\.[0-9]+') if [ "$TAG_VERSION" != "$PLUGIN_VERSION" ]; then echo "::error::Tag version ($TAG_VERSION) does not match plugin.json version ($PLUGIN_VERSION)" echo "Run: ./scripts/release.sh $TAG_VERSION" exit 1 fi - name: Generate release highlights id: highlights env: TAG_NAME: ${{ github.ref_name }} run: | TAG_VERSION="${TAG_NAME#v}" cat > release_body.md <