Skip to content

Commit 7edabb9

Browse files
committed
Bundle and supervise Symphony backend in desktop app
1 parent 3573544 commit 7edabb9

17 files changed

Lines changed: 581 additions & 38 deletions

File tree

.github/workflows/release-desktop.yml

Lines changed: 74 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,14 @@ jobs:
1616
fail-fast: false
1717
matrix:
1818
include:
19-
- label: macos-universal
20-
os: macos-latest
21-
rust-targets: x86_64-apple-darwin,aarch64-apple-darwin
22-
args: --target universal-apple-darwin
19+
- label: macos-x86_64
20+
os: macos-13
21+
rust-targets: x86_64-apple-darwin
22+
args: --target x86_64-apple-darwin
23+
- label: macos-arm64
24+
os: macos-14
25+
rust-targets: aarch64-apple-darwin
26+
args: --target aarch64-apple-darwin
2327
- label: windows-x86_64
2428
os: windows-latest
2529
rust-targets: x86_64-pc-windows-msvc
@@ -39,7 +43,11 @@ jobs:
3943
if: runner.os == 'Linux'
4044
run: |
4145
sudo apt-get update
42-
sudo apt-get install -y libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev patchelf libssl-dev
46+
sudo apt-get install -y libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev patchelf libssl-dev curl file p7zip-full
47+
- name: Install Windows verification tools
48+
if: runner.os == 'Windows'
49+
shell: pwsh
50+
run: choco install 7zip -y --no-progress
4351
- uses: actions/setup-node@v4
4452
with:
4553
node-version: 22
@@ -48,21 +56,81 @@ jobs:
4856
- uses: dtolnay/rust-toolchain@stable
4957
with:
5058
targets: ${{ matrix.rust-targets }}
59+
- name: Setup Erlang/Elixir for bundled backend
60+
uses: erlef/setup-beam@v1
61+
with:
62+
otp-version: '27'
63+
elixir-version: '1.18'
5164
- name: Install frontend dependencies
5265
run: npm ci
66+
- name: Build Elixir backend release
67+
shell: bash
68+
working-directory: symphony_elixir
69+
env:
70+
MIX_ENV: prod
71+
run: |
72+
set -euxo pipefail
73+
mix local.hex --force
74+
mix local.rebar --force
75+
mix deps.get --only prod
76+
mix compile
77+
mix release symphony_elixir --overwrite
78+
- name: Stage backend release for Tauri bundle
79+
shell: bash
80+
run: |
81+
set -euxo pipefail
82+
rm -rf src-tauri/resources/symphony_backend
83+
mkdir -p src-tauri/resources
84+
cp -a symphony_elixir/_build/prod/rel/symphony_elixir src-tauri/resources/symphony_backend
85+
test -d src-tauri/resources/symphony_backend/bin
86+
test -d src-tauri/resources/symphony_backend/releases
87+
if [ "${{ runner.os }}" = "Windows" ]; then
88+
test -f src-tauri/resources/symphony_backend/bin/symphony_elixir.bat
89+
else
90+
test -x src-tauri/resources/symphony_backend/bin/symphony_elixir
91+
fi
92+
- name: Smoke-test staged backend release
93+
shell: bash
94+
env:
95+
SYMPHONY_HTTP_PORT: '4104'
96+
SYMPHONY_HTTP_HOST: '127.0.0.1'
97+
SYMPHONY_HTTP_ENABLED: 'true'
98+
run: |
99+
set -euxo pipefail
100+
cd src-tauri/resources/symphony_backend
101+
if [ "${{ runner.os }}" = "Windows" ]; then
102+
./bin/symphony_elixir.bat start
103+
else
104+
./bin/symphony_elixir start
105+
fi
106+
for i in $(seq 1 60); do
107+
if curl -fsS http://127.0.0.1:4104/healthz; then break; fi
108+
sleep 1
109+
done
110+
curl -fsS http://127.0.0.1:4104/healthz
111+
if [ "${{ runner.os }}" = "Windows" ]; then
112+
./bin/symphony_elixir.bat stop || true
113+
else
114+
./bin/symphony_elixir stop || true
115+
fi
53116
- name: Regenerate macOS app icon
54117
if: runner.os == 'macOS'
55118
run: |
56119
if [ -d src-tauri/icons/icon.iconset ]; then
57120
iconutil -c icns src-tauri/icons/icon.iconset -o src-tauri/icons/icon.icns
58121
fi
59-
60122
- name: Build Tauri app
61123
uses: tauri-apps/tauri-action@v0
62124
env:
63125
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
64126
with:
65127
args: ${{ matrix.args }}
128+
- name: Verify bundled backend files exist
129+
shell: bash
130+
run: |
131+
set -euxo pipefail
132+
find src-tauri/target -type f \( -name '*.dmg' -o -name '*.AppImage' -o -name '*.deb' -o -name '*.exe' -o -name '*.msi' -o -name '*.app.tar.gz' \) -print
133+
find src-tauri/resources/symphony_backend -maxdepth 3 -type f | sort | head -80
66134
- name: Upload bundle artifacts
67135
uses: actions/upload-artifact@v4
68136
with:

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ https://github.com/TerminallyLazy/misconducting/releases/latest
1010

1111
Current locally built release assets are Linux ARM64:
1212

13-
- `Symphony Console_0.1.4_aarch64.AppImage`
14-
- `Symphony Console_0.1.4_arm64.deb`
13+
- `Symphony Console_0.1.5_aarch64.AppImage`
14+
- `Symphony Console_0.1.5_arm64.deb`
1515

1616
The GitHub Actions workflow `.github/workflows/release-desktop.yml` is configured to build macOS, Windows, Linux x86_64, and Linux ARM64 packages from release tags.
1717

RELEASE_WORKFLOW_NOTE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ It builds:
99
- Linux x86_64 AppImage/DEB
1010
- Linux ARM64 AppImage/DEB
1111

12-
Push tag `v0.1.4` or run the workflow manually from GitHub Actions to produce release artifacts.
12+
Push tag `v0.1.5` or run the workflow manually from GitHub Actions to produce release artifacts.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "symphony-desktop",
3-
"version": "0.1.4",
3+
"version": "0.1.5",
44
"private": true,
55
"type": "module",
66
"scripts": {

src-tauri/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "symphony_desktop"
3-
version = "0.1.4"
3+
version = "0.1.5"
44
edition = "2021"
55

66
[build-dependencies]

src-tauri/resources/symphony_backend/.gitkeep

Whitespace-only changes.

src-tauri/resources/symphony_backend/bin/.gitkeep

Whitespace-only changes.

src-tauri/resources/symphony_backend/releases/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)