From 527d0d73b0c5ec694ca1fa63017eb0d5a82d231e Mon Sep 17 00:00:00 2001 From: MQ Date: Wed, 27 Aug 2025 13:17:25 +0200 Subject: [PATCH 01/11] ci: auto set dxt version on release --- .github/workflows/release.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 79393803..631be646 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -64,6 +64,9 @@ jobs: - name: Update package version in package.json run: npm version --no-git-tag-version --allow-same-version ${{ needs.release_metadata.outputs.version_number }} + - name: Update manifest.json version + run: jq '.version = "${{ needs.release_metadata.outputs.version_number }}"' manifest.json > manifest.json.tmp && mv manifest.json.tmp manifest.json + - name: Update CHANGELOG.md uses: DamianReeves/write-file-action@master with: @@ -77,7 +80,7 @@ jobs: with: author_name: Apify Release Bot author_email: noreply@apify.com - message: "chore(release): Update changelog and package version [skip ci]" + message: "chore(release): Update changelog, package.json and manifest.json versions [skip ci]" create_github_release: name: Create github release From 6040d1292a1207a95e3469a5898ed65f29f96fa8 Mon Sep 17 00:00:00 2001 From: MQ Date: Wed, 27 Aug 2025 13:17:55 +0200 Subject: [PATCH 02/11] temp: do not push to npm for testing --- .github/workflows/release.yaml | 46 +++++++++++++++++----------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 631be646..0f84de3c 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -125,29 +125,29 @@ jobs: files: | actors-mcp-server.dxt - publish_to_npm: - name: Publish to NPM - needs: [ update_changelog ] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ needs.update_changelog.changelog_commitish }} - - name: Use Node.js 22 - uses: actions/setup-node@v4 - with: - node-version: 22 - cache: 'npm' - cache-dependency-path: 'package-lock.json' - - name: Install dependencies - run: | - echo "access=public" >> .npmrc - echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc - npm ci - - name: Build module - run: npm run build - - name: Publish to NPM - run: npm publish --tag latest + #publish_to_npm: + # name: Publish to NPM + # needs: [ update_changelog ] + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4 + # with: + # ref: ${{ needs.update_changelog.changelog_commitish }} + # - name: Use Node.js 22 + # uses: actions/setup-node@v4 + # with: + # node-version: 22 + # cache: 'npm' + # cache-dependency-path: 'package-lock.json' + # - name: Install dependencies + # run: | + # echo "access=public" >> .npmrc + # echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc + # npm ci + # - name: Build module + # run: npm run build + # - name: Publish to NPM + # run: npm publish --tag latest env: NODE_AUTH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_NPM_TOKEN }} From 5e5c4776fd65290d6b6d68c5187f96f198cc8d83 Mon Sep 17 00:00:00 2001 From: MQ Date: Wed, 27 Aug 2025 13:29:45 +0200 Subject: [PATCH 03/11] fix: use latest git ref with the updated versions --- .github/workflows/release.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 0f84de3c..748339a4 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -48,7 +48,7 @@ jobs: name: Update changelog runs-on: ubuntu-latest outputs: - changelog_commitish: ${{ steps.commit.outputs.commit_long_sha || github.sha }} + changelog_commitish: ${{ steps.get_sha.outputs.commit_sha }} steps: - name: Checkout repository @@ -82,6 +82,10 @@ jobs: author_email: noreply@apify.com message: "chore(release): Update changelog, package.json and manifest.json versions [skip ci]" + - name: Get commit SHA + id: get_sha + run: echo "commit_sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT + create_github_release: name: Create github release needs: [release_metadata, update_changelog] From d9bda2c46aaccde397a28188aba7eaf8e3e1f640 Mon Sep 17 00:00:00 2001 From: MQ Date: Wed, 27 Aug 2025 13:38:14 +0200 Subject: [PATCH 04/11] add cheks and debug logs --- .github/workflows/release.yaml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 748339a4..eeec5228 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -96,6 +96,32 @@ jobs: - uses: actions/checkout@v4 with: ref: ${{ needs.update_changelog.changelog_commitish }} + - name: Log current commit SHA + run: | + CURRENT_SHA=$(git rev-parse HEAD) + EXPECTED_SHA="${{ needs.update_changelog.changelog_commitish }}" + echo "Expected commit SHA: $EXPECTED_SHA" + echo "Actual checked out SHA: $CURRENT_SHA" + if [ "$EXPECTED_SHA" != "$CURRENT_SHA" ]; then + echo "WARNING: Checked out SHA differs from expected!" + else + echo "✓ Commit SHA matches expected" + fi + - name: Verify manifest.json version + run: | + EXPECTED_VERSION="${{ needs.release_metadata.outputs.version_number }}" + ACTUAL_VERSION=$(jq -r '.version' manifest.json) + + echo "Expected version: $EXPECTED_VERSION" + echo "Actual version in manifest.json: $ACTUAL_VERSION" + echo "Current commit SHA: ${{ needs.update_changelog.changelog_commitish }}" + + if [ "$EXPECTED_VERSION" != "$ACTUAL_VERSION" ]; then + echo "ERROR: Version mismatch! Expected $EXPECTED_VERSION but found $ACTUAL_VERSION in manifest.json" + exit 1 + fi + + echo "✓ Version check passed: manifest.json has correct version $ACTUAL_VERSION" - name: Use Node.js 22 uses: actions/setup-node@v4 with: From 9478ff54af824fc8a6dd21ee77e6c91daf786da1 Mon Sep 17 00:00:00 2001 From: MQ Date: Wed, 27 Aug 2025 13:43:29 +0200 Subject: [PATCH 05/11] more logging and cheks --- .github/workflows/release.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index eeec5228..3c9c4261 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -48,7 +48,7 @@ jobs: name: Update changelog runs-on: ubuntu-latest outputs: - changelog_commitish: ${{ steps.get_sha.outputs.commit_sha }} + changelog_commitish: ${{ steps.get_sha.outputs.commit_sha || steps.commit.outputs.commit_long_sha || github.sha }} steps: - name: Checkout repository @@ -82,8 +82,16 @@ jobs: author_email: noreply@apify.com message: "chore(release): Update changelog, package.json and manifest.json versions [skip ci]" + - name: Debug commit info + run: | + echo "Commit long SHA: ${{ steps.commit.outputs.commit_long_sha }}" + echo "Current HEAD: $(git rev-parse HEAD)" + echo "Git log (last 2 commits):" + git log --oneline -2 + - name: Get commit SHA id: get_sha + if: steps.commit.outputs.commit_long_sha != '' run: echo "commit_sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT create_github_release: From 073cbaf61bdb41d41369b47ec841ff8595f5ebaa Mon Sep 17 00:00:00 2001 From: MQ Date: Wed, 27 Aug 2025 13:51:58 +0200 Subject: [PATCH 06/11] try to fix the ref handling --- .github/workflows/release.yaml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 3c9c4261..c353a403 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -48,7 +48,7 @@ jobs: name: Update changelog runs-on: ubuntu-latest outputs: - changelog_commitish: ${{ steps.get_sha.outputs.commit_sha || steps.commit.outputs.commit_long_sha || github.sha }} + changelog_commitish: ${{ steps.commit.outputs.commit_long_sha || github.sha }} steps: - name: Checkout repository @@ -91,7 +91,6 @@ jobs: - name: Get commit SHA id: get_sha - if: steps.commit.outputs.commit_long_sha != '' run: echo "commit_sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT create_github_release: @@ -101,9 +100,17 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: + - name: Validate commit SHA + run: | + COMMIT_SHA="${{ needs.update_changelog.changelog_commitish }}" + if [ -z "$COMMIT_SHA" ]; then + echo "ERROR: changelog_commitish is empty!" + exit 1 + fi + echo "Using commit SHA: $COMMIT_SHA" - uses: actions/checkout@v4 with: - ref: ${{ needs.update_changelog.changelog_commitish }} + ref: ${{ needs.update_changelog.changelog_commitish || github.sha }} - name: Log current commit SHA run: | CURRENT_SHA=$(git rev-parse HEAD) From 3bff84d14e3fba100e70c1b6b1511c718ac027ba Mon Sep 17 00:00:00 2001 From: MQ Date: Wed, 27 Aug 2025 13:56:13 +0200 Subject: [PATCH 07/11] fix output of commit step --- .github/workflows/release.yaml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index c353a403..dc555fa7 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -48,7 +48,7 @@ jobs: name: Update changelog runs-on: ubuntu-latest outputs: - changelog_commitish: ${{ steps.commit.outputs.commit_long_sha || github.sha }} + changelog_commitish: ${{ steps.get_sha.outputs.commit_sha }} steps: - name: Checkout repository @@ -91,7 +91,16 @@ jobs: - name: Get commit SHA id: get_sha - run: echo "commit_sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT + run: | + COMMIT_SHA=$(git rev-parse HEAD) + echo "commit_sha=$COMMIT_SHA" >> $GITHUB_OUTPUT + echo "Captured SHA: $COMMIT_SHA" + + - name: Debug final SHA + run: | + echo "Final changelog_commitish: ${{ steps.get_sha.outputs.commit_sha }}" + echo "Commit action SHA: ${{ steps.commit.outputs.commit_long_sha }}" + echo "Git HEAD: $(git rev-parse HEAD)" create_github_release: name: Create github release @@ -110,7 +119,7 @@ jobs: echo "Using commit SHA: $COMMIT_SHA" - uses: actions/checkout@v4 with: - ref: ${{ needs.update_changelog.changelog_commitish || github.sha }} + ref: ${{ needs.update_changelog.changelog_commitish }} - name: Log current commit SHA run: | CURRENT_SHA=$(git rev-parse HEAD) From ce00993657b54a164d4f9256c40012ad99d912ba Mon Sep 17 00:00:00 2001 From: MQ Date: Wed, 27 Aug 2025 14:05:29 +0200 Subject: [PATCH 08/11] fix outputs facepam --- .github/workflows/release.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index dc555fa7..8587e691 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -111,7 +111,7 @@ jobs: steps: - name: Validate commit SHA run: | - COMMIT_SHA="${{ needs.update_changelog.changelog_commitish }}" + COMMIT_SHA="${{ needs.update_changelog.outputs.changelog_commitish }}" if [ -z "$COMMIT_SHA" ]; then echo "ERROR: changelog_commitish is empty!" exit 1 @@ -119,11 +119,11 @@ jobs: echo "Using commit SHA: $COMMIT_SHA" - uses: actions/checkout@v4 with: - ref: ${{ needs.update_changelog.changelog_commitish }} + ref: ${{ needs.update_changelog.outputs.changelog_commitish }} - name: Log current commit SHA run: | CURRENT_SHA=$(git rev-parse HEAD) - EXPECTED_SHA="${{ needs.update_changelog.changelog_commitish }}" + EXPECTED_SHA="${{ needs.update_changelog.outputs.changelog_commitish }}" echo "Expected commit SHA: $EXPECTED_SHA" echo "Actual checked out SHA: $CURRENT_SHA" if [ "$EXPECTED_SHA" != "$CURRENT_SHA" ]; then @@ -136,11 +136,11 @@ jobs: EXPECTED_VERSION="${{ needs.release_metadata.outputs.version_number }}" ACTUAL_VERSION=$(jq -r '.version' manifest.json) - echo "Expected version: $EXPECTED_VERSION" - echo "Actual version in manifest.json: $ACTUAL_VERSION" - echo "Current commit SHA: ${{ needs.update_changelog.changelog_commitish }}" + echo "Expected version: $EXPECTED_VERSION" + echo "Actual version in manifest.json: $ACTUAL_VERSION" + echo "Current commit SHA: ${{ needs.update_changelog.outputs.changelog_commitish }}" - if [ "$EXPECTED_VERSION" != "$ACTUAL_VERSION" ]; then + if [ "$EXPECTED_VERSION" != "$ACTUAL_VERSION" ]; then echo "ERROR: Version mismatch! Expected $EXPECTED_VERSION but found $ACTUAL_VERSION in manifest.json" exit 1 fi @@ -186,7 +186,7 @@ jobs: # steps: # - uses: actions/checkout@v4 # with: - # ref: ${{ needs.update_changelog.changelog_commitish }} + # ref: ${{ needs.update_changelog.outputs.changelog_commitish }} # - name: Use Node.js 22 # uses: actions/setup-node@v4 # with: From 160a2319ddf519788e39a2a6475f4c0d1e66784e Mon Sep 17 00:00:00 2001 From: MQ Date: Wed, 27 Aug 2025 14:12:09 +0200 Subject: [PATCH 09/11] remove debug steps, keep the checks that fail the job on version mismatch --- .github/workflows/release.yaml | 60 +++++++++++++--------------------- 1 file changed, 23 insertions(+), 37 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 8587e691..7b1eda61 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -82,25 +82,11 @@ jobs: author_email: noreply@apify.com message: "chore(release): Update changelog, package.json and manifest.json versions [skip ci]" - - name: Debug commit info - run: | - echo "Commit long SHA: ${{ steps.commit.outputs.commit_long_sha }}" - echo "Current HEAD: $(git rev-parse HEAD)" - echo "Git log (last 2 commits):" - git log --oneline -2 - - name: Get commit SHA id: get_sha run: | COMMIT_SHA=$(git rev-parse HEAD) echo "commit_sha=$COMMIT_SHA" >> $GITHUB_OUTPUT - echo "Captured SHA: $COMMIT_SHA" - - - name: Debug final SHA - run: | - echo "Final changelog_commitish: ${{ steps.get_sha.outputs.commit_sha }}" - echo "Commit action SHA: ${{ steps.commit.outputs.commit_long_sha }}" - echo "Git HEAD: $(git rev-parse HEAD)" create_github_release: name: Create github release @@ -179,29 +165,29 @@ jobs: files: | actors-mcp-server.dxt - #publish_to_npm: - # name: Publish to NPM - # needs: [ update_changelog ] - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v4 - # with: - # ref: ${{ needs.update_changelog.outputs.changelog_commitish }} - # - name: Use Node.js 22 - # uses: actions/setup-node@v4 - # with: - # node-version: 22 - # cache: 'npm' - # cache-dependency-path: 'package-lock.json' - # - name: Install dependencies - # run: | - # echo "access=public" >> .npmrc - # echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc - # npm ci - # - name: Build module - # run: npm run build - # - name: Publish to NPM - # run: npm publish --tag latest + publish_to_npm: + name: Publish to NPM + needs: [ update_changelog ] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ needs.update_changelog.outputs.changelog_commitish }} + - name: Use Node.js 22 + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: 'npm' + cache-dependency-path: 'package-lock.json' + - name: Install dependencies + run: | + echo "access=public" >> .npmrc + echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc + npm ci + - name: Build module + run: npm run build + - name: Publish to NPM + run: npm publish --tag latest env: NODE_AUTH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_NPM_TOKEN }} From 98a193d3e64eb16d551aa5a482247c33c87b9b5f Mon Sep 17 00:00:00 2001 From: MQ Date: Wed, 27 Aug 2025 14:14:27 +0200 Subject: [PATCH 10/11] try with original output --- .github/workflows/release.yaml | 54 +++++++++++++++------------------- 1 file changed, 24 insertions(+), 30 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 7b1eda61..fadbafce 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -48,7 +48,7 @@ jobs: name: Update changelog runs-on: ubuntu-latest outputs: - changelog_commitish: ${{ steps.get_sha.outputs.commit_sha }} + changelog_commitish: ${{ steps.commit.outputs.commit_long_sha || github.sha }} steps: - name: Checkout repository @@ -82,12 +82,6 @@ jobs: author_email: noreply@apify.com message: "chore(release): Update changelog, package.json and manifest.json versions [skip ci]" - - name: Get commit SHA - id: get_sha - run: | - COMMIT_SHA=$(git rev-parse HEAD) - echo "commit_sha=$COMMIT_SHA" >> $GITHUB_OUTPUT - create_github_release: name: Create github release needs: [release_metadata, update_changelog] @@ -165,29 +159,29 @@ jobs: files: | actors-mcp-server.dxt - publish_to_npm: - name: Publish to NPM - needs: [ update_changelog ] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ needs.update_changelog.outputs.changelog_commitish }} - - name: Use Node.js 22 - uses: actions/setup-node@v4 - with: - node-version: 22 - cache: 'npm' - cache-dependency-path: 'package-lock.json' - - name: Install dependencies - run: | - echo "access=public" >> .npmrc - echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc - npm ci - - name: Build module - run: npm run build - - name: Publish to NPM - run: npm publish --tag latest + #publish_to_npm: + # name: Publish to NPM + # needs: [ update_changelog ] + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4 + # with: + # ref: ${{ needs.update_changelog.outputs.changelog_commitish }} + # - name: Use Node.js 22 + # uses: actions/setup-node@v4 + # with: + # node-version: 22 + # cache: 'npm' + # cache-dependency-path: 'package-lock.json' + # - name: Install dependencies + # run: | + # echo "access=public" >> .npmrc + # echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc + # npm ci + # - name: Build module + # run: npm run build + # - name: Publish to NPM + # run: npm publish --tag latest env: NODE_AUTH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_NPM_TOKEN }} From 89d198ea9087515e169343eff81ed2e51229ccc8 Mon Sep 17 00:00:00 2001 From: MQ Date: Wed, 27 Aug 2025 14:20:02 +0200 Subject: [PATCH 11/11] add version checks also to the npm publish job --- .github/workflows/release.yaml | 86 +++++++++++++++++++++------------- 1 file changed, 53 insertions(+), 33 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index fadbafce..c91fa3c7 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -89,25 +89,18 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - - name: Validate commit SHA - run: | - COMMIT_SHA="${{ needs.update_changelog.outputs.changelog_commitish }}" - if [ -z "$COMMIT_SHA" ]; then - echo "ERROR: changelog_commitish is empty!" - exit 1 - fi - echo "Using commit SHA: $COMMIT_SHA" - uses: actions/checkout@v4 with: ref: ${{ needs.update_changelog.outputs.changelog_commitish }} - - name: Log current commit SHA + - name: Verify commit SHA run: | CURRENT_SHA=$(git rev-parse HEAD) EXPECTED_SHA="${{ needs.update_changelog.outputs.changelog_commitish }}" echo "Expected commit SHA: $EXPECTED_SHA" echo "Actual checked out SHA: $CURRENT_SHA" if [ "$EXPECTED_SHA" != "$CURRENT_SHA" ]; then - echo "WARNING: Checked out SHA differs from expected!" + echo "ERROR: Checked out SHA differs from expected!" + exit 1 else echo "✓ Commit SHA matches expected" fi @@ -159,29 +152,56 @@ jobs: files: | actors-mcp-server.dxt - #publish_to_npm: - # name: Publish to NPM - # needs: [ update_changelog ] - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v4 - # with: - # ref: ${{ needs.update_changelog.outputs.changelog_commitish }} - # - name: Use Node.js 22 - # uses: actions/setup-node@v4 - # with: - # node-version: 22 - # cache: 'npm' - # cache-dependency-path: 'package-lock.json' - # - name: Install dependencies - # run: | - # echo "access=public" >> .npmrc - # echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc - # npm ci - # - name: Build module - # run: npm run build - # - name: Publish to NPM - # run: npm publish --tag latest + publish_to_npm: + name: Publish to NPM + needs: [ release_metadata, update_changelog ] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ needs.update_changelog.outputs.changelog_commitish }} + - name: Verify commit SHA + run: | + CURRENT_SHA=$(git rev-parse HEAD) + EXPECTED_SHA="${{ needs.update_changelog.outputs.changelog_commitish }}" + echo "Expected commit SHA: $EXPECTED_SHA" + echo "Actual checked out SHA: $CURRENT_SHA" + if [ "$EXPECTED_SHA" != "$CURRENT_SHA" ]; then + echo "ERROR: Checked out SHA differs from expected!" + exit 1 + else + echo "✓ Commit SHA matches expected" + fi + - name: Verify manifest.json version + run: | + EXPECTED_VERSION="${{ needs.release_metadata.outputs.version_number }}" + ACTUAL_VERSION=$(jq -r '.version' manifest.json) + + echo "Expected version: $EXPECTED_VERSION" + echo "Actual version in manifest.json: $ACTUAL_VERSION" + echo "Current commit SHA: ${{ needs.update_changelog.outputs.changelog_commitish }}" + + if [ "$EXPECTED_VERSION" != "$ACTUAL_VERSION" ]; then + echo "ERROR: Version mismatch! Expected $EXPECTED_VERSION but found $ACTUAL_VERSION in manifest.json" + exit 1 + fi + + echo "✓ Version check passed: manifest.json has correct version $ACTUAL_VERSION" + - name: Use Node.js 22 + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: 'npm' + cache-dependency-path: 'package-lock.json' + - name: Install dependencies + run: | + echo "access=public" >> .npmrc + echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc + npm ci + - name: Build module + run: npm run build + - name: Publish to NPM + run: npm publish --tag latest env: NODE_AUTH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_NPM_TOKEN }}