Skip to content

Commit 920f1b6

Browse files
committed
configure semantic release
1 parent 40abbcc commit 920f1b6

File tree

3 files changed

+48
-7
lines changed

3 files changed

+48
-7
lines changed

.github/workflows/release.yml

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,29 @@
22
name: Publish Package to npmjs
33
run-name: ${{ github.actor }} publish to npm 🚀
44

5+
# on:
6+
# release:
7+
# types: [published]
58
on:
6-
release:
7-
types: [published]
9+
push:
10+
branches:
11+
# Change this if your primary branch is not main
12+
- master
13+
- develop
14+
15+
permissions:
16+
contents: read # for checkout
17+
818
jobs:
919
build:
1020
runs-on: ubuntu-latest
21+
environment:
22+
name: Grim #your environment name
1123
permissions:
12-
contents: read
13-
id-token: write # Needed for https://docs.npmjs.com/generating-provenance-statements
24+
contents: write # to be able to publish a GitHub release
25+
issues: write # to be able to comment on released issues
26+
pull-requests: write # to be able to comment on released pull requests
27+
id-token: write # to enable use of OIDC for npm provenance
1428
steps:
1529
- uses: actions/checkout@v4
1630
# need this for using yarn
@@ -25,8 +39,10 @@ jobs:
2539
cache: 'yarn'
2640
- run: yarn
2741
# for Yarn v1, use `yarn publish` instead
28-
- run: yarn npm publish
42+
# - run: yarn npm publish
43+
- run: npx semantic-release
2944
env:
3045
# this will be used in .yarnrc.yml
46+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
3147
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
3248

.releaserc

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"branches": [
3+
"main",
4+
"dev"
5+
],
6+
"plugins": [
7+
"@semantic-release/commit-analyzer",
8+
"@semantic-release/release-notes-generator",
9+
[
10+
"@semantic-release/changelog",
11+
{
12+
"changelogFile": "CHANGELOG.md"
13+
}
14+
],
15+
[
16+
"@semantic-release/git",
17+
{
18+
"assets": [
19+
"CHANGELOG.md"
20+
]
21+
}
22+
],
23+
"@semantic-release/github"
24+
25+
]
26+
}

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,5 @@
118118
"react-dom": "^18.2.0",
119119
"rimraf": "^5.0.5",
120120
"typescript": "^5.2.2"
121-
},
122-
"packageManager": "yarn@3.6.4"
121+
}
123122
}

0 commit comments

Comments
 (0)