Skip to content

Commit 74252a8

Browse files
committed
build: build executables via GH actions
1 parent f34d53e commit 74252a8

File tree

2 files changed

+72
-24
lines changed

2 files changed

+72
-24
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: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,17 @@ const { FuseV1Options, FuseVersion } = require("@electron/fuses");
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-
name: '@electron-forge/maker-deb',
23-
config: {},
24-
}, */
25-
{
26-
name: "@electron-forge/maker-rpm",
27-
config: {},
12+
name: "@electron-forge/maker-zip",
13+
platforms: ["darwin"],
2814
},
2915
{
30-
name: "@electron-forge/maker-dmg",
31-
platforms: ["darwin"],
32-
config: {
33-
title: "ilr_file_creator",
34-
arch: "universal",
35-
overwrite: true,
36-
},
16+
name: "@electron-forge/maker-zip",
17+
platforms: ["win32"],
3718
},
3819
],
3920
plugins: [

0 commit comments

Comments
 (0)