From 5c6723436c9355c7fe0aef4a4e288b303b4b3829 Mon Sep 17 00:00:00 2001 From: Wojciech Maj Date: Wed, 18 Oct 2023 14:57:51 +0200 Subject: [PATCH] Add support for npm provenance --- .github/workflows/publish.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ac1c384..9430769 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -33,6 +33,7 @@ jobs: uses: actions/setup-node@v3 with: node-version: '20' + registry-url: 'https://registry.npmjs.org' - name: Enable Corepack run: corepack enable @@ -40,14 +41,17 @@ jobs: - name: Install dependencies run: yarn --immutable + - name: Generate archive + run: yarn pack + - name: Publish with latest tag if: github.event.release.prelease == false - run: yarn npm publish --tag latest + run: npm publish package.tgz --tag latest --provenance env: - YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Publish with next tag if: github.event.release.prelease == true - run: yarn npm publish --tag next + run: npm publish package.tgz --tag next --provenance env: - YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}