Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
CMAKE_POLICY_VERSION_MINIMUM = "3.5"
# `cargo test` and `cargo run` keep settings, identities and logs under
# target/ rather than in the real per-user data directory, so a test run
# never reads or rewrites an installed BroLink's files. A shipped binary
# does not see this; see `brolink_core::config::data_dir`.
BROLINK_DATA_DIR = { value = "target/brolink-data", relative = true }
# never reads or rewrites an installed Latch's files. A shipped binary
# does not see this; see `latch_core::config::data_dir`.
LATCH_DATA_DIR = { value = "target/latch-data", relative = true }

# The host is a standalone exe. Without this it needs vcruntime140.dll,
# which is not inbox on a fresh Windows install.
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@ jobs:
shell: powershell
run: |
$ErrorActionPreference = 'Stop'
$env:BROLINK_DUMP_EXE = "C:\Users\O'Brien `$lab\AppData\Local\BroLink\brolink-host.exe"
$env:BROLINK_DUMP_ADAPTER = "Ethernet 'Realtek' `"2`" `$(x)"
$env:BROLINK_DUMP_ADAPTER_DESC = "Realtek PCIe GbE (`"x`")"
$env:LATCH_DUMP_EXE = "C:\Users\O'Brien `$lab\AppData\Local\Latch\latch-host.exe"
$env:LATCH_DUMP_ADAPTER = "Ethernet 'Realtek' `"2`" `$(x)"
$env:LATCH_DUMP_ADAPTER_DESC = "Realtek PCIe GbE (`"x`")"
$files = @('scripts\install-host.ps1', 'crates\host\windows\take-over-engine.ps1')
foreach ($migrate in '0', '1') {
foreach ($dry in '0', '1') {
$out = Join-Path $env:RUNNER_TEMP "setup-$migrate$dry.ps1"
$env:BROLINK_DUMP_SETUP_SCRIPT = $out
$env:BROLINK_DUMP_MIGRATE = $migrate
$env:BROLINK_DUMP_DRY_RUN = $dry
cargo test -q -p brolink-host --lib the_generated_script_can_be_dumped_for_a_syntax_check
$env:LATCH_DUMP_SETUP_SCRIPT = $out
$env:LATCH_DUMP_MIGRATE = $migrate
$env:LATCH_DUMP_DRY_RUN = $dry
cargo test -q -p latch-host --lib the_generated_script_can_be_dumped_for_a_syntax_check
if ($LASTEXITCODE -ne 0) { throw "dumping the setup script failed" }
$files += $out
}
Expand All @@ -56,8 +56,8 @@ jobs:
run: cargo build --workspace --release
- uses: actions/upload-artifact@v4
with:
name: brolink-host-windows
path: target/release/brolink-host.exe
name: latch-host-windows
path: target/release/latch-host.exe
if-no-files-found: error

test-macos:
Expand All @@ -74,7 +74,7 @@ jobs:
- name: test
run: cargo test --workspace
- name: release app
run: cargo build --release -p brolink-host --target aarch64-apple-darwin
run: cargo build --release -p latch-host --target aarch64-apple-darwin
- name: bundle
run: bash scripts/bundle-macos.sh

Expand All @@ -93,7 +93,7 @@ jobs:
- name: test
run: cargo test --workspace
- name: release host
run: cargo build --release -p brolink-host
run: cargo build --release -p latch-host

deploy-selftest:
runs-on: ubuntu-latest
Expand Down
50 changes: 39 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,33 @@ jobs:
- name: test
run: cargo test --workspace
- name: build app
run: cargo build --release -p brolink-host --target aarch64-apple-darwin
run: cargo build --release -p latch-host --target aarch64-apple-darwin
# bundle-macos.sh ad-hoc signs and verifies the bundle itself.
- name: bundle
run: bash scripts/bundle-macos.sh
- name: package
run: |
cp docs/MACOS.md dist/README-MACOS.md
cp LICENSE NOTICE dist/
cd dist && tar czf brolink-macos-arm64.tar.gz BroLink.app README-MACOS.md LICENSE NOTICE
cd dist && tar czf latch-macos-arm64.tar.gz Latch.app README-MACOS.md LICENSE NOTICE
# A 4.0 updater downloads brolink-macos-arm64.tar.gz and installs the
# BroLink.app inside it. The same app under that folder name is what
# lets it update at all; on its first run it moves itself to Latch.app
# and takes over the launch agent (crates/host/src/unix_setup.rs,
# adopt_legacy_bundle). Nothing in 4.1 or later reads this asset.
- name: package for 4.0 updaters
run: |
mkdir dist/legacy
ditto dist/Latch.app dist/legacy/BroLink.app
cp docs/MACOS.md dist/legacy/README-MACOS.md
cp LICENSE NOTICE dist/legacy/
cd dist/legacy && tar czf ../brolink-macos-arm64.tar.gz BroLink.app README-MACOS.md LICENSE NOTICE
- uses: actions/upload-artifact@v4
with:
name: brolink-macos-arm64
path: dist/brolink-macos-arm64.tar.gz
name: latch-macos-arm64
path: |
dist/latch-macos-arm64.tar.gz
dist/brolink-macos-arm64.tar.gz
if-no-files-found: error

windows:
Expand All @@ -54,7 +68,7 @@ jobs:
- name: test
run: cargo test --workspace
- name: build
run: cargo build --release -p brolink-host
run: cargo build --release -p latch-host
- name: pin matches setup.rs
shell: pwsh
run: |
Expand All @@ -74,22 +88,36 @@ jobs:
shell: pwsh
run: |
New-Item -ItemType Directory -Force dist | Out-Null
Copy-Item target\release\brolink-host.exe dist\
Copy-Item target\release\latch-host.exe dist\
Copy-Item docs\WINDOWS.md dist\README-WINDOWS.md
Copy-Item scripts\install-host.ps1, LICENSE, NOTICE dist\
$zip = Join-Path dist $env:ENGINE_ZIP
$url = "https://github.com/LizardByte/Sunshine/releases/download/$($env:ENGINE_TAG)/$($env:ENGINE_ZIP)"
curl.exe -sSL -A brolink -o $zip $url
curl.exe -sSL -A latch -o $zip $url
if ($LASTEXITCODE -ne 0) { throw "downloading $url failed (curl exit $LASTEXITCODE)" }
$got = (Get-FileHash -Algorithm SHA256 -LiteralPath $zip).Hash.ToLower()
if ($got -ne $env:ENGINE_SHA256) {
throw "engine archive is not $($env:ENGINE_TAG): expected $($env:ENGINE_SHA256), got $got"
}
Compress-Archive -Path dist\* -DestinationPath brolink-windows-x64.zip
Compress-Archive -Path dist\* -DestinationPath latch-windows-x64.zip
# A 4.0 Mac takes brolink-host.exe out of brolink-windows-x64.zip and
# sends it to each PC. The new program under the old name is what lets
# it update the PC; nothing in 4.1 or later reads this asset.
- name: package for 4.0 updaters
shell: pwsh
run: |
New-Item -ItemType Directory -Force legacy | Out-Null
Copy-Item target\release\latch-host.exe legacy\brolink-host.exe
Copy-Item docs\WINDOWS.md legacy\README-WINDOWS.md
Copy-Item scripts\install-host.ps1, LICENSE, NOTICE legacy\
Copy-Item (Join-Path dist $env:ENGINE_ZIP) legacy\
Compress-Archive -Path legacy\* -DestinationPath brolink-windows-x64.zip
- uses: actions/upload-artifact@v4
with:
name: brolink-windows-x64
path: brolink-windows-x64.zip
name: latch-windows-x64
path: |
latch-windows-x64.zip
brolink-windows-x64.zip
if-no-files-found: error

publish:
Expand Down Expand Up @@ -133,7 +161,7 @@ jobs:
esac
gh release create "${GITHUB_REF_NAME}" \
--repo "${GITHUB_REPOSITORY}" \
--title "BroLink ${GITHUB_REF_NAME}" \
--title "Latch ${GITHUB_REF_NAME}" \
$NOTES \
$PRE \
artifacts/*/*
Loading
Loading