Skip to content

Commit 4c42223

Browse files
committed
Fix outdated publish action
- Update Node.js from 18.x to 20.x to match package.json requirement (>=20) - Remove redundant cache action (setup-node has built-in caching) - Add required permissions for GITHUB_TOKEN (contents, packages, pull-requests, issues) - Add registry-url and NODE_AUTH_TOKEN for proper npm authentication - Split release steps for better clarity and debugging
1 parent 22f943e commit 4c42223

1 file changed

Lines changed: 15 additions & 15 deletions

File tree

.github/workflows/npm.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ jobs:
88
release:
99
runs-on: ubuntu-latest
1010
if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')"
11+
permissions:
12+
contents: write
13+
packages: write
14+
pull-requests: write
15+
issues: write
1116
steps:
1217
- uses: actions/checkout@v4
1318
with:
@@ -16,27 +21,22 @@ jobs:
1621
- name: Prepare repository
1722
run: git fetch --unshallow --tags || true
1823

19-
- name: Use Node.js 18.x
24+
- name: Use Node.js 20.x
2025
uses: actions/setup-node@v4
2126
with:
22-
node-version: 18.x
27+
node-version: 20.x
2328
cache: 'yarn'
29+
registry-url: 'https://registry.npmjs.org'
2430

25-
- name: Cache node modules
26-
uses: actions/cache@v4
27-
with:
28-
path: |
29-
node_modules
30-
~/.cache/yarn
31-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
32-
restore-keys: |
33-
${{ runner.os }}-yarn-
31+
- name: Install dependencies
32+
run: yarn install --frozen-lockfile
33+
34+
- name: Build package
35+
run: yarn build
3436

3537
- name: Create Release
3638
env:
3739
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3840
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
39-
run: |
40-
yarn install --frozen-lockfile
41-
yarn build
42-
yarn release
41+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
42+
run: yarn release

0 commit comments

Comments
 (0)