From 532b82f7afc71c1ad2bd4805f30778adeb61f7d3 Mon Sep 17 00:00:00 2001 From: Petr Vecera Date: Sun, 2 Jun 2024 18:03:24 +0200 Subject: [PATCH 01/12] Build Electron App --- .github/workflows/electron-build-test.yaml | 36 ++++++++++++++++++++++ packages/app/forge.config.js | 8 +++++ 2 files changed, 44 insertions(+) create mode 100644 .github/workflows/electron-build-test.yaml diff --git a/.github/workflows/electron-build-test.yaml b/.github/workflows/electron-build-test.yaml new file mode 100644 index 00000000..16b2cd83 --- /dev/null +++ b/.github/workflows/electron-build-test.yaml @@ -0,0 +1,36 @@ +name: Build Electron App - Test +on: + pull_request: + +jobs: + linux_build: + name: Build Electron App on Linux + runs-on: ubuntu-latest + + concurrency: + group: electron-build-${{ github.ref }} + cancel-in-progress: true + + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: "20.x" + cache: "yarn" + - name: Cache node modules + uses: actions/cache@v4 + env: + cache-name: cache-node-modules-v2 + with: + path: | + node_modules + */*/node_modules + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + - name: Install Web Project + run: yarn --prefer-offline --frozen-lockfile install + - name: Build Electron App + run: yarn app make diff --git a/packages/app/forge.config.js b/packages/app/forge.config.js index e7508fac..8d5cea0c 100644 --- a/packages/app/forge.config.js +++ b/packages/app/forge.config.js @@ -55,6 +55,14 @@ module.exports = { loadingGif: "assets/installSplash.gif", }, }, + { + name: '@electron-forge/maker-deb', + config: { + name: "coh2-game-stats", + setupIcon: "assets/icon.ico", + loadingGif: "assets/installSplash.gif", + }, + }, ], hooks: { prePackage: () => { From 4cb9fc795c32a975de23bbff5d4cdf0f61235bec Mon Sep 17 00:00:00 2001 From: Petr Vecera Date: Sun, 2 Jun 2024 18:08:35 +0200 Subject: [PATCH 02/12] Change renovate --- .github/renovate.json | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/renovate.json b/.github/renovate.json index d9dbc8e8..704f7837 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -7,12 +7,8 @@ "labels": ["renovate"], "packageRules": [ { - "packageNames": ["@types/node"], - "enabled": false - }, - { - "packageNames": ["node"], - "enabled": false + "packageNames": ["@types/node", "node"], + "allowedVersions": "20.x" }, { "datasources": ["github-actions"], From cf45c619a5dfea3d035274ea966a70e1d842689a Mon Sep 17 00:00:00 2001 From: Petr Vecera Date: Sun, 2 Jun 2024 18:12:10 +0200 Subject: [PATCH 03/12] Try linux build --- .github/workflows/electron-build-test.yaml | 2 +- packages/app/package.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/electron-build-test.yaml b/.github/workflows/electron-build-test.yaml index 16b2cd83..31061181 100644 --- a/.github/workflows/electron-build-test.yaml +++ b/.github/workflows/electron-build-test.yaml @@ -33,4 +33,4 @@ jobs: - name: Install Web Project run: yarn --prefer-offline --frozen-lockfile install - name: Build Electron App - run: yarn app make + run: yarn app make:linux diff --git a/packages/app/package.json b/packages/app/package.json index bcf2f1d3..e81fdc12 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -9,6 +9,7 @@ "start": "electron-forge start", "package": "electron-forge package", "make": "electron-forge make", + "make:linux": "electron-forge make -- --arch=x64 --platform=linux", "publish": "electron-forge publish", "lint": "eslint --ext .ts,.tsx ." }, From b68337b786dc8cf4c8ee5b15ef78f70412e3c409 Mon Sep 17 00:00:00 2001 From: Petr Vecera Date: Sun, 2 Jun 2024 18:20:47 +0200 Subject: [PATCH 04/12] add executable name --- packages/app/forge.config.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/app/forge.config.js b/packages/app/forge.config.js index 8d5cea0c..ca681e3f 100644 --- a/packages/app/forge.config.js +++ b/packages/app/forge.config.js @@ -56,7 +56,8 @@ module.exports = { }, }, { - name: '@electron-forge/maker-deb', + name: "@electron-forge/maker-deb", + executableName: "coh2-game-stats", config: { name: "coh2-game-stats", setupIcon: "assets/icon.ico", From cdea1bde3cdf3238c7417721f44db4d52dc1b684 Mon Sep 17 00:00:00 2001 From: Petr Vecera Date: Sun, 2 Jun 2024 18:30:36 +0200 Subject: [PATCH 05/12] Try fixes --- .github/workflows/electron-build.yaml | 2 +- packages/app/forge.config.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/electron-build.yaml b/.github/workflows/electron-build.yaml index c84c22b6..52388602 100644 --- a/.github/workflows/electron-build.yaml +++ b/.github/workflows/electron-build.yaml @@ -43,7 +43,7 @@ jobs: run: yarn app make - name: Upload the build - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: coh2-game-stats-dev-${{github.sha}} path: | diff --git a/packages/app/forge.config.js b/packages/app/forge.config.js index ca681e3f..369363a4 100644 --- a/packages/app/forge.config.js +++ b/packages/app/forge.config.js @@ -58,10 +58,12 @@ module.exports = { { name: "@electron-forge/maker-deb", executableName: "coh2-game-stats", + platforms: ["linux"], config: { name: "coh2-game-stats", setupIcon: "assets/icon.ico", loadingGif: "assets/installSplash.gif", + productName: "coh2-game-stats", }, }, ], From e6009add2ef5a782f20811781a54c1e81c39e879 Mon Sep 17 00:00:00 2001 From: Petr Vecera Date: Sun, 2 Jun 2024 18:34:26 +0200 Subject: [PATCH 06/12] Linux config --- packages/app/forge.config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/app/forge.config.js b/packages/app/forge.config.js index 369363a4..43c69bf7 100644 --- a/packages/app/forge.config.js +++ b/packages/app/forge.config.js @@ -45,6 +45,7 @@ module.exports = { asar: true, icon: "assets/icon.ico", extraResource: [".resources/node_modules", "assets"], + executableName: "coh2-game-stats", }, makers: [ { From 54519e71034be28b02a6289d68bc329227b9310e Mon Sep 17 00:00:00 2001 From: Petr Vecera Date: Sun, 2 Jun 2024 18:39:26 +0200 Subject: [PATCH 07/12] Try adding linux out folder --- packages/app/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/app/package.json b/packages/app/package.json index e81fdc12..d68599fc 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -9,7 +9,7 @@ "start": "electron-forge start", "package": "electron-forge package", "make": "electron-forge make", - "make:linux": "electron-forge make -- --arch=x64 --platform=linux", + "make:linux": "electron-forge make -- --arch=x64 --platform=linux --out=release-builds", "publish": "electron-forge publish", "lint": "eslint --ext .ts,.tsx ." }, From 9d7dddbbb0b90e1d6bc912df1744c4b4e0564eee Mon Sep 17 00:00:00 2001 From: Petr Vecera Date: Sun, 2 Jun 2024 18:43:03 +0200 Subject: [PATCH 08/12] Remove windows? --- packages/app/forge.config.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/app/forge.config.js b/packages/app/forge.config.js index 43c69bf7..721ea91b 100644 --- a/packages/app/forge.config.js +++ b/packages/app/forge.config.js @@ -48,14 +48,14 @@ module.exports = { executableName: "coh2-game-stats", }, makers: [ - { - name: "@electron-forge/maker-squirrel", - config: { - name: "coh2-game-stats", - setupIcon: "assets/icon.ico", - loadingGif: "assets/installSplash.gif", - }, - }, + // { + // name: "@electron-forge/maker-squirrel", + // config: { + // name: "coh2-game-stats", + // setupIcon: "assets/icon.ico", + // loadingGif: "assets/installSplash.gif", + // }, + // }, { name: "@electron-forge/maker-deb", executableName: "coh2-game-stats", From 4ef27c35f66cb046fb5b7c238629295ed1956c37 Mon Sep 17 00:00:00 2001 From: Petr Vecera Date: Sun, 2 Jun 2024 18:49:49 +0200 Subject: [PATCH 09/12] Try changing the product name --- packages/app/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/app/package.json b/packages/app/package.json index d68599fc..2f281e87 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,6 +1,6 @@ { "name": "@coh2stats/app", - "productName": "Coh2 Game Stats", + "productName": "coh2-game-stats", "version": "1.5.15", "description": "Displays stats of players in the current Coh2 game", "main": ".webpack/main", From 1ffdb3cf4af39f1ea7d873d555379dbba809fd4a Mon Sep 17 00:00:00 2001 From: Petr Vecera Date: Sun, 2 Jun 2024 18:50:00 +0200 Subject: [PATCH 10/12] Try changing the product name --- packages/app/forge.config.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/app/forge.config.js b/packages/app/forge.config.js index 721ea91b..43c69bf7 100644 --- a/packages/app/forge.config.js +++ b/packages/app/forge.config.js @@ -48,14 +48,14 @@ module.exports = { executableName: "coh2-game-stats", }, makers: [ - // { - // name: "@electron-forge/maker-squirrel", - // config: { - // name: "coh2-game-stats", - // setupIcon: "assets/icon.ico", - // loadingGif: "assets/installSplash.gif", - // }, - // }, + { + name: "@electron-forge/maker-squirrel", + config: { + name: "coh2-game-stats", + setupIcon: "assets/icon.ico", + loadingGif: "assets/installSplash.gif", + }, + }, { name: "@electron-forge/maker-deb", executableName: "coh2-game-stats", From b5727b0addf77f9cfa5e6f329d737eaf15d9d409 Mon Sep 17 00:00:00 2001 From: Petr Vecera Date: Sun, 2 Jun 2024 18:55:22 +0200 Subject: [PATCH 11/12] Fix the options --- packages/app/forge.config.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/app/forge.config.js b/packages/app/forge.config.js index 43c69bf7..7c24a1b8 100644 --- a/packages/app/forge.config.js +++ b/packages/app/forge.config.js @@ -61,10 +61,13 @@ module.exports = { executableName: "coh2-game-stats", platforms: ["linux"], config: { - name: "coh2-game-stats", setupIcon: "assets/icon.ico", loadingGif: "assets/installSplash.gif", - productName: "coh2-game-stats", + options: { + name: "coh2-game-stats", + productName: "coh2-game-stats", + bin: "coh2-game-stats", + } }, }, ], From 32fb8ceda30b5b3b649403f075331caa35f46a1a Mon Sep 17 00:00:00 2001 From: Petr Vecera Date: Sun, 2 Jun 2024 19:04:52 +0200 Subject: [PATCH 12/12] Fix the shit --- .github/workflows/electron-build-test.yaml | 1 + packages/app/forge.config.js | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/electron-build-test.yaml b/.github/workflows/electron-build-test.yaml index 31061181..b9e278f0 100644 --- a/.github/workflows/electron-build-test.yaml +++ b/.github/workflows/electron-build-test.yaml @@ -4,6 +4,7 @@ on: jobs: linux_build: + # This is run only on Windows, because windows takes soo long to build name: Build Electron App on Linux runs-on: ubuntu-latest diff --git a/packages/app/forge.config.js b/packages/app/forge.config.js index 7c24a1b8..e52ae6d8 100644 --- a/packages/app/forge.config.js +++ b/packages/app/forge.config.js @@ -54,6 +54,11 @@ module.exports = { name: "coh2-game-stats", setupIcon: "assets/icon.ico", loadingGif: "assets/installSplash.gif", + platform: ["win32"], + win32metadata: { + CompanyName: "COH Stats", + FileDescription: "Displays live stats of players in the current COH2 game", + }, }, }, { @@ -67,7 +72,7 @@ module.exports = { name: "coh2-game-stats", productName: "coh2-game-stats", bin: "coh2-game-stats", - } + }, }, }, ],