Skip to content

Commit e749c31

Browse files
authored
fix(ci): updated ci and improved release scripts (#234)
1 parent f34de1f commit e749c31

File tree

2 files changed

+34
-18
lines changed

2 files changed

+34
-18
lines changed

.github/workflows/test.yml

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

9+
permissions:
10+
content: read
11+
912
jobs:
1013
setup:
1114
name: Setup
1215
runs-on: ubuntu-latest
1316
outputs:
1417
nodes: ${{ steps.nodes.outputs.nodes }}
1518
steps:
16-
- uses: actions/checkout@v4
17-
- uses: actions/setup-node@v3
19+
- uses: actions/checkout@v6
20+
- uses: actions/setup-node@v6
1821
- name: Setup Node Version Matrix
1922
id: nodes
2023
run: |
2124
NODES=$(npx -y @pkgjs/nv ls supported | jq '. | .version' | paste -sd "," -)
2225
echo "nodes=[${NODES}]" >> $GITHUB_OUTPUT
2326
27+
lint:
28+
runs-on: ubuntu-latest
29+
needs: setup
30+
steps:
31+
- uses: actions/checkout@v6
32+
- name: Use Node.js 24.x
33+
uses: actions/setup-node@v6
34+
with:
35+
node-version: 24.x
36+
- run: npm i
37+
- run: npm run lint
38+
2439
test:
25-
# uses: pkgjs/action/.github/workflows/node-test.yaml@v0
2640
runs-on: ubuntu-latest
2741
needs: setup
2842
strategy:
2943
matrix:
3044
node-version: ${{ fromJson(needs.setup.outputs.nodes) }}
3145
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
46+
- uses: actions/checkout@v6
47+
- name: Setup git user
48+
run: |
49+
git config --global user.name "$(git --no-pager log --format=format:'%an' -n 1)"
50+
git config --global user.email "$(git --no-pager log --format=format:'%ae' -n 1)"
51+
- name: Use Node.js ${{ matrix.node-version }}
52+
uses: actions/setup-node@v6
53+
with:
54+
node-version: ${{ matrix.node-version }}
55+
- name: npm install and test
56+
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)