Skip to content

Commit

Permalink
Use semantic-release and release beta pre-release on other branches
Browse files Browse the repository at this point in the history
  • Loading branch information
henokgetachew committed Aug 23, 2024
1 parent ba2441a commit 63154a8
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 8 deletions.
19 changes: 11 additions & 8 deletions .github/workflows/npm-publish-cht-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ name: Publish cht-deploy to npm
on:
push:
branches:
- master
- '**'
paths:
- 'scripts/deploy/**'

jobs:
publish:
Expand All @@ -14,7 +16,9 @@ jobs:

steps:
- uses: actions/checkout@v4

with:
fetch-depth: 0

- name: Set up Node
uses: actions/setup-node@v3
with:
Expand All @@ -26,9 +30,8 @@ jobs:
- name: Run tests
run: npm test

- name: Publish to npm
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
access: public
package: ./scripts/deploy/package.json
- name: Semantic Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release --config ./scripts/deploy/.releaserc.json
24 changes: 24 additions & 0 deletions scripts/deploy/.releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"branches": [
"master",
{
"name": "*",
"prerelease": "beta"
}
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
["@semantic-release/changelog", {
"changelogFile": "CHANGELOG.md"
}],
["@semantic-release/npm", {
"npmPublish": true
}],
"@semantic-release/github",
["@semantic-release/git", {
"assets": ["package.json", "CHANGELOG.md"],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}]
]
}

0 comments on commit 63154a8

Please sign in to comment.