Skip to content

Commit dbda1e5

Browse files
committed
fix(ci): updated ci and improved release scripts
1 parent 38cc19d commit dbda1e5

2 files changed

Lines changed: 31 additions & 18 deletions

File tree

.github/workflows/test.yml

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Test
33
on:
44
push:
55
branches:
6-
- main
6+
- main
77
pull_request:
88

99
jobs:
@@ -13,30 +13,41 @@ jobs:
1313
outputs:
1414
nodes: ${{ steps.nodes.outputs.nodes }}
1515
steps:
16-
- uses: actions/checkout@v4
17-
- uses: actions/setup-node@v3
16+
- uses: actions/checkout@v6
17+
- uses: actions/setup-node@v6
1818
- name: Setup Node Version Matrix
1919
id: nodes
2020
run: |
2121
NODES=$(npx -y @pkgjs/nv ls supported | jq '. | .version' | paste -sd "," -)
2222
echo "nodes=[${NODES}]" >> $GITHUB_OUTPUT
2323
24+
lint:
25+
runs-on: ubuntu-latest
26+
needs: setup
27+
steps:
28+
- uses: actions/checkout@v6
29+
- name: Use Node.js 24.x
30+
uses: actions/setup-node@v6
31+
with:
32+
node-version: 24.x
33+
- run: npm i
34+
- run: npm run lint
35+
2436
test:
25-
# uses: pkgjs/action/.github/workflows/node-test.yaml@v0
2637
runs-on: ubuntu-latest
2738
needs: setup
2839
strategy:
2940
matrix:
3041
node-version: ${{ fromJson(needs.setup.outputs.nodes) }}
3142
steps:
32-
- uses: actions/checkout@v4
33-
- name: Setup git user
34-
run: |
35-
git config --global user.name "$(git --no-pager log --format=format:'%an' -n 1)"
36-
git config --global user.email "$(git --no-pager log --format=format:'%ae' -n 1)"
37-
- name: Use Node.js ${{ matrix.node-version }}
38-
uses: actions/setup-node@v3
39-
with:
40-
node-version: ${{ matrix.node-version }}
41-
- name: npm install and test
42-
run: npm it
43+
- uses: actions/checkout@v6
44+
- name: Setup git user
45+
run: |
46+
git config --global user.name "$(git --no-pager log --format=format:'%an' -n 1)"
47+
git config --global user.email "$(git --no-pager log --format=format:'%ae' -n 1)"
48+
- name: Use Node.js ${{ matrix.node-version }}
49+
uses: actions/setup-node@v6
50+
with:
51+
node-version: ${{ matrix.node-version }}
52+
- name: npm install and test
53+
run: npm it

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@
88
"create-package-json": "bin/create-package-json"
99
},
1010
"scripts": {
11-
"test": "semistandard && mocha",
11+
"test": "mocha",
1212
"test:debug": "mocha --inspect --inspect-brk --timeout=0",
1313
"test:cover": "c8 mocha",
14+
"lint": "semistandard",
1415
"lint:fix": "semistandard --fix",
1516
"debug": "mocha --inspect --inspect-brk",
16-
"release": "npm t && standard-version && npm publish",
17-
"postpublish": "git push && git push --tags"
17+
"prerelease": "npm run lint && npm test && standard-version && npm login",
18+
"release": "npm publish --access=public --tag=\"${1:-latest}\"",
19+
"postrelease": "(npm logout || true) && git push --follow-tags && gh release create --draft --generate-notes \"v$(cat package.json | jq -r .version)\""
1820
},
1921
"repository": {
2022
"type": "git",

0 commit comments

Comments
 (0)