Skip to content

Commit

Permalink
Fix building Linux AppImage. Required update to latest version of mak…
Browse files Browse the repository at this point in the history
…er-appimage and move to Node 21
  • Loading branch information
chrismaltby committed Mar 15, 2024
1 parent 0a04aef commit 6296baf
Show file tree
Hide file tree
Showing 6 changed files with 164 additions and 666 deletions.
29 changes: 17 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 2
jobs:
checkout:
docker:
- image: circleci/node:lts-buster
- image: cimg/node:21.6.2
working_directory: ~/repo
steps:
- restore_cache:
Expand Down Expand Up @@ -31,7 +31,7 @@ jobs:
- repo
test:
docker:
- image: circleci/node:lts-buster
- image: cimg/node:21.6.2
working_directory: ~/repo
steps:
- attach_workspace:
Expand All @@ -40,7 +40,7 @@ jobs:

"make:mac":
docker:
- image: circleci/node:lts-buster
- image: cimg/node:21.6.2
working_directory: ~/repo
steps:
- attach_workspace:
Expand All @@ -55,7 +55,7 @@ jobs:

"make:mac-intel":
docker:
- image: circleci/node:lts-buster
- image: cimg/node:21.6.2
working_directory: ~/repo
steps:
- attach_workspace:
Expand All @@ -70,7 +70,7 @@ jobs:

"make:win32":
docker:
- image: circleci/node:lts-buster
- image: cimg/node:21.6.2
working_directory: ~/repo
steps:
- run: sudo dpkg --add-architecture i386
Expand All @@ -95,7 +95,7 @@ jobs:

"make:win64":
docker:
- image: circleci/node:lts-buster
- image: cimg/node:21.6.2
working_directory: ~/repo
steps:
- run: sudo dpkg --add-architecture i386
Expand All @@ -120,7 +120,7 @@ jobs:

"make:linux":
docker:
- image: circleci/node:lts-buster
- image: cimg/node:21.6.2
working_directory: ~/repo
steps:
- run: sudo apt-get -y update
Expand All @@ -141,7 +141,7 @@ jobs:

upload_artifacts:
docker:
- image: circleci/node:lts-buster
- image: cimg/node:21.6.2
working_working_directory: /
steps:
- attach_workspace:
Expand Down Expand Up @@ -173,6 +173,7 @@ workflows:
- brushtoolbar-ts
- uge_v6_fixes
- hotfix-321
- appimage-fix
- "make:mac-intel":
requires:
- checkout
Expand All @@ -196,7 +197,8 @@ workflows:
- uge_v6
- brushtoolbar-ts
- uge_v6_fixes
- hotfix-321
- hotfix-321
- appimage-fix
- "make:win64":
requires:
- checkout
Expand All @@ -211,7 +213,8 @@ workflows:
- uge_v6
- brushtoolbar-ts
- uge_v6_fixes
- hotfix-321
- hotfix-321
- appimage-fix
- "make:linux":
requires:
- checkout
Expand All @@ -226,7 +229,8 @@ workflows:
- uge_v6
- brushtoolbar-ts
- uge_v6_fixes
- hotfix-321
- hotfix-321
- appimage-fix
- "upload_artifacts":
requires:
- "make:mac"
Expand All @@ -245,4 +249,5 @@ workflows:
- uge_v6
- brushtoolbar-ts
- uge_v6_fixes
- hotfix-321
- hotfix-321
- appimage-fix
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.11.1
21.7.1
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Or to run from source, clone this repo then:
> npm start
```

GB Studio currently uses Node 20.11.1 LTS. If you have [NVM](https://github.com/nvm-sh/nvm) installed you can use the included `.nvmrc` to switch to the supported Node version.
GB Studio currently uses Node 21.7.1. If you have [NVM](https://github.com/nvm-sh/nvm) installed you can use the included `.nvmrc` to switch to the supported Node version.

```bash
> cd gb-studio
Expand Down
241 changes: 121 additions & 120 deletions forge.config.js
Original file line number Diff line number Diff line change
@@ -1,133 +1,134 @@
const { FusesPlugin } = require("@electron-forge/plugin-fuses");
const { FuseV1Options, FuseVersion } = require("@electron/fuses");

module.exports = {
makers: [
{
name: "@electron-forge/maker-squirrel",
config: {
name: "gb_studio",
exe: "gb-studio.exe",
loadingGif: "src/assets/app/install.gif",
setupIcon: "src/assets/app/icon/app_icon.ico",
module.exports = async () => {
const { MakerAppImage } = await import("@reforged/maker-appimage");

return {
makers: [
{
name: "@electron-forge/maker-squirrel",
config: {
name: "gb_studio",
exe: "gb-studio.exe",
loadingGif: "src/assets/app/install.gif",
setupIcon: "src/assets/app/icon/app_icon.ico",
},
},
{
name: "@electron-forge/maker-zip",
platforms: ["darwin", "win32"],
},
new MakerAppImage({}),
{
name: "@electron-forge/maker-deb",
config: {},
},
{
name: "@electron-forge/maker-rpm",
config: {},
},
],
packagerConfig: {
name: "GB Studio",
executableName: "gb-studio",
packageManager: "yarn",
icon: "src/assets/app/icon/app_icon",
darwinDarkModeSupport: true,
extendInfo: "src/assets/app/Info.plist",
extraResource: ["src/assets/app/icon/gbsproj.icns"],
afterCopy: ["./src/lib/forge/hooks/after-copy"],
asar: true,
appBundleId: "dev.gbstudio.gbstudio",
osxSign: {
"hardened-runtime": true,
entitlements: "./entitlements.plist",
},
},
{
name: "@electron-forge/maker-zip",
platforms: ["darwin", "win32"],
},
{
name: "@reforged/maker-appimage",
config: {},
},
{
name: "@electron-forge/maker-deb",
config: {},
},
{
name: "@electron-forge/maker-rpm",
config: {},
},
],
packagerConfig: {
name: "GB Studio",
executableName: "gb-studio",
packageManager: "yarn",
icon: "src/assets/app/icon/app_icon",
darwinDarkModeSupport: true,
extendInfo: "src/assets/app/Info.plist",
extraResource: ["src/assets/app/icon/gbsproj.icns"],
afterCopy: ["./src/lib/forge/hooks/after-copy"],
asar: true,
appBundleId: "dev.gbstudio.gbstudio",
osxSign: {
"hardened-runtime": true,
entitlements: './entitlements.plist'
},
},
hooks: {
postPackage: require("./src/lib/forge/hooks/notarize"),
},
plugins: [
{
name: "@electron-forge/plugin-auto-unpack-natives",
config: {},
hooks: {
postPackage: require("./src/lib/forge/hooks/notarize"),
},
{
name: "@electron-forge/plugin-webpack",
config: {
mainConfig: "./webpack.main.config.js",
renderer: {
config: "./webpack.renderer.config.js",
nodeIntegration: false,
entryPoints: [
{
html: "./src/app/project/project.html",
js: "./src/app/project/ProjectRoot.tsx",
preload: {
js: "./src/app/project/preload.ts",
plugins: [
{
name: "@electron-forge/plugin-auto-unpack-natives",
config: {},
},
{
name: "@electron-forge/plugin-webpack",
config: {
mainConfig: "./webpack.main.config.js",
renderer: {
config: "./webpack.renderer.config.js",
nodeIntegration: false,
entryPoints: [
{
html: "./src/app/project/project.html",
js: "./src/app/project/ProjectRoot.tsx",
preload: {
js: "./src/app/project/preload.ts",
},
name: "main_window",
additionalChunks: [
"vendor-react",
"vendor-scriptracker",
"vendor-hotloader",
"vendor-lodash",
],
},
name: "main_window",
additionalChunks: [
"vendor-react",
"vendor-scriptracker",
"vendor-hotloader",
"vendor-lodash",
],
},
{
html: "./src/app/splash/splash.html",
js: "./src/app/splash/SplashRoot.tsx",
preload: {
js: "./src/app/splash/preload.ts",
{
html: "./src/app/splash/splash.html",
js: "./src/app/splash/SplashRoot.tsx",
preload: {
js: "./src/app/splash/preload.ts",
},
name: "splash_window",
additionalChunks: [
"vendor-react",
"vendor-hotloader",
"vendor-lodash",
],
},
name: "splash_window",
additionalChunks: [
"vendor-react",
"vendor-hotloader",
"vendor-lodash",
],
},
{
html: "./src/app/preferences/preferences.html",
js: "./src/app/preferences/PreferencesRoot.tsx",
preload: {
js: "./src/app/project/preload.ts",
{
html: "./src/app/preferences/preferences.html",
js: "./src/app/preferences/PreferencesRoot.tsx",
preload: {
js: "./src/app/project/preload.ts",
},
name: "preferences_window",
additionalChunks: [
"vendor-react",
"vendor-hotloader",
"vendor-lodash",
],
},
name: "preferences_window",
additionalChunks: [
"vendor-react",
"vendor-hotloader",
"vendor-lodash",
],
},
{
html: "./src/app/music/music.html",
js: "./src/app/music/MusicRoot.tsx",
preload: {
js: "./src/app/project/preload.ts",
{
html: "./src/app/music/music.html",
js: "./src/app/music/MusicRoot.tsx",
preload: {
js: "./src/app/project/preload.ts",
},
name: "music_window",
additionalChunks: [
"vendor-react",
"vendor-hotloader",
"vendor-lodash",
],
},
name: "music_window",
additionalChunks: [
"vendor-react",
"vendor-hotloader",
"vendor-lodash",
],
},
],
],
},
},
},
},
// Fuses are used to enable/disable various Electron functionality
// at package time, before code signing the application
new FusesPlugin({
version: FuseVersion.V1,
[FuseV1Options.RunAsNode]: false,
[FuseV1Options.EnableCookieEncryption]: true,
[FuseV1Options.EnableNodeOptionsEnvironmentVariable]: false,
[FuseV1Options.EnableNodeCliInspectArguments]: false,
[FuseV1Options.EnableEmbeddedAsarIntegrityValidation]: true,
[FuseV1Options.OnlyLoadAppFromAsar]: true,
}),
],
// Fuses are used to enable/disable various Electron functionality
// at package time, before code signing the application
new FusesPlugin({
version: FuseVersion.V1,
[FuseV1Options.RunAsNode]: false,
[FuseV1Options.EnableCookieEncryption]: true,
[FuseV1Options.EnableNodeOptionsEnvironmentVariable]: false,
[FuseV1Options.EnableNodeCliInspectArguments]: false,
[FuseV1Options.EnableEmbeddedAsarIntegrityValidation]: true,
[FuseV1Options.OnlyLoadAppFromAsar]: true,
}),
],
};
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
"@electron-forge/plugin-webpack": "^7.3.0",
"@electron/fuses": "^1.7.0",
"@electron/notarize": "^2.3.0",
"@reforged/maker-appimage": "^1.1.3",
"@reforged/maker-appimage": "^4.0.2",
"@testing-library/jest-dom": "^5.11.5",
"@testing-library/react": "^11.1.0",
"@types/electron-devtools-installer": "^2.2.0",
Expand Down
Loading

0 comments on commit 6296baf

Please sign in to comment.