File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,13 +12,13 @@ jobs:
1212
1313 strategy :
1414 matrix :
15- node-version : [20 .x, 22 .x]
15+ node-version : [22 .x, 24.x, 26 .x]
1616
1717 steps :
18- - uses : actions/checkout@v4
18+ - uses : actions/checkout@v6
1919
2020 - name : Use Node.js ${{ matrix.node-version }}
21- uses : actions/setup-node@v4
21+ uses : actions/setup-node@v6
2222 with :
2323 node-version : ${{ matrix.node-version }}
2424 cache : " npm"
3434
3535 - name : Generate coverage report
3636 run : npm run test:coverage
37- if : matrix.node-version == '20 .x'
37+ if : matrix.node-version == '22 .x'
Original file line number Diff line number Diff line change 44 push :
55 tags :
66 - " v*"
7+ workflow_dispatch :
8+ inputs :
9+ publish_mode :
10+ description : Choose dry-run for testing or publish to release
11+ required : true
12+ default : dry-run
13+ type : choice
14+ options :
15+ - dry-run
16+ - publish
717
818permissions :
919 id-token : write # Required for OIDC
@@ -14,22 +24,33 @@ jobs:
1424 runs-on : ubuntu-latest
1525
1626 steps :
17- - uses : actions/checkout@v4
27+ - uses : actions/checkout@v6
1828
1929 - name : Setup Node.js
20- uses : actions/setup-node@v4
30+ uses : actions/setup-node@v6
2131 with :
22- node-version : " 20 .x"
32+ node-version : " 24 .x"
2333 registry-url : " https://registry.npmjs.org"
2434
25- - name : Update npm
26- run : npm install -g npm@latest
35+ - name : Verify tag matches package version
36+ if : github.event_name == 'push'
37+ run : |
38+ expected_tag="v$(node -p "require('./package.json').version")"
39+ test "$GITHUB_REF_NAME" = "$expected_tag"
2740
2841 - name : Install dependencies
2942 run : npm ci
3043
44+ - name : Run linter
45+ run : npm run lint
46+
3147 - name : Run tests
3248 run : npm run test:run
3349
50+ - name : Dry-run npm publish
51+ if : github.event_name == 'workflow_dispatch' && github.event.inputs.publish_mode != 'publish'
52+ run : npm publish --dry-run --access public
53+
3454 - name : Publish to npm
35- run : npm publish
55+ if : github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.publish_mode == 'publish')
56+ run : npm publish --provenance --access public
Original file line number Diff line number Diff line change 2424 "types" : " form-saver.d.ts" ,
2525 "exports" : {
2626 "." : {
27+ "types" : " ./form-saver.d.ts" ,
2728 "import" : " ./index.js"
2829 },
2930 "./form-saver.js" : {
4546 " LICENSE"
4647 ],
4748 "engines" : {
48- "node" : " >=20 .0.0"
49+ "node" : " >=22 .0.0"
4950 },
5051 "scripts" : {
51- "setup" : " node scripts/setup.js" ,
5252 "test" : " vitest" ,
5353 "test:ui" : " vitest --ui" ,
5454 "test:run" : " vitest run" ,
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config';
33export default defineConfig ( {
44 test : {
55 environment : 'happy-dom' ,
6+ execArgv : [ '--no-experimental-webstorage' ] ,
67 globals : true ,
78 setupFiles : [ './test/setup.js' ] ,
89 } ,
You can’t perform that action at this time.
0 commit comments