-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathforge.config.js
More file actions
83 lines (78 loc) · 1.94 KB
/
forge.config.js
File metadata and controls
83 lines (78 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
const { execSync } = require('child_process');
// Get repository info dynamically from git remote
function getRepoInfo() {
// In GitHub Actions, use the GITHUB_REPOSITORY environment variable
if (process.env.GITHUB_REPOSITORY) {
const [owner, name] = process.env.GITHUB_REPOSITORY.split('/');
return { owner, name };
}
// Fallback: read from git remote
try {
const remoteUrl = execSync('git remote get-url origin', { encoding: 'utf8' }).trim();
// Handle various git URL formats:
// https://github.com/owner/repo.git
// git@github.com:owner/repo.git
const match = remoteUrl.match(/(?:github\.com[/:]|github\.com\/)([^/]+)\/([^/]+?)(?:\.git)?$/i);
if (match) {
return { owner: match[1], name: match[2] };
}
} catch (e) {
console.log('Could not determine repository from git remote:', e.message);
}
// Final fallback to defaults
return { owner: 'wavelog', name: 'WaveLogGate' };
}
const repoInfo = getRepoInfo();
module.exports = {
packagerConfig: {
// set config executableName
executableName: "wlgate",
icon: './icon',
asar: true,
// Windows updater configuration
productName: "WaveLogGate",
win32Metadata: {
companyName: "DJ7NT"
}
},
publishers: [
{
name: '@electron-forge/publisher-github',
config: {
repository: {
owner: repoInfo.owner,
name: repoInfo.name
},
prerelease: false
}
}
],
rebuildConfig: {},
makers: [
{
name: '@electron-forge/maker-squirrel',
config: { icon: "./icon.png", maintainer: 'DJ7NT', loadingGif: "loading.gif", name: "WLGate_by_DJ7NT" },
},
{
name: '@electron-forge/maker-dmg',
config: { format: 'UDZO' },
platforms: ['darwin'],
arch: ['x64','arm64'],
},
{
name: '@electron-forge/maker-zip',
platforms: ['darwin'],
},
{
name: '@electron-forge/maker-deb',
config: { "bin":"wlgate" },
arch: ['x86','armv7l']
},
],
plugins: [
{
name: '@electron-forge/plugin-auto-unpack-natives',
config: {},
},
],
};