chore: bump version to 0.2.1 #2
Workflow file for this run
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 | |
| on: | |
| push: | |
| tags: | |
| - "v*.*.*" | |
| concurrency: | |
| group: release-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: "24" | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: 1.3.11 | |
| - name: Assert Node.js version | |
| run: node -e "const v=+process.version.slice(1).split('.')[0]; if(v<22)process.exit(1)" | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Build | |
| run: bun run build | |
| - name: Lint and format check | |
| run: bun run check | |
| - name: Unit tests | |
| run: bun run test | |
| - name: Verify git tag matches package.json version | |
| run: | | |
| set -euo pipefail | |
| TAG="${GITHUB_REF#refs/tags/v}" | |
| PKG=$(node -p "require('./package.json').version") | |
| if [ "$TAG" != "$PKG" ]; then | |
| echo "::error::Git tag v$TAG must match package.json version $PKG (publish aborted)." | |
| exit 1 | |
| fi | |
| - name: Create tarball for GitHub Release | |
| id: pack | |
| run: | | |
| set -euo pipefail | |
| npm pack | |
| echo "tarball=$(ls -t rethunk-github-mcp-*.tgz | head -1)" >> "$GITHUB_OUTPUT" | |
| - name: Publish to GitHub Packages (npm registry) | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| set -euo pipefail | |
| node <<'NODE' | |
| const fs = require("node:fs"); | |
| const p = JSON.parse(fs.readFileSync("package.json", "utf8")); | |
| p.name = "@rethunk-ai/github-mcp"; | |
| p.publishConfig = { | |
| registry: "https://npm.pkg.github.com", | |
| access: "public", | |
| }; | |
| fs.writeFileSync("package.json", JSON.stringify(p, null, 2) + "\n"); | |
| NODE | |
| { | |
| echo "@rethunk-ai:registry=https://npm.pkg.github.com" | |
| echo "//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}" | |
| } > .npmrc | |
| npm publish --access public | |
| - name: Create GitHub Release (official gh CLI, no third-party action) | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| set -euo pipefail | |
| gh release create "${GITHUB_REF_NAME}" "${{ steps.pack.outputs.tarball }}" \ | |
| --verify-tag \ | |
| --generate-notes |