From f34d53e4002d0a17441ee52568eedbb757f1c54a Mon Sep 17 00:00:00 2001 From: Jason Warren Date: Mon, 1 Sep 2025 15:33:55 +0100 Subject: [PATCH 1/2] build: remove surplus package output types --- forge.config.js | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/forge.config.js b/forge.config.js index 6daf2bd..e4ac97e 100644 --- a/forge.config.js +++ b/forge.config.js @@ -1,5 +1,5 @@ -const { FusesPlugin } = require('@electron-forge/plugin-fuses'); -const { FuseV1Options, FuseVersion } = require('@electron/fuses'); +const { FusesPlugin } = require("@electron-forge/plugin-fuses"); +const { FuseV1Options, FuseVersion } = require("@electron/fuses"); module.exports = { packagerConfig: { @@ -8,38 +8,37 @@ module.exports = { rebuildConfig: {}, makers: [ { - name: '@electron-forge/maker-squirrel', + name: "@electron-forge/maker-squirrel", config: {}, }, - { + /* { name: '@electron-forge/maker-zip', platforms: ['darwin'], config: { arch: 'universal' } - }, - - { + }, */ + /* { name: '@electron-forge/maker-deb', config: {}, - }, + }, */ { - name: '@electron-forge/maker-rpm', + name: "@electron-forge/maker-rpm", config: {}, }, { - name: '@electron-forge/maker-dmg', - platforms: ['darwin'], + name: "@electron-forge/maker-dmg", + platforms: ["darwin"], config: { - title: 'ilr_file_creator', - arch: 'universal', - overwrite: true - } + title: "ilr_file_creator", + arch: "universal", + overwrite: true, + }, }, ], plugins: [ { - name: '@electron-forge/plugin-auto-unpack-natives', + name: "@electron-forge/plugin-auto-unpack-natives", config: {}, }, // Fuses are used to enable/disable various Electron functionality From 74252a8af2d2062949f9ef5e67567c474eebeed9 Mon Sep 17 00:00:00 2001 From: Jason Warren Date: Mon, 1 Sep 2025 16:24:19 +0100 Subject: [PATCH 2/2] build: build executables via GH actions --- .github/workflows/build.yml | 67 +++++++++++++++++++++++++++++++++++++ forge.config.js | 29 +++------------- 2 files changed, 72 insertions(+), 24 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..04ec4d9 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,67 @@ +name: Build and Release + +on: + push: + branches: [main, feat/build-package] + pull_request: + branches: [main] + workflow_dispatch: + +jobs: + build: + strategy: + matrix: + os: [macos-latest, windows-latest] + include: + - os: macos-latest + platform: darwin + - os: windows-latest + platform: win32 + + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "20" + cache: "npm" + + - name: Install dependencies + run: npm ci + + - name: Build Electron app + run: npm run make + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.platform }}-build + path: out/make/**/* + + release: + needs: build + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' + + steps: + - name: Download all artifacts + uses: actions/download-artifact@v4 + + - name: Create Release + uses: softprops/action-gh-release@v1 + with: + tag_name: v${{ github.run_number }} + name: Release ${{ github.run_number }} + draft: true + files: | + **/*.zip + **/*.exe + **/*.dmg + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/forge.config.js b/forge.config.js index e4ac97e..ceceff7 100644 --- a/forge.config.js +++ b/forge.config.js @@ -4,36 +4,17 @@ const { FuseV1Options, FuseVersion } = require("@electron/fuses"); module.exports = { packagerConfig: { asar: true, + platform: ["darwin", "win32"], }, rebuildConfig: {}, makers: [ { - name: "@electron-forge/maker-squirrel", - config: {}, - }, - /* { - name: '@electron-forge/maker-zip', - platforms: ['darwin'], - config: { - arch: 'universal' - } - }, */ - /* { - name: '@electron-forge/maker-deb', - config: {}, - }, */ - { - name: "@electron-forge/maker-rpm", - config: {}, + name: "@electron-forge/maker-zip", + platforms: ["darwin"], }, { - name: "@electron-forge/maker-dmg", - platforms: ["darwin"], - config: { - title: "ilr_file_creator", - arch: "universal", - overwrite: true, - }, + name: "@electron-forge/maker-zip", + platforms: ["win32"], }, ], plugins: [