Skip to content

Commit

Permalink
migrate linux snap build to forge
Browse files Browse the repository at this point in the history
  • Loading branch information
Guido Doumen committed Jan 4, 2025
1 parent eab1d65 commit fdc7fd0
Show file tree
Hide file tree
Showing 7 changed files with 237 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linux-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
node-version: ${{ matrix.node-version }}
- run: |
npm install
npm run make-linux
npm run make-snap
- uses: actions/upload-artifact@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion config/forge.config.appstore.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const updateWebBundle = require('./scripts/update-web-bundle')
const updateWebBundle = require('../scripts/update-web-bundle')

module.exports = {
packagerConfig: {
Expand Down
2 changes: 1 addition & 1 deletion config/forge.config.incyclist.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const updateWebBundle = require('./scripts/update-web-bundle')
const updateWebBundle = require('../scripts/update-web-bundle')

module.exports = {
packagerConfig: {
Expand Down
41 changes: 41 additions & 0 deletions config/forge.config.snap.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
const updateWebBundle = require('../scripts/update-web-bundle')

module.exports = {
packagerConfig: {
hooks: {
beforePack: async (options) => {
await updateWebBundle()
}
},
asar: true,
appBundleId: 'com.incyclist.desktop',
name: 'Incyclist',
icon: 'res/icons/incyclist',
ignore: [ '^/.github','^/.gitignore', '^/app-tests','^coverage','^/certs', '^/entitlements','^/profiles','^/bin','^/installer','^/release','scripts','^/config','^/test','^/test-results','^/testdata','README.MD','electron-builder.yml','^/.env']
},
makers: [
{
name: '@electron-forge/maker-snap',
config: {
"category":"Game",
"confinement":"devmode",
"plugs" : [
"bluez",
"bluetooth-control",
"alsa",
"audio-playback",
"cpu-control",
"display-control",
"locale-control",
"network",
"network-bind",
"home",
"serial-port",
"removable-media"
]

}

}
]
};
18 changes: 16 additions & 2 deletions config/linux64-installer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
},
"appId": "com.incyclist.desktop",
"productName": "Incyclist",
"nodeGypRebuild": false,
"directories": {
"app": "./",
"output": "out/make",
Expand All @@ -23,7 +22,22 @@
},
"snap": {
"category":"Game",
"confinement":"devmode"
"confinement":"devmode",
"buildPackages": ["libusb"],
"plugs" : [
"bluez",
"bluetooth-control",
"alsa",
"audio-playback",
"cpu-control",
"display-control",
"locale-control",
"network",
"network-bind",
"home",
"serial-port",
"removable-media"
]
},

"files": [
Expand Down
174 changes: 174 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"package": "electron-forge package",
"make": "electron-forge make",
"make-linux": "electron-builder --linux --config ./config/linux64-installer.json",
"make-mas": "BUILD_TARGET=appstore && electron-forge make"
"make-mas": "BUILD_TARGET=appstore && electron-forge make",
"make-snap": "BUILD_TARGET=snap && electron-forge make"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -52,6 +53,7 @@
"@electron-forge/maker-dmg": "^7.6.0",
"@electron-forge/maker-pkg": "^7.6.0",
"@electron-forge/maker-rpm": "^7.6.0",
"@electron-forge/maker-snap": "^7.6.0",
"@electron-forge/maker-squirrel": "^7.6.0",
"@electron-forge/maker-zip": "^7.6.0",
"@electron-forge/plugin-auto-unpack-natives": "^7.6.0",
Expand Down

0 comments on commit fdc7fd0

Please sign in to comment.