From bdef18fc636c130ff241ce2904877654a36b12fa Mon Sep 17 00:00:00 2001 From: anson Date: Wed, 8 Oct 2025 20:07:55 +0100 Subject: [PATCH 1/3] chore: switch lint workflow to pnpm and update e2e install docs - replace Bun setup in .github/workflows/lint.yml with Node + corepack-driven pnpm so linting aligns with the rest of the CI pipelines - run lint commands through pnpm to ensure they use the workspace lockfile - update packages/e2e/README.md installation section to point to pnpm add instead of bun install --- .github/workflows/lint.yml | 16 ++++-- .github/workflows/prerelease.yml | 85 -------------------------------- README.md | 6 +-- packages/e2e/README.md | 2 +- 4 files changed, 15 insertions(+), 94 deletions(-) delete mode 100644 .github/workflows/prerelease.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index fdadcdbe6..f4388c8af 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -15,10 +15,16 @@ jobs: with: fetch-depth: 0 - - name: Setup Bun - uses: oven-sh/setup-bun@v1 + - name: Setup Node + uses: actions/setup-node@v4 with: - bun-version: latest + node-version: 22.18.0 + registry-url: https://registry.npmjs.org + + - name: Enable corepack + pin pnpm + run: | + corepack enable + corepack prepare pnpm@9.15.0 --activate - name: Install rust uses: dtolnay/rust-toolchain@1.76.0 @@ -29,9 +35,9 @@ jobs: version: 'latest' - name: Install project dependencies - run: bun install + run: pnpm install --frozen-lockfile - name: Lint run: | echo "Running workspace format check..." - NX_DAEMON=false bun run format:check + NX_DAEMON=false pnpm run format:check diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml deleted file mode 100644 index dc4c3bb71..000000000 --- a/.github/workflows/prerelease.yml +++ /dev/null @@ -1,85 +0,0 @@ -name: Prerelease Snapshot - -on: - workflow_dispatch: - -permissions: - contents: write - pull-requests: write - -jobs: - publish: - name: Publish prerelease snapshot - runs-on: ubuntu-latest - env: - RELEASE_BRANCH_PREFIX: 'changeset-release/' - steps: - - name: Ensure Changesets release branch - run: | - if [[ "${GITHUB_REF_NAME}" != ${RELEASE_BRANCH_PREFIX}* ]]; then - echo "❌ This workflow must be triggered on a Changesets release branch. Current branch: ${GITHUB_REF_NAME}" - echo "👉 From the release PR, choose \"Run workflow\" and keep the default branch (changeset-release/...)." - exit 1 - fi - - - name: Check NPM Token - run: | - if [ -z "${{ secrets.NODE_AUTH_TOKEN }}" ]; then - echo "❌ NODE_AUTH_TOKEN secret is not set. Please add it to repository secrets." - exit 1 - else - echo "✅ NODE_AUTH_TOKEN secret is available." - fi - - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Configure git user - run: | - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - - - name: Setup Bun - uses: oven-sh/setup-bun@v1 - with: - bun-version: latest - - - name: Install rust - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - components: rust-std - - - name: Install wasm-pack - uses: jetli/wasm-pack-action@v0.4.0 - with: - version: 'latest' - - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: '22.18.0' - registry-url: 'https://registry.npmjs.org' - - - name: Install project dependencies - run: bun install --frozen-lockfile - - - name: Apply snapshot versions - run: bunx changeset version --snapshot beta - - - name: Build workspace - run: bun run build - - - name: Publish prerelease packages - env: - NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} - run: bunx changeset publish --tag beta - - - name: Reset working tree - if: always() - run: | - git reset --hard HEAD - git clean -fd diff --git a/README.md b/README.md index 6a290731e..721fa441f 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ LOCAL_MASTER_ACCOUNT=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf ```bash // eg. naga-dev -NETWORK= bun run test:e2e all +NETWORK= pnpm run test:e2e all ``` # Running it against a local network @@ -73,7 +73,7 @@ DIRECTORY_NAME=naga-local ## Command ```bash -NETWORK=naga-local bun run test:e2e all +NETWORK=naga-local pnpm run test:e2e all ``` # Manual Publishing @@ -86,7 +86,7 @@ pnpm changeset pnpm changeset version # Build the packages -bun run build +pnpm build # Commit the changes git add . diff --git a/packages/e2e/README.md b/packages/e2e/README.md index a76d27ba8..1656e567f 100644 --- a/packages/e2e/README.md +++ b/packages/e2e/README.md @@ -5,7 +5,7 @@ A comprehensive end-to-end testing package for Lit Protocol integrations. This p ## Installation ```bash -bun install @litprotocol/e2e +pnpm add @litprotocol/e2e ``` ## Environment Variables From be6e57ad572fd5854564ea91dafa015f032709b6 Mon Sep 17 00:00:00 2001 From: anson Date: Wed, 8 Oct 2025 21:58:34 +0100 Subject: [PATCH 2/3] chore: update release workflow to trigger on E2E completion and enhance dependency management --- .github/workflows/release.yml | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fdd5a30be..3c07e8f41 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,9 +1,13 @@ name: Release on: - push: + workflow_run: + workflows: + - E2E - Naga (matrix) branches: - naga - canary-naga + types: + - completed permissions: # allow pushing commits, creating tags, and modifying repo files @@ -11,9 +15,18 @@ permissions: contents: write pull-requests: write +concurrency: + group: release-${{ github.event.workflow_run.head_branch || github.event.workflow_run.head_sha }} + cancel-in-progress: false + jobs: release: runs-on: ubuntu-latest + if: >- + ${{ github.event.workflow_run.conclusion == 'success' && + github.event.workflow_run.event == 'push' && + (github.event.workflow_run.head_branch == 'naga' || + github.event.workflow_run.head_branch == 'canary-naga') }} # Enable this when we want to implement docker image release # outputs: # published: ${{ steps.changesets.outputs.published }} @@ -32,6 +45,7 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 + ref: ${{ github.event.workflow_run.head_sha }} - name: Setup PNPM uses: pnpm/action-setup@v4 @@ -44,17 +58,19 @@ jobs: toolchain: stable override: true components: rust-std - + - name: Install wasm-pack uses: jetli/wasm-pack-action@v0.4.0 with: - version: 'latest' + version: '0.12.1' - name: Setup Node uses: actions/setup-node@v4 with: node-version: '22.18.0' registry-url: 'https://registry.npmjs.org' + cache: 'pnpm' + cache-dependency-path: pnpm-lock.yaml - name: Install project dependencies run: pnpm install --frozen-lockfile @@ -68,15 +84,13 @@ jobs: echo "📋 Not in pre-release mode" fi - - name: Build - run: pnpm build - - name: Create Release Pull Request or Publish to npm id: changesets - uses: changesets/action@v1 + uses: changesets/action@e0145edc7d9d8679003495b11f87bd8ef63c0cba # v1 with: version: pnpm changeset version - publish: pnpm changeset publish --access public + # Build immediately before publishing so artifacts reflect the freshly bumped version + publish: pnpm build && pnpm changeset publish --access public commit: 'chore(release): version packages' title: 'chore(release): version packages' env: From aec81fe106eac7e061c3b98c2e3dfe0d0a1c9278 Mon Sep 17 00:00:00 2001 From: anson Date: Wed, 8 Oct 2025 22:05:07 +0100 Subject: [PATCH 3/3] chore: update changesets action to use version tag --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3c07e8f41..d03d087e7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -86,7 +86,7 @@ jobs: - name: Create Release Pull Request or Publish to npm id: changesets - uses: changesets/action@e0145edc7d9d8679003495b11f87bd8ef63c0cba # v1 + uses: changesets/action@v1 with: version: pnpm changeset version # Build immediately before publishing so artifacts reflect the freshly bumped version