Skip to content

Commit 28ffda4

Browse files
committed
ci: optimize and upgrade jobs and actions
1 parent a41dbcf commit 28ffda4

2 files changed

Lines changed: 10 additions & 30 deletions

File tree

.github/workflows/npm-publish.yml

Lines changed: 7 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,19 @@ on:
99
- v[0-9]+.[0-9]+.[0-9]+*
1010

1111
jobs:
12-
build:
12+
publish-npm:
1313
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
id-token: write
1417
steps:
1518
- name: Checkout repository
16-
uses: actions/checkout@v4
19+
uses: actions/checkout@v6
1720
- name: Use Node.js
18-
uses: actions/setup-node@v4
21+
uses: actions/setup-node@v6
1922
with:
2023
node-version: 24
24+
registry-url: https://registry.npmjs.org/
2125
- name: Install dependencies
2226
run: npm ci
2327
- name: Build TypeScript (first pass)
@@ -33,29 +37,5 @@ jobs:
3337
run: npm run format:check
3438
- name: Test schema validity
3539
run: npm test
36-
37-
publish-npm:
38-
needs: build
39-
runs-on: ubuntu-latest
40-
permissions:
41-
contents: read
42-
id-token: write
43-
steps:
44-
- name: Checkout repository
45-
uses: actions/checkout@v4
46-
- name: Use Node.js
47-
uses: actions/setup-node@v4
48-
with:
49-
node-version: 24
50-
registry-url: https://registry.npmjs.org/
51-
- name: Install dependencies
52-
run: npm ci
53-
- name: Build TypeScript (first pass)
54-
run: npm run build
55-
continue-on-error: true
56-
- name: Generate Typings
57-
run: npm run generate
58-
- name: Build TypeScript (second pass)
59-
run: npm run build
6040
- name: Publish to npm
6141
run: npm publish --provenance --access public

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
branches: [ "main" ]
1111

1212
jobs:
13-
build:
13+
test:
1414

1515
runs-on: ubuntu-latest
1616

@@ -21,9 +21,9 @@ jobs:
2121

2222
steps:
2323
- name: Checkout repository
24-
uses: actions/checkout@v4
24+
uses: actions/checkout@v6
2525
- name: Use Node.js ${{ matrix.node-version }}
26-
uses: actions/setup-node@v4
26+
uses: actions/setup-node@v6
2727
with:
2828
node-version: ${{ matrix.node-version }}
2929
cache: 'npm'

0 commit comments

Comments
 (0)