Skip to content

Commit

Permalink
Fix windows build (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
ebrehault authored Apr 5, 2024
1 parent c1b8673 commit 9685d87
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 19 deletions.
24 changes: 9 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ jobs:
with:
node-version: 20

- name: Get package version
run: node utils/get-version.js >> $GITHUB_ENV

- name: install dependencies electron-app
run: npm install
working-directory: electron-app
Expand All @@ -44,6 +41,9 @@ jobs:
run: npm run test
working-directory: server

- name: Get package version
run: node utils/get-version.js >> $GITHUB_ENV

- name: Tag if new version
uses: pkgdeps/[email protected]
with:
Expand Down Expand Up @@ -89,13 +89,10 @@ jobs:
with:
node-version: 20

- name: Get package version
run: node utils/get-version.js >> $GITHUB_ENV

- name: Set version in source
run: |-
node utils/set-version.js electron-app/package.json ${{ env.PACKAGE_VERSION }}
node utils/set-version.js electron-app/src/index.ts ${{ env.PACKAGE_VERSION }}
node utils/set-version.js electron-app/package.json
node utils/set-version.js electron-app/src/index.ts
- name: install dependencies electron-app
run: npm install
Expand Down Expand Up @@ -160,8 +157,10 @@ jobs:
with:
node-version: 20

- name: Get package version
run: node utils/get-version.js >> $GITHUB_ENV
- name: Set version in source
run: |-
node utils/set-version.js electron-app/package.json
node utils/set-version.js electron-app/src/index.ts
- name: install dependencies electron-app
run: npm install
Expand All @@ -171,11 +170,6 @@ jobs:
run: npm install
working-directory: server

- name: Set version in source
run: |-
node utils/set-version.js electron-app/package.json ${{ env.PACKAGE_VERSION }}
node utils/set-version.js electron-app/src/index.ts ${{ env.PACKAGE_VERSION }}
- name: compile server
env:
CI: false
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nuclia-sync-agent-app",
"version": "1.2.13",
"version": "1.2.14",
"description": "This is a Nuclia Sync Agent App",
"main": "build/index.js",
"scripts": {
Expand Down
7 changes: 4 additions & 3 deletions utils/set-version.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
const fs = require('fs');
function replaceStringInFile(filePath, version) {
const { version } = require('../package.json');

function replaceStringInFile(filePath) {
const content = fs.readFileSync(filePath, 'utf8');
const version0 = /"version": "0\.0\.0"/;
const firstPass = content.replace(version0, `"version": "${version}"`);
Expand All @@ -9,5 +11,4 @@ function replaceStringInFile(filePath, version) {
}

const filePath = process.argv[2];
const version = process.argv[3];
replaceStringInFile(filePath, version);
replaceStringInFile(filePath);

0 comments on commit 9685d87

Please sign in to comment.