File tree Expand file tree Collapse file tree 3 files changed +49
-69
lines changed
Expand file tree Collapse file tree 3 files changed +49
-69
lines changed Original file line number Diff line number Diff line change 77 branches : [main, develop]
88
99jobs :
10- build :
10+ lint :
1111 runs-on : ubuntu-latest
12-
13- steps :
14- - uses : actions/checkout@v3
15- - name : Set up Node 22.19.0
16- uses : actions/setup-node@v4
17- with :
18- node-version : ' 22.19.0'
19- cache : ' npm'
20- registry-url : ' https://registry.npmjs.org'
21-
22- - name : Install dependencies
23- run : npm clean-install
24- env :
25- NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
26-
27- - name : Lint code with standard
28- run : npm run lint
12+ name : Lint
13+ steps :
14+ - uses : tetherto/oss-actions/node-base@v1
15+ - run : npm run lint
16+ test :
17+ strategy :
18+ matrix :
19+ include :
20+ - os : ubuntu-latest
21+ platform : linux
22+ runs-on : ${{ matrix.os }}
23+ name : Test / ${{ matrix.platform }}
24+ steps :
25+ - uses : tetherto/oss-actions/node-base@v1
26+ - run : npm test
Original file line number Diff line number Diff line change 1+ name : Release to public npm
2+ on :
3+ pull_request :
4+ types : [closed]
5+ branches :
6+ - main
7+ jobs :
8+ approve-release :
9+ if : " ${{ github.event.pull_request.merged == true && startsWith(github.event.pull_request.title, 'Release: ') }}"
10+ runs-on : ubuntu-latest
11+ environment : release
12+ permissions :
13+ contents : write
14+ id-token : write
15+ steps :
16+ - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
17+ with :
18+ persist-credentials : false
19+ - uses : actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
20+ with :
21+ node-version : lts/*
22+ registry-url : ' https://registry.npmjs.org'
23+ - run : |
24+ VERSION=$(node -p "require('./package.json').version")
25+ npm version $VERSION --no-git-tag-version --allow-same-version
26+ git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
27+ if ! git ls-remote --tags origin | grep -q "refs/tags/v$VERSION$"; then
28+ git tag "v$VERSION"
29+ git push origin "v$VERSION"
30+ fi
31+ npm publish --access public --provenance --tag latest --ignore-scripts
32+ env:
33+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments