From 0baeaf17a435d90e65757e2532847c6e66b6795f Mon Sep 17 00:00:00 2001 From: Juncheng Yang Date: Wed, 18 Jun 2025 20:21:17 +0000 Subject: [PATCH] fix github action triggering a new release upon each commit --- .github/workflows/npm-release.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/npm-release.yml b/.github/workflows/npm-release.yml index 06de9b28..4d253c2e 100644 --- a/.github/workflows/npm-release.yml +++ b/.github/workflows/npm-release.yml @@ -14,6 +14,7 @@ env: jobs: create-release: + if: github.event_name == 'release' runs-on: ubuntu-latest outputs: release_created: ${{ steps.release.outputs.release_created }} @@ -70,6 +71,7 @@ jobs: prerelease: false build-and-publish: + if: github.event_name == 'release' needs: create-release runs-on: ubuntu-latest @@ -130,6 +132,7 @@ jobs: node -e "console.log('Testing binary load...'); try { require('./index.js'); console.log('Binary loaded successfully!'); } catch(e) { console.error('Failed to load binary:', e); process.exit(1); }" publish-npm: + if: github.event_name == 'release' needs: build-and-publish runs-on: ubuntu-latest @@ -161,6 +164,7 @@ jobs: cp _build/liblibCacheSim.a libCacheSim-node/vendor/ cp -r libCacheSim/include/* libCacheSim-node/vendor/include/ + - name: Publish to NPM working-directory: libCacheSim-node run: npm publish --access public