release: v0.1.1 (#10) #21
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-please | |
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| pull-request: | |
| runs-on: ubuntu-24.04 | |
| outputs: | |
| releases_created: ${{steps.release.outputs.releases_created}} | |
| paths_released: ${{steps.release.outputs.paths_released}} | |
| steps: | |
| - uses: googleapis/release-please-action@v4 | |
| id: release | |
| with: | |
| token: ${{secrets.GITHUB_TOKEN}} | |
| publish-package: | |
| needs: pull-request | |
| if: ${{needs.pull-request.outputs.releases_created && toJson(fromJson(needs.pull-request.outputs.paths_released)) != '[]'}} | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| id-token: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24.x | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Prepare docs | |
| run: npm run prepare:docs | |
| - name: Run build | |
| run: npm run build | |
| - name: Remove devDependencies from package.json | |
| run: | | |
| mv package.json package.json.bak | |
| node <<- EOM | |
| const fs = require("fs"); | |
| const pkg = JSON.parse(fs.readFileSync("package.json.bak", {encoding: "utf8"})); | |
| pkg.devDependencies = {}; | |
| fs.writeFileSync("package.json", JSON.stringify(pkg, null, "\t"), {encoding: "utf8"}); | |
| EOM | |
| - name: Prune devDependencies | |
| run: npm prune --omit=dev | |
| - name: Restore original package.json | |
| run: | | |
| rm package.json | |
| mv package.json.bak package.json | |
| - name: Publish to npm | |
| run: npm publish --access public --provenance | |
| publish-mcp-registry: | |
| needs: [pull-request, publish-package] | |
| if: ${{needs.pull-request.outputs.releases_created && toJson(fromJson(needs.pull-request.outputs.paths_released)) != '[]'}} | |
| uses: ./.github/workflows/publish-mcp-registry.yml | |
| permissions: | |
| id-token: write # Required for login via github-oidc | |
| contents: read |