Skip to content

Commit

Permalink
first try at building mac app in github ci
Browse files Browse the repository at this point in the history
  • Loading branch information
fredclausen committed Apr 23, 2024
1 parent 596bb47 commit e3f597e
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/on_pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,40 @@ jobs:
name: frontend
path: ./frontend/sh-frontend

build_mac_app:
name: Build Mac App
runs-on: macos-latest
needs: [test_rust_functionality]
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0

- name: Run Docker on tmpfs
uses: JonasAlfredsson/docker-on-tmpfs@v1
with:
tmpfs_size: 5
swap_size: 4
swap_location: "/mnt/swapfile"

- name: Build Mac App
run: |
apt-get update && \
apt-get install -y --no-install-recommends libzmq3-dev
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
cargo binstall trunk wasm-bindgen-cli --no-confirm
cargo install tauri-cli
rustup target add universal-apple-darwin wasm32-unknown-unknown
cargo tauri build
- name: Upload artifact mac app
uses: actions/[email protected]
with:
name: mac_app
path: ./target/release/bundle/SDR-E\ Hub.app

consolidate_binaries:
name: Consolidate & Cache Binaries
runs-on: ubuntu-latest
Expand All @@ -220,6 +254,7 @@ jobs:
binary_build_arm64,
binary_build_armv7,
frontend_build,
build_mac_app,
]
steps:
- run: mkdir -p ./bin
Expand All @@ -244,6 +279,11 @@ jobs:
name: frontend
path: ./bin/sh-frontend

- uses: actions/[email protected]
with:
name: mac_app
path: ./Apps/SDR-E\ Hub.app

- run: ls -la */*

- name: Cache Binaries
Expand Down
4 changes: 4 additions & 0 deletions src/bin/sh-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@ sdrehub = { path = "../../libraries/sdrehub" }
sh-config = { path = "../../libraries/sh-config" }
tauri = { version = "1.6.2", features = ["api-all"] }
tokio = { version = "1.37.0", features = ["full", "tracing"] }

[features]
default = ["custom-protocol"]
custom-protocol = ["tauri/custom-protocol"]
1 change: 1 addition & 0 deletions src/libraries/sh-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ impl ShDataUser for ShAPIServer {
self.run_apiserver().await
}

// TODO: Can we dynamically start/stop/restart the web server?
fn stop(&self) {
// Stop the web server
}
Expand Down

0 comments on commit e3f597e

Please sign in to comment.