From 4ff14234caa2d8a694a3848be1023c8e31565c06 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Sat, 16 Nov 2024 22:53:38 +0800 Subject: [PATCH] chore: publish on CI --- .github/workflows/release.yml | 15 ++++++++++++++- package.json | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a49cbfc..85bef55 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,12 +1,13 @@ name: Release permissions: + id-token: write contents: write on: push: tags: - - 'v*' + - v* jobs: release: @@ -16,10 +17,22 @@ jobs: with: fetch-depth: 0 + - uses: pnpm/action-setup@v4 + - uses: actions/setup-node@v4 with: node-version: lts/* + registry-url: https://registry.npmjs.org/ + cache: pnpm + + - run: pnpm install - run: npx changelogithub + continue-on-error: true env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + + - run: pnpm publish + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + NPM_CONFIG_PROVENANCE: true diff --git a/package.json b/package.json index 1643dba..dc8aeee 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "prepublishOnly": "npm run build", "build": "unbuild", "stub": "unbuild --stub", - "release": "bumpp && npm publish", + "release": "bumpp", "lint": "eslint .", "test": "vitest" },