Skip to content

Commit f41a844

Browse files
authored
Attempt to fix chrome-sandbox permissions issue on Linux (#1089)
Also allows for test runs of build-helper, which will not upload to staging
1 parent d1018e8 commit f41a844

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

.github/workflows/build-helper.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
push:
99
tags:
1010
- "v[0-9]+.[0-9]+.[0-9]+*"
11+
workflow_dispatch:
1112
env:
1213
GO_VERSION: "1.22"
1314
NODE_VERSION: "20"
@@ -84,12 +85,12 @@ jobs:
8485

8586
# Windows Code Signing Setup
8687
- name: Set up certificate (Windows only)
87-
if: matrix.platform == 'windows'
88+
if: matrix.platform == 'windows' && github.event_name != 'workflow_dispatch'
8889
run: |
8990
echo "${{ secrets.SM_CLIENT_CERT_FILE_B64 }}" | base64 --decode > /d/Certificate_pkcs12.p12
9091
shell: bash
9192
- name: Set signing variables (Windows only)
92-
if: matrix.platform == 'windows'
93+
if: matrix.platform == 'windows' && github.event_name != 'workflow_dispatch'
9394
id: variables
9495
run: |
9596
echo "SM_HOST=${{ secrets.SM_HOST }}" >> "$GITHUB_ENV"
@@ -103,7 +104,7 @@ jobs:
103104
echo "C:\Program Files\DigiCert\DigiCert Keylocker Tools" >> $GITHUB_PATH
104105
shell: bash
105106
- name: Setup Keylocker KSP (Windows only)
106-
if: matrix.platform == 'windows'
107+
if: matrix.platform == 'windows' && github.event_name != 'workflow_dispatch'
107108
run: |
108109
curl -X GET https://one.digicert.com/signingmanager/api-ui/v1/releases/Keylockertools-windows-x64.msi/download -H "x-api-key:%SM_API_KEY%" -o Keylockertools-windows-x64.msi
109110
msiexec /i Keylockertools-windows-x64.msi /quiet /qn
@@ -141,14 +142,16 @@ jobs:
141142
CSC_KEY_PASSWORD: ${{ secrets.SM_CLIENT_CERT_PASSWORD }}
142143
STATIC_DOCSITE_PATH: ${{env.STATIC_DOCSITE_PATH}}
143144
shell: powershell # electron-builder's Windows code signing package has some compatibility issues with pwsh, so we need to use Windows Powershell
145+
144146
- name: Upload to S3 staging
147+
if: github.event_name != 'workflow_dispatch'
145148
run: task artifacts:upload
146149
env:
147150
AWS_ACCESS_KEY_ID: "${{ secrets.ARTIFACTS_KEY_ID }}"
148151
AWS_SECRET_ACCESS_KEY: "${{ secrets.ARTIFACTS_KEY_SECRET }}"
149152
AWS_DEFAULT_REGION: us-west-2
150-
151153
- name: Create draft release
154+
if: github.event_name != 'workflow_dispatch'
152155
uses: softprops/action-gh-release@v2
153156
with:
154157
prerelease: ${{ contains(github.ref_name, '-beta') }}
@@ -166,3 +169,9 @@ jobs:
166169
make/*.snap
167170
make/*.flatpak
168171
make/*.AppImage
172+
- name: Upload build artifacts to workflow (manual runs only)
173+
if: github.event_name == 'workflow_dispatch'
174+
uses: actions/upload-artifact@v4
175+
with:
176+
name: ${{matrix.runner}}
177+
path: make

electron-builder.config.cjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ const config = {
111111
})
112112
.filter((f) => f.isFile() && f.name.startsWith("wavesrv"))
113113
.forEach((f) => fs.chmodSync(path.resolve(f.parentPath ?? f.path, f.name), 0o755)); // 0o755 corresponds to -rwxr-xr-x
114+
} else if (context.electronPlatformName === "linux") {
115+
const chromeSandboxPath = path.resolve(context.appOutDir, "Wave", "chrome-sandbox");
116+
fs.chmodSync(chromeSandboxPath, 0o4755);
117+
fs.chownSync(chromeSandboxPath, 0, 0);
114118
}
115119
},
116120
};

0 commit comments

Comments
 (0)