Skip to content

Commit

Permalink
fix: create a version.ts file and use this for CLI version numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
geographika committed Jun 20, 2024
1 parent 2630c14 commit 53dd2c5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ jobs:
- name: Install dependencies ⏬
run: npm ci

- name: Build 🏗️
run: npm run build

- name: Release 🚀
uses: cycjimmy/semantic-release-action@v4.1.0
id: semantic
Expand Down
8 changes: 7 additions & 1 deletion .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,19 @@
}
}
],
[
"@semantic-release/exec",
{
"prepareCmd": "echo \"export default '${nextRelease.version}';\" > ./src/version.ts"
}
],
"@semantic-release/changelog",
"@semantic-release/npm",
[
"@semantic-release/git",
{
"assets": [
"CHANGELOG.md", "package.json", "package-lock.json"
"CHANGELOG.md", "package.json", "package-lock.json", "./src/version.ts"
],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"test": "node test.js",
"build-binaries": "npm run build && pkg package.json",
"package-binaries": "npm run build-binaries && node package-binaries.js",
"prepublishOnly": "npm run build",
"postpublish": "npm run package-binaries"
},
"pkg": {
Expand Down
2 changes: 1 addition & 1 deletion src/logHelper.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import gradient from 'gradient-string';
import { version } from '../package.json';
import version from './version';

Check failure on line 2 in src/logHelper.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

Cannot find module './version' or its corresponding type declarations.

export const logTitle = () :void => {
console.log(gradient('#611E82', '#272C82', '#00943D', '#FFED00', '#F48E00', '#E7000E').multiline(`
Expand Down

0 comments on commit 53dd2c5

Please sign in to comment.