Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Electron App #345

Merged
merged 12 commits into from
Jun 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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