Skip to content

Commit 2da79e5

Browse files
committed
ci: Update release workflow to edit initial version and use npm scripts for semantic release
1 parent 670ce7d commit 2da79e5

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.github/workflows/release.yml

+7-2
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,20 @@ jobs:
2828
- name: Build NPM package
2929
run: npm run build
3030

31+
- name: Edit Inital Version
32+
run: sed -i 's/\( FIRST_RELEASE\) = "1.0.0"/\1 = "3.0.0"/' node_modules/semantic-release/lib/definitions/constants.js
33+
- name: Edit Inital Version
34+
run: sed -i 's/\( FIRSTPRERELEASE\) = "1"/\1 = "3"/' node_modules/semantic-release/lib/definitions/constants.js
35+
3136
- name: Create Release
3237
if: github.event_name == 'push'
3338
env:
3439
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3540
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
36-
run: npx semantic-release
41+
run: npm run semantic-release
3742

3843
- name: Dry Run Release
3944
if: github.event_name == 'pull_request'
4045
env:
4146
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42-
run: npx semantic-release --dry-run
47+
run: npm run semantic-release --dry-run

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"dev": "tsc -w",
1212
"pub": "npm run build && npm publish",
1313
"pub@beta": "npm run build && npm publish --tag beta",
14+
"semantic-release": "semantic-release",
1415
"lint": "biome check ."
1516
},
1617
"repository": {

0 commit comments

Comments
 (0)