Release v3.0.0 #21
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: MCP Bundle and MCP server" | |
| run-name: Release ${{ github.ref_name }} | |
| on: | |
| workflow_dispatch: | |
| env: | |
| PACKAGE_PATTERN: bear-notes-mcpb-*.mcpb | |
| CI: true | |
| jobs: | |
| verify-ci: | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| steps: | |
| - name: Verify release does not exist | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| if gh release view "${{ github.ref_name }}" --repo=${{ github.repository }} &>/dev/null; then | |
| echo "::error::Release ${{ github.ref_name }} already exists" | |
| exit 1 | |
| fi | |
| - name: Verify CI passed for tag | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| echo "Checking CI status for tag: ${{ github.ref_name }}" | |
| COUNT=$(gh run list \ | |
| --repo=${{ github.repository }} \ | |
| --workflow=ci.yml \ | |
| --branch=${{ github.ref_name }} \ | |
| --status=success \ | |
| --limit=1 \ | |
| --json conclusion \ | |
| --jq 'length') | |
| if [ "$COUNT" -eq 0 ]; then | |
| echo "::error::CI workflow has not passed for tag ${{ github.ref_name }}" | |
| exit 1 | |
| fi | |
| echo "CI passed for tag ${{ github.ref_name }}" | |
| release: | |
| needs: verify-ci | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ github.ref_name }} | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '24' | |
| - name: Install Task | |
| uses: arduino/setup-task@v2 | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Create package | |
| run: | | |
| task pack | |
| PACKAGE_FILE=$(ls bear-notes-mcpb-*.mcpb) | |
| echo "PACKAGE_FILE=$PACKAGE_FILE" >> $GITHUB_ENV | |
| - name: Extract changelog | |
| run: | | |
| VERSION=${TAG_NAME#v} | |
| CHANGELOG_BODY=$(task changelog VERSION=$VERSION) | |
| echo "CHANGELOG_BODY<<EOF" >> $GITHUB_ENV | |
| echo "$CHANGELOG_BODY" >> $GITHUB_ENV | |
| echo "EOF" >> $GITHUB_ENV | |
| env: | |
| TAG_NAME: ${{ github.ref_name }} | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v3 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| body: | | |
| ${{ env.CHANGELOG_BODY }} | |
| --- | |
| Download ${{ env.PACKAGE_FILE }} to install the extension. | |
| files: ${{ env.PACKAGE_FILE }} | |
| npm-publish: | |
| needs: verify-ci | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ github.ref_name }} | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '24' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Verify version matches tag | |
| run: | | |
| TAG_VERSION=${TAG_NAME#v} | |
| PKG_VERSION=$(node -p "require('./package.json').version") | |
| if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then | |
| echo "::error::Tag v$TAG_VERSION doesn't match package.json version $PKG_VERSION" | |
| exit 1 | |
| fi | |
| echo "Version verified: $PKG_VERSION" | |
| env: | |
| TAG_NAME: ${{ github.ref_name }} | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Publish to npm | |
| run: npm publish --provenance |