Skip to content
This repository was archived by the owner on Apr 13, 2025. It is now read-only.

Commit c34334c

Browse files
committed
fix: build typescript in prepublish scripts
This fixes the problem that the cli gets built before semantic-releaser updates the version. Because of this the released `0.1.0` shows `0.0.1` when running `nodecg-io --version` because it was built with that version which copies the `package.json` into the `build` directory. Then semantic-release updates the version and the copied `package.json` isn't updated. With this change we don't build the cli in a ci step anymore, but with the npm `prepublish` hook. That way semantic-release will bump the version and run `npm publish` which will then build the cli with the update version.
1 parent fd2e0ed commit c34334c

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

.github/workflows/release.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ jobs:
1919

2020
- name: Install dependencies
2121
run: npm ci
22-
- name: Build
23-
run: npm run build
2422

2523
- name: Release
2624
env:

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"format": "prettier --write \"./**/*.{ts,json,md,js}\"",
1414
"format-pre-commit": "pretty-quick --staged --pattern '*/**/*.{ts,json,md,js}'",
1515
"prepare": "husky install",
16-
"semantic-release": "semantic-release"
16+
"semantic-release": "semantic-release",
17+
"prepublish": "npm run build"
1718
},
1819
"bin": {
1920
"nodecg-io": "index.js"

0 commit comments

Comments
 (0)