From 2d53f28f9876f6ed5584c867a139874a7c69c1cb Mon Sep 17 00:00:00 2001 From: alvseven Date: Fri, 6 Mar 2026 16:17:57 -0300 Subject: [PATCH] Update publish workflow to match Node SDK pattern Trigger on push to main instead of tags, add concurrency and provenance support. Co-Authored-By: Claude Opus 4.6 --- .github/workflows/publish.yml | 56 +++++++++++++++++------------------ 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7b2093f..013db1e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,47 +1,45 @@ -name: Publish to npm +name: Publish on: push: - tags: - - 'v*' + branches: + - main + +concurrency: ${{ github.workflow }}-${{ github.ref }} permissions: - contents: read + contents: write + id-token: write jobs: - publish: + release: + name: Release runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 + - name: Checkout + uses: actions/checkout@v5 with: - node-version: 20 - registry-url: https://registry.npmjs.org + ref: ${{ github.head_ref }} + fetch-depth: 0 - - uses: oven-sh/setup-bun@v2 + - name: Setup Bun + uses: oven-sh/setup-bun@v2 with: - bun-version: '1.2' - - - run: bun install --frozen-lockfile + bun-version: 1.2.18 - - name: Verify tag matches package.json version - run: | - PKG_VERSION="v$(node -p "require('./package.json').version")" - GIT_TAG="${GITHUB_REF#refs/tags/}" - if [ "$PKG_VERSION" != "$GIT_TAG" ]; then - echo "Tag $GIT_TAG does not match package.json version $PKG_VERSION" - exit 1 - fi - - - run: bun run typecheck - - - run: bun run lint + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 24 + registry-url: 'https://registry.npmjs.org' - - run: bun test + - name: Install dependencies + run: bun install --frozen-lockfile - - run: bun run build + - name: Build package + run: bun run build - - run: npm publish + - name: Publish package + run: npm publish env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}