From 1740630fd2e83c47d289e7011d63b80458e70b80 Mon Sep 17 00:00:00 2001 From: James Garbutt <43081j@users.noreply.github.com> Date: Sat, 7 Sep 2024 13:45:00 +0700 Subject: [PATCH] feat: use provenance and tags for publishing (#212) --- .github/workflows/publish.yml | 23 ++++++++++++++++------- package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8bb76aa..1cbc4d7 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -24,15 +24,24 @@ jobs: publish-npm: needs: build runs-on: ubuntu-latest + permissions: + id-token: write steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: 20 - registry-url: https://registry.npmjs.org/ - - name: Install Dependencies - run: npm ci - - name: Publish - run: npm publish + node-version: 22.x + registry-url: 'https://registry.npmjs.org' + cache: 'npm' + - run: npm ci + - run: npm version ${TAG_NAME} --git-tag-version=false + env: + TAG_NAME: ${{ github.ref_name }} + - run: npm publish --provenance --access public --tag next + if: "github.event.release.prerelease" + env: + NODE_AUTH_TOKEN: ${{ secrets.npm_token }} + - run: npm publish --provenance --access public + if: "!github.event.release.prerelease" env: - NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + NODE_AUTH_TOKEN: ${{ secrets.npm_token }} diff --git a/package-lock.json b/package-lock.json index 0b903a0..ca2f0c1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "eslint-plugin-lit", - "version": "1.14.0", + "version": "0.0.0-dev", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "eslint-plugin-lit", - "version": "1.14.0", + "version": "0.0.0-dev", "license": "MIT", "dependencies": { "parse5": "^6.0.1", diff --git a/package.json b/package.json index c892d94..eda0d1a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-lit", - "version": "1.14.0", + "version": "0.0.0-dev", "description": "lit-html support for ESLint", "main": "lib/index.js", "files": [