Helper
This commit is contained in:
@@ -43,10 +43,7 @@ jobs:
|
|||||||
- name: Get version from package.json
|
- name: Get version from package.json
|
||||||
id: version
|
id: version
|
||||||
working-directory: electron-app
|
working-directory: electron-app
|
||||||
shell: pwsh
|
run: node scripts/get-version.js
|
||||||
run: |
|
|
||||||
$VERSION = node -p "require('./package.json').version"
|
|
||||||
echo "VERSION=$VERSION" >> $env:GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Create Release and Upload exe
|
- name: Create Release and Upload exe
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
|
|||||||
12
electron-app/scripts/get-version.js
Normal file
12
electron-app/scripts/get-version.js
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
const fs = require('fs');
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
const pkgPath = path.join(__dirname, '..', 'package.json');
|
||||||
|
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
|
||||||
|
|
||||||
|
const outputFile = process.env.GITHUB_OUTPUT;
|
||||||
|
if (outputFile) {
|
||||||
|
fs.appendFileSync(outputFile, `VERSION=${pkg.version}\n`);
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(pkg.version);
|
||||||
Reference in New Issue
Block a user