Skip to content

Commit bdb9c8d

Browse files
Merge pull request #16 from foundersandcoders/feat/build-package
Create package to run on MacOS
2 parents 661bae1 + 74252a8 commit bdb9c8d

File tree

2 files changed

+75
-28
lines changed

2 files changed

+75
-28
lines changed

.github/workflows/build.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Build and Release
2+
3+
on:
4+
push:
5+
branches: [main, feat/build-package]
6+
pull_request:
7+
branches: [main]
8+
workflow_dispatch:
9+
10+
jobs:
11+
build:
12+
strategy:
13+
matrix:
14+
os: [macos-latest, windows-latest]
15+
include:
16+
- os: macos-latest
17+
platform: darwin
18+
- os: windows-latest
19+
platform: win32
20+
21+
runs-on: ${{ matrix.os }}
22+
23+
steps:
24+
- name: Checkout code
25+
uses: actions/checkout@v4
26+
27+
- name: Setup Node.js
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version: "20"
31+
cache: "npm"
32+
33+
- name: Install dependencies
34+
run: npm ci
35+
36+
- name: Build Electron app
37+
run: npm run make
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
41+
- name: Upload artifacts
42+
uses: actions/upload-artifact@v4
43+
with:
44+
name: ${{ matrix.platform }}-build
45+
path: out/make/**/*
46+
47+
release:
48+
needs: build
49+
runs-on: ubuntu-latest
50+
if: github.ref == 'refs/heads/main'
51+
52+
steps:
53+
- name: Download all artifacts
54+
uses: actions/download-artifact@v4
55+
56+
- name: Create Release
57+
uses: softprops/action-gh-release@v1
58+
with:
59+
tag_name: v${{ github.run_number }}
60+
name: Release ${{ github.run_number }}
61+
draft: true
62+
files: |
63+
**/*.zip
64+
**/*.exe
65+
**/*.dmg
66+
env:
67+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

forge.config.js

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,25 @@
1-
const { FusesPlugin } = require('@electron-forge/plugin-fuses');
2-
const { FuseV1Options, FuseVersion } = require('@electron/fuses');
1+
const { FusesPlugin } = require("@electron-forge/plugin-fuses");
2+
const { FuseV1Options, FuseVersion } = require("@electron/fuses");
33

44
module.exports = {
55
packagerConfig: {
66
asar: true,
7+
platform: ["darwin", "win32"],
78
},
89
rebuildConfig: {},
910
makers: [
1011
{
11-
name: '@electron-forge/maker-squirrel',
12-
config: {},
13-
},
14-
{
15-
name: '@electron-forge/maker-zip',
16-
platforms: ['darwin'],
17-
config: {
18-
arch: 'universal'
19-
}
20-
},
21-
22-
{
23-
name: '@electron-forge/maker-deb',
24-
config: {},
25-
},
26-
{
27-
name: '@electron-forge/maker-rpm',
28-
config: {},
12+
name: "@electron-forge/maker-zip",
13+
platforms: ["darwin"],
2914
},
3015
{
31-
name: '@electron-forge/maker-dmg',
32-
platforms: ['darwin'],
33-
config: {
34-
title: 'ilr_file_creator',
35-
arch: 'universal',
36-
overwrite: true
37-
}
16+
name: "@electron-forge/maker-zip",
17+
platforms: ["win32"],
3818
},
3919
],
4020
plugins: [
4121
{
42-
name: '@electron-forge/plugin-auto-unpack-natives',
22+
name: "@electron-forge/plugin-auto-unpack-natives",
4323
config: {},
4424
},
4525
// Fuses are used to enable/disable various Electron functionality

0 commit comments

Comments
 (0)