From e41bd3da963ae087ce14e8452f640a37fbf96409 Mon Sep 17 00:00:00 2001 From: fisker Date: Wed, 28 Oct 2026 15:56:17 +0800 Subject: [PATCH 1/2] Setup trusted publishing --- .github/workflows/publish.yml | 32 ++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 4 ++-- 2 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..d5993c6 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,32 @@ +name: Publish Package + +on: + push: + tags: + - v* + +permissions: {} + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + publish: + runs-on: ubuntu-latest + permissions: + id-token: write + steps: + - name: Checkout + uses: actions/checkout@v7 + + - name: Setup Node.js + uses: actions/setup-node@v7 + with: + node-version: "lts/*" + + - name: Install Dependencies + run: yarn --immutable + + - name: Publish to NPM + run: npm publish diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 919ca9d..f53ec71 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,7 +23,7 @@ jobs: uses: actions/checkout@v7 - name: NPM Rebuild - run: yarn + run: yarn --immutable - name: Run tests run: yarn test-coverage @@ -44,7 +44,7 @@ jobs: uses: actions/checkout@v7 - name: NPM Rebuild - run: yarn + run: yarn --immutable - name: Run Linting run: yarn lint From 03fa913346f39dbb11a23f7202ea0a63499ae467 Mon Sep 17 00:00:00 2001 From: fisker Date: Wed, 28 Oct 2026 16:01:10 +0800 Subject: [PATCH 2/2] CLean --- .github/workflows/publish.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index d5993c6..1d6ded3 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -23,10 +23,13 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v7 with: - node-version: "lts/*" + node-version: 'lts/*' - name: Install Dependencies run: yarn --immutable + - name: Clean up + run: npm pkg delete scripts devDependencies ava c8 packageManager + - name: Publish to NPM run: npm publish