Skip to content

Commit

Permalink
configure semantic release
Browse files Browse the repository at this point in the history
  • Loading branch information
tiavina-mika committed Apr 30, 2024
1 parent 40abbcc commit 920f1b6
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 7 deletions.
26 changes: 21 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,29 @@
name: Publish Package to npmjs
run-name: ${{ github.actor }} publish to npm 🚀

# on:
# release:
# types: [published]
on:
release:
types: [published]
push:
branches:
# Change this if your primary branch is not main
- master
- develop

permissions:
contents: read # for checkout

jobs:
build:
runs-on: ubuntu-latest
environment:
name: Grim #your environment name
permissions:
contents: read
id-token: write # Needed for https://docs.npmjs.com/generating-provenance-statements
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance
steps:
- uses: actions/checkout@v4
# need this for using yarn
Expand All @@ -25,8 +39,10 @@ jobs:
cache: 'yarn'
- run: yarn
# for Yarn v1, use `yarn publish` instead
- run: yarn npm publish
# - run: yarn npm publish
- run: npx semantic-release
env:
# this will be used in .yarnrc.yml
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

26 changes: 26 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"branches": [
"main",
"dev"
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md"
}
],
[
"@semantic-release/git",
{
"assets": [
"CHANGELOG.md"
]
}
],
"@semantic-release/github"

]
}
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,5 @@
"react-dom": "^18.2.0",
"rimraf": "^5.0.5",
"typescript": "^5.2.2"
},
"packageManager": "[email protected]"
}
}

0 comments on commit 920f1b6

Please sign in to comment.