Skip to content

Commit ea3ae4e

Browse files
authored
Merge pull request #90 from hkdobrev/publish
2 parents 64c377e + 8563142 commit ea3ae4e

File tree

2 files changed

+19
-15
lines changed

2 files changed

+19
-15
lines changed

.github/workflows/publish.yml

+16-15
Original file line numberDiff line numberDiff line change
@@ -7,45 +7,46 @@ on:
77
jobs:
88
build:
99
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
node-version: [ 18, 20, 22 ]
1013
steps:
11-
- uses: actions/checkout@v1
14+
- uses: actions/checkout@v4
1215
- name: Use Node.js ${{ matrix.node-version }}
13-
uses: actions/setup-node@v1
16+
uses: actions/setup-node@v4
1417
with:
15-
node-version: 12
18+
node-version: ${{ matrix.node-version }}
19+
cache: 'npm'
1620
- name: npm install, build, and test
1721
run: |
1822
npm ci
1923
npm run build --if-present
2024
npm test
21-
env:
22-
CI: true
2325
2426
publish-npm:
2527
needs: build
2628
runs-on: ubuntu-latest
2729
steps:
28-
- uses: actions/checkout@v1
29-
- uses: actions/setup-node@v1
30+
- uses: actions/checkout@v4
31+
- uses: actions/setup-node@v4
3032
with:
31-
node-version: 12
33+
cache: 'npm'
3234
registry-url: https://registry.npmjs.org/
3335
- run: npm ci
34-
- run: npm publish
36+
- run: npm publish --provenance --access public
3537
env:
36-
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
38+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
3739

3840
publish-gpr:
3941
needs: build
4042
runs-on: ubuntu-latest
4143
steps:
42-
- uses: actions/checkout@v1
43-
- uses: actions/setup-node@v1
44+
- uses: actions/checkout@v4
45+
- uses: actions/setup-node@v4
4446
with:
45-
node-version: 12
47+
cache: 'npm'
4648
registry-url: https://npm.pkg.github.com/
47-
scope: '@hkdobrev'
4849
- run: npm ci
49-
- run: npm publish
50+
- run: npm publish --provenance --access public
5051
env:
5152
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

package.json

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
"author": "Haralan Dobrev <[email protected]>",
99
"license": "MIT",
1010
"private": false,
11+
"engines": {
12+
"node": ">=18 <23"
13+
},
1114
"dependencies": {
1215
"cosmiconfig": "^9.0.0",
1316
"execa": "^5.1.1",

0 commit comments

Comments
 (0)