Skip to content

Commit bbe2bef

Browse files
committed
change pack scripts
Signed-off-by: Adam Setch <[email protected]>
1 parent d08d967 commit bbe2bef

File tree

3 files changed

+8
-25
lines changed

3 files changed

+8
-25
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ jobs:
6767
- run: pnpm install
6868
- run: pnpm build
6969
- run: pnpm prepare:remove-source-maps
70+
- name: Fix chrome-sandbox permissions
71+
run: |
72+
sudo chown root dist/linux-arm640-unpacked/chrome-sandbox
73+
sudo chmod 4755 dist/linux-arm640-unpacked/chrome-sandbox
7074
- run: pnpm package:linux --publish=never
7175
- name: Clean up builds
7276
run: rm -rfv dist/linux-unpacked

.github/workflows/publish.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ jobs:
8383
OAUTH_CLIENT_ID: ${{ secrets.oauth_client_id }}
8484
OAUTH_CLIENT_SECRET: ${{ secrets.oauth_client_secret }}
8585
- run: pnpm prepare:remove-source-maps
86+
- name: Fix chrome-sandbox permissions
87+
run: |
88+
sudo chown root dist/linux-arm640-unpacked/chrome-sandbox
89+
sudo chmod 4755 dist/linux-arm640-unpacked/chrome-sandbox
8690
- run: pnpm package:linux --publish onTagOrDraft
8791
env:
8892
GH_TOKEN: ${{ secrets.github_token }}

scripts/afterPack.js

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
const path = require('node:path');
22
const fs = require('node:fs');
3-
const { chmodSync } = require('node:fs');
43
const { AfterPackContext } = require('electron-builder');
54

65
const packageJson = require('../package.json');
@@ -19,8 +18,6 @@ const afterPack = async (context) => {
1918

2019
if (platform === 'darwin') {
2120
removeUnusedLocales(appOutDir, appName);
22-
} else if (platform === 'linux') {
23-
fixChromeSandboxPermissions(appOutDir);
2421
}
2522

2623
// biome-ignore lint/suspicious/noConsoleLog: disabled
@@ -63,26 +60,4 @@ const removeUnusedLocales = (appOutDir, appName) => {
6360
}
6461
};
6562

66-
/**
67-
* Fixes `chrome-sandbox` permissions for Linux builds.
68-
* @param {string} appOutDir
69-
*/
70-
const fixChromeSandboxPermissions = (appOutDir) => {
71-
// biome-ignore lint/suspicious/noConsoleLog: disabled
72-
console.log('[afterPack]: fix chrome sandbox permissions');
73-
74-
const chromeSandboxPath = path.join(appOutDir, 'chrome-sandbox');
75-
76-
try {
77-
chmodSync(chromeSandboxPath, 0o4755); // Set SUID bit
78-
// biome-ignore lint/suspicious/noConsoleLog: disabled
79-
console.log('[afterPack]: Fixed chrome-sandbox permissions');
80-
} catch (err) {
81-
console.error(
82-
'[afterPack]: Failed to set chrome-sandbox permissions:',
83-
err,
84-
);
85-
}
86-
};
87-
8863
exports.default = afterPack;

0 commit comments

Comments
 (0)