Skip to content

Commit

Permalink
Build Electron App (#345)
Browse files Browse the repository at this point in the history
* Build Electron App

* Change renovate

* Try linux build

* add executable name

* Try fixes

* Linux config

* Try adding linux out folder

* Remove windows?

* Try changing the product name

* Try changing the product name

* Fix the options

* Fix the shit
  • Loading branch information
petrvecera committed Jun 2, 2024
1 parent 5b1c599 commit 370c654
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 8 deletions.
8 changes: 2 additions & 6 deletions .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/electron-build-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build Electron App - Test
on:
pull_request:

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

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:linux
2 changes: 1 addition & 1 deletion .github/workflows/electron-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
20 changes: 20 additions & 0 deletions packages/app/forge.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ module.exports = {
asar: true,
icon: "assets/icon.ico",
extraResource: [".resources/node_modules", "assets"],
executableName: "coh2-game-stats",
},
makers: [
{
Expand All @@ -53,6 +54,25 @@ 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",
},
},
},
{
name: "@electron-forge/maker-deb",
executableName: "coh2-game-stats",
platforms: ["linux"],
config: {
setupIcon: "assets/icon.ico",
loadingGif: "assets/installSplash.gif",
options: {
name: "coh2-game-stats",
productName: "coh2-game-stats",
bin: "coh2-game-stats",
},
},
},
],
Expand Down
3 changes: 2 additions & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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 --out=release-builds",
"publish": "electron-forge publish",
"lint": "eslint --ext .ts,.tsx ."
},
Expand Down

0 comments on commit 370c654

Please sign in to comment.