-
Notifications
You must be signed in to change notification settings - Fork 57
feat: add Ubuntu/Linux .deb build support #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
davebulaval
wants to merge
9
commits into
Charlie85270:main
Choose a base branch
from
davebulaval:feat/ubuntu-linux-build
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
0bf49ed
feat: add Ubuntu/Linux build support (AppImage + deb)
davebulaval b2731e6
fix: add deb maintainer field for Linux build
davebulaval 319cd0a
feat: finalize Linux deb build (drop AppImage, add smoke tests, fix E…
davebulaval 0ad0824
fix: address PR review — permissions, robust deb check, remove --no-s…
davebulaval 81697a9
fix: address review — drop optional chaining, robust CI check, cleanu…
davebulaval 3976303
fix: resolve merge conflict in package.json (keep upstream v1.2.7)
davebulaval c257ae2
refactor: extract shared electron build steps into scripts/electron-p…
davebulaval 06031f3
fix: nosuid warning in after-install.sh, whitelist build/linux in .gi…
davebulaval 34ebb1b
fix: absolute paths in electron-prepare.sh, t64 deb deps for Ubuntu 2…
davebulaval File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| name: Build - Linux | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - 'v*' | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| jobs: | ||
| build-linux: | ||
| name: Build Linux (Ubuntu) | ||
| runs-on: ubuntu-latest | ||
|
|
||
| strategy: | ||
| matrix: | ||
| arch: [x64] | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
| cache: 'npm' | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Install Linux build dependencies | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y libarchive-tools | ||
|
|
||
| - name: Build Electron app for Linux | ||
| run: npm run electron:build:linux | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Verify build artifacts | ||
| run: | | ||
| echo "=== Checking deb ===" | ||
| shopt -s nullglob | ||
| DEBS=(release/*.deb) | ||
| if [ ${#DEBS[@]} -eq 0 ]; then echo "ERROR: No .deb found"; exit 1; fi | ||
| for DEB in "${DEBS[@]}"; do | ||
| echo "deb: $DEB ($(stat --format=%s "$DEB") bytes)" | ||
|
|
||
| echo "=== Checking deb metadata ===" | ||
| dpkg-deb --info "$DEB" | ||
|
|
||
| echo "=== Checking deb contains dorothy binary ===" | ||
| MAIN_BIN=$(dpkg-deb --contents "$DEB" | grep -m1 "opt/Dorothy/dorothy$") | ||
| if [ -z "$MAIN_BIN" ]; then echo "ERROR: dorothy binary not found in deb"; exit 1; fi | ||
| BIN_SIZE=$(echo "$MAIN_BIN" | awk '{print $3}') | ||
| echo "Main binary: $(echo "$MAIN_BIN" | awk '{print $NF}') ($BIN_SIZE bytes)" | ||
| if [ "$BIN_SIZE" -eq 0 ]; then echo "ERROR: dorothy binary is zero-size"; exit 1; fi | ||
| done | ||
|
|
||
| echo "=== All checks passed ===" | ||
|
|
||
| - name: Upload deb artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: Dorothy-Linux-deb-${{ matrix.arch }} | ||
| path: release/*.deb | ||
| if-no-files-found: warn | ||
|
|
||
| - name: Upload to GitHub Release | ||
| if: startsWith(github.ref, 'refs/tags/v') | ||
| uses: softprops/action-gh-release@v2 | ||
| with: | ||
| files: | | ||
| release/*.deb | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| #!/bin/bash | ||
| # Set SUID bit on chrome-sandbox for Electron's sandbox to work. | ||
| # Required for Chromium's SUID sandbox on Linux (avoids --no-sandbox). | ||
| # Idempotent: safe to run multiple times. | ||
| chown root:root /opt/Dorothy/chrome-sandbox | ||
| chmod 4755 /opt/Dorothy/chrome-sandbox |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| #!/bin/bash | ||
| # Remove SUID bit from chrome-sandbox before package removal. | ||
| # Ensures no world-executable SUID root binary is left behind. | ||
| if [ -f /opt/Dorothy/chrome-sandbox ]; then | ||
| chmod 0755 /opt/Dorothy/chrome-sandbox | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.