generated from codibre/boilerplate-base
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: creating semantic-release pipeline
- Loading branch information
1 parent
05b04b8
commit afd3cf2
Showing
2 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: semantic-release | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
|
||
jobs: | ||
semantic: | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | ||
NPM_TOKEN: ${{secrets.NPM_TOKEN}} | ||
HUSKY: 0 | ||
CI: true | ||
steps: | ||
- uses: actions/checkout@master | ||
with: | ||
token: ${{ secrets.GH_TOKEN }} | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: "22.x" | ||
- run: printf "//`node -p \"require('url').parse('https://registry.npmjs.org').host\"`/:_authToken=${NPM_TOKEN}\n" >> ~/.npmrc | ||
- run: npm ci | ||
- run: npm run build --if-present | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: "lts/*" | ||
- run: previousVersion=$(sed 's/.*"version": "\(.*\)".*/\1/;t;d' ./package.json) | ||
- run: npm i -g @semantic-release/changelog @semantic-release/commit-analyzer @semantic-release/git @semantic-release/github @semantic-release/exec @semantic-release/npm @semantic-release/release-notes-generator semantic-release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | ||
NPM_TOKEN: ${{secrets.NPM_TOKEN}} | ||
HUSKY: 0 | ||
CI: true | ||
- run: npx semantic-release --ci | ||
- run: finalVersion=$(sed 's/.*"version": "\(.*\)".*/\1/;t;d' ./package.json) | ||
- run: | | ||
if [ "$previousVersion" != "$finalVersion" ]; then | ||
git push | ||
sed -i "s/\*\*@codibre\/fluent-iterable\*\*/**fast-iterable**/g" README.md | ||
sed -i "s/@codibre\/fluent-iterable/fast-iterable/g" package*.json | ||
npm publish | ||
fi | ||
env: | ||
NPM_TOKEN: ${{secrets.NPM_TOKEN}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"branches": [ | ||
"master" | ||
], | ||
"plugins": [ | ||
"@semantic-release/commit-analyzer", | ||
"@semantic-release/changelog", | ||
"@semantic-release/release-notes-generator", | ||
"@semantic-release/npm", | ||
"@semantic-release/github", | ||
"@semantic-release/git" | ||
], | ||
"preset": "angular" | ||
} |