diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index a661697..a24646f 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -3,7 +3,6 @@ name: Node.js on: push: branches: [ "main" ] - tags: [ '*' ] pull_request: branches: [ "main" ] @@ -60,14 +59,11 @@ jobs: path: getargv.js/pkg/* release: - if: ${{ github.ref_type == 'tag' }} needs: [ test ] runs-on: ubuntu-latest steps: - - uses: actions/download-artifact@v3 - with: - path: pkg - - uses: softprops/action-gh-release@v1 - with: - files: pkg/pack-*/* - name: ${{ github.ref_name }} + - uses: actions/checkout@v4 + - name: Bump Version + run: npm version minor + - name: Push tag + run: git push tag diff --git a/.github/workflows/npm.yml b/.github/workflows/npm.yml index ce1e7e6..ff20264 100644 --- a/.github/workflows/npm.yml +++ b/.github/workflows/npm.yml @@ -3,8 +3,8 @@ name: NPM Package on: - release: - types: [created] + push: + tags: [ '*' ] jobs: publish-gpr: @@ -12,6 +12,7 @@ jobs: permissions: contents: read packages: write + id-token: write steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v3 @@ -19,12 +20,14 @@ jobs: node-version: latest registry-url: https://npm.pkg.github.com/ - run: npm ci - - run: npm publish + - run: npm publish --provenance --access public env: NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} publish-npm: runs-on: macos-latest + permissions: + id-token: write steps: - uses: actions/checkout@v4 with: @@ -34,12 +37,12 @@ jobs: - name: Build libgetargv run: make install_dylib working-directory: getargv - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-node@v3 with: node-version: latest registry-url: https://registry.npmjs.org/ - run: npm ci - - run: npm publish + - run: npm publish --provenance --access public env: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}