From a131bcd3d752abcb01837d9747f81dcce37e6aef Mon Sep 17 00:00:00 2001 From: Kevin Rocker Date: Sun, 15 Sep 2024 00:37:45 +0100 Subject: [PATCH] Investigating release actions, part 2 --- .github/workflows/release.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index baadca2..e9a4bd4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,6 +1,8 @@ name: Deploy to NPM on: + release: + types: [published] push: branches: - main @@ -8,10 +10,13 @@ on: jobs: deploy: runs-on: ubuntu-latest - + permissions: + id-token: write steps: - name: Checkout repository uses: actions/checkout@v4 + with: + fetch-depth: 1 - name: Setup Node.js uses: actions/setup-node@v4 @@ -20,13 +25,8 @@ jobs: registry-url: 'https://registry.npmjs.org' cache: 'npm' - - name: Install dependencies - run: npm ci - - # - name: Update package version - # run: npm version ${{ github.event.release.tag_name }} --no-git-tag-version - - - name: Publish to NPM - run: npm publish --provenance --access public + - run: npm ci + - run: npm version ${{ github.event.release.tag_name }} --no-git-tag-version + - run: npm publish --provenance --access public env: NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }} \ No newline at end of file