Skip to content

Commit

Permalink
Fix windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
ebrehault committed Apr 5, 2024
1 parent f11d6cb commit 41a9518
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 18 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
39 changes: 39 additions & 0 deletions .github/workflows/debug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: build
on:
push:
branches:
- main

jobs:
build_job_windows:
runs-on: self-hosted

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@master
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

- name: install dependencies server
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: check package
run: cat electron-app/package.json

- name: check source
run: cat electron-app/src/index.ts
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 41a9518

Please sign in to comment.