File tree Expand file tree Collapse file tree 4 files changed +43
-14
lines changed Expand file tree Collapse file tree 4 files changed +43
-14
lines changed Original file line number Diff line number Diff line change 11name : release
2+
23on :
34 push :
45 branches :
56 - main
7+
8+ permissions :
9+ contents : write
10+ issues : write
11+ pull-requests : write
12+
613jobs :
714 release :
815 name : release
916 runs-on : ubuntu-latest
1017 steps :
18+ # build local version to create token
1119 - uses : actions/checkout@v4
20+ with :
21+ persist-credentials : false
22+
1223 - uses : actions/setup-node@v4
1324 with :
14- node-version : ' 20'
25+ node-version-file : .node-version
26+ cache : ' npm'
27+
1528 - run : npm ci
1629 - run : npm run build
17- - run : rm .gitignore # dist/ folder is ignored by default
18- - run : |
19- git config user.name github-actions
20- git config user.email github-actions@github.com
21- git add .gitignore dist/
22- git commit -m "build"
23- git push --force https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git HEAD:refs/heads/v3
24- env:
25- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26- - run : npx semantic-release
30+ - uses : actions/create-github-app-token@v1
31+ id : app-token
32+ with :
33+ app-id : ${{ vars.RELEASER_APP_ID }}
34+ private-key : ${{ secrets.RELEASER_APP_PRIVATE_KEY }}
35+ # install release dependencies and release
36+ - run : npm install --no-save @semantic-release/git semantic-release-plugin-github-breaking-version-tag
37+ - run : npx semantic-release --debug
2738 env :
28- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
39+ GITHUB_TOKEN : ${{ steps.app-token.outputs.token }}
Original file line number Diff line number Diff line change 1- dist
2- node_modules /
1+ node_modules /
Original file line number Diff line number Diff line change 1+ 20
Original file line number Diff line number Diff line change 2929 },
3030 "release" : {
3131 "branches" : [
32+ " +([0-9]).x" ,
3233 " main"
34+ ],
35+ "plugins" : [
36+ " @semantic-release/commit-analyzer" ,
37+ " @semantic-release/release-notes-generator" ,
38+ " @semantic-release/github" ,
39+ " @semantic-release/npm" ,
40+ " semantic-release-plugin-github-breaking-version-tag" ,
41+ [
42+ " @semantic-release/git" ,
43+ {
44+ "assets" : [
45+ " package.json" ,
46+ " dist/*"
47+ ],
48+ "message" : " build(release): ${nextRelease.version} [skip ci]\n\n ${nextRelease.notes}"
49+ }
50+ ]
3351 ]
3452 }
3553}
You can’t perform that action at this time.
0 commit comments