Release 1.0.2 #32
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: npm-publish | |
| on: | |
| release: | |
| types: [published] | |
| permissions: | |
| id-token: write | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| publish: | |
| environment: "Publish to NPM" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 | |
| - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 | |
| with: | |
| node-version: "24" | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Update npm | |
| run: npm install -g npm@latest | |
| - run: npm ci | |
| - run: npm test | |
| - run: npm run build | |
| - name: Publish | |
| run: | | |
| # Keep RCs off the `latest` dist-tag so plain `npm install` still | |
| # resolves to the latest stable release. | |
| if [[ "${GITHUB_REF_NAME}" == *-rc* ]]; then | |
| npm publish --tag rc | |
| else | |
| npm publish | |
| fi | |
| update-example-post-release: | |
| needs: publish | |
| # Skip for RCs so master's example project stays pinned to a stable | |
| # release. | |
| if: ${{ !contains(github.ref_name, '-rc') }} | |
| runs-on: ubuntu-latest | |
| env: | |
| VERSION: ${{ github.ref_name }} | |
| BRANCH_NAME: post-release/update-example | |
| steps: | |
| - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 | |
| with: | |
| node-version: "24" | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Wait for npm propagation | |
| run: sleep 30 | |
| - name: Verify version availability on npm with retries | |
| run: | | |
| echo "Checking if @stacks/rendezvous@$VERSION is available on npm..." | |
| # Retry up to 5 times with 10 second intervals. | |
| for i in {1..5}; do | |
| if npm view @stacks/rendezvous@$VERSION version >/dev/null 2>&1; then | |
| echo "Package @stacks/rendezvous@$VERSION is available on npm" | |
| break | |
| else | |
| echo "Attempt $i: Package not yet available, waiting 10 seconds..." | |
| if [ $i -eq 5 ]; then | |
| echo "Package @stacks/rendezvous@$VERSION not found after 5 attempts" | |
| exit 1 | |
| fi | |
| sleep 10 | |
| fi | |
| done | |
| - name: Update example project to use published version | |
| run: | | |
| echo "Updating example project to use version: $VERSION" | |
| # Update example to use the published version. | |
| cd example | |
| npm install @stacks/rendezvous@$VERSION | |
| cd .. | |
| - name: Create pull request | |
| uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| sign-commits: true | |
| branch: ${{ env.BRANCH_NAME }} | |
| base: master | |
| title: "Update example project to use @stacks/rendezvous@${{ env.VERSION }}" | |
| commit-message: "Update example project to use @stacks/rendezvous@${{ env.VERSION }}" | |
| add-paths: | | |
| example/package.json | |
| example/package-lock.json | |
| body: | | |
| This post-release PR updates the `example` Clarinet project to use the latest Rendezvous version. | |
| Auto-generated after release ${{ env.VERSION }}. |