diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..3f5efa7 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,29 @@ +name: Publish Package + +on: + push: + tags: + - 'v*' + +permissions: + id-token: write # Required for OIDC + contents: read + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + + - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 + with: + node-version: '24.x' + registry-url: 'https://registry.npmjs.org' + + # Ensure npm 11.5.1 or later is installed + - name: Update npm + run: npm install -g npm@latest + - run: npm install --ignore-scripts + - run: npm run build --if-present + - run: npm test + - run: npm publish diff --git a/package.json b/package.json index 26a5f61..eba477d 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,11 @@ "test:integration": "npm run lint && npm run integration-test-only", "coverage": "c8 -r html npm test" }, + "publishConfig": { + "registry": "https://registry.npmjs.org", + "access": "public", + "provenance": true + }, "repository": { "type": "git", "url": "git+https://github.com/NodeSecure/vulnera.git"