feat(packaging): add macOS release builds, Homebrew tap support, and Windows service/MSI#216
Open
CraZySacX wants to merge 14 commits into
Open
feat(packaging): add macOS release builds, Homebrew tap support, and Windows service/MSI#216CraZySacX wants to merge 14 commits into
CraZySacX wants to merge 14 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #216 +/- ##
=======================================
Coverage 97.73% 97.73%
=======================================
Files 31 31
Lines 4804 4804
=======================================
Hits 4695 4695
Misses 109 109 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Add options=(!strip !debug) to bartoc-bin, bartos-bin, and barto-cli-bin PKGBUILDs. The pre-compiled musl static binaries have no DWARF debug symbols, causing makepkg's default debug option to emit spurious gdb-add-index errors on every install/upgrade. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Rewrite the upgrade block in bartoc-post-install.sh to match the correct logic already used in the AUR bartoc.install post_upgrade(): - Move daemon-reload outside the service loop (was called once per service per user instead of once per user) - Use XOR logic for bartoc vs bartoc-age (was looping both independently) - Replace `restart ... || true` + unconditional success message with an if/else that surfaces failures as a warning without failing the package install — previously a failed restart was silently swallowed and "restarted successfully" printed regardless - Handle bartoc-logrotate.timer separately after the main service, with the same if/else error reporting - Add fallback message when neither service is enabled for a user Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add a native aarch64-apple-darwin build job for bartoc and barto-cli, Homebrew formula templates with version/SHA placeholders, and an update-homebrew CI job that computes checksums and pushes generated formulas to the rustyhorde/homebrew-barto tap. Pre-release and release jobs now collect and publish macOS tarballs alongside Linux assets. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
eb1ddd7 to
990748a
Compare
bartoc can now run as a Windows Service via a new --service flag that activates SCM dispatch mode (without it, console behavior is unchanged on all platforms). - bartoc/src/service.rs: new Windows-only module; SCM dispatcher using the windows-service crate, status reporting, and clean stop via a CancellationToken passed to run() - bartoc/src/main.rs: remove #[tokio::main]; check raw argv for --service before building the tokio runtime; fall through to explicit block_on for console mode - bartoc/src/runtime/mod.rs: run() gains service_token parameter so SCM Stop cancels the retry loop and per-connection tokens; add load_windows_credentials() to read BARTOC_HMAC_KEY and friends from Windows Credential Manager at startup (mirrors bartoc-launcher.ps1) - bartoc/src/db/mod.rs: create_dir_all on the redb parent so %ProgramData%\bartoc\ is created on first run - bartoc/wix/main.wxs: WiX 3.x installer — binary to %ProgramFiles%, delayed-auto-start service, restart-on-failure, example config and PS1 launcher to %ProgramData%\bartoc\ - packaging/wix/README.Windows.md: setup guide covering MSI install, dedicated service account, secret management, and manual sc create - xtask/src/main.rs: include bartoc-launcher.ps1 in dist tarball - .github/workflows/release.yml: build-windows job (MSVC, cargo-wix); pre-release and release jobs now include Windows artifacts - .github/workflows/barto.yml: clippy-windows target → msvc (required for windows-service linker) - Workspace deps: keyring-core 1.0.0, windows-native-keyring-store 1.1.0, windows-service 0.8.1 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… scripts - Wrap std::env::set_var in unsafe block (now required by Rust 2024); add #[allow(unsafe_code)] to load_windows_credentials - Move const items before the match statement to satisfy items_after_statements - Gate allow(non_exhaustive_omitted_patterns) on all(feature = "unstable", nightly) to match the condition under which the lint is denied, since ServiceControl is #[non_exhaustive] from an external crate - Add scripts/run_all.ps1, run_install.ps1, and run_musl.ps1 as Windows equivalents of the existing fish scripts (run_musl.ps1 adapted for Windows Docker Desktop: drops sudo chown, uses USERPROFILE paths) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace --bin-path (WiX toolset compiler path) with --target x86_64-pc-windows-msvc so cargo-wix locates the pre-built binary at the correct cross-target output directory. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
WiX candle (v3) rejects XML comments containing '--', causing the Generate MSI CI job to fail with exit code 104. Rephrase the comment to avoid '--service'. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
main.wxs uses <util:ServiceConfig> for delayed auto-start and failure recovery, which requires WixUtilExtension.dll. Without -ext, candle exits with code 4 (one error per unrecognised util namespace element). Passes -e WixUtilExtension via the CI cargo-wix invocation and anchors the same requirement in [package.metadata.wix] for local builds. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The previous attempt to fix the candle exit-4 failure by passing -e WixUtilExtension was incorrect — cargo-wix includes WixUtilExtension by default. Reverts that change and adds --nocapture so the actual candle error messages appear in CI logs for proper diagnosis. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
macOS (previous commits)
aarch64-apple-darwinbuild job forbartocandbarto-clionmacos-latest(Apple Silicon runner)packaging/homebrew/bartoc.rb.tmpl,packaging/homebrew/barto-cli.rb.tmpl) withbrew services/ launchd integration forbartocupdate-homebrewCI job that computes SHA256 checksums and pushes generated formulas to therustyhorde/homebrew-bartotap on each releasepre-releaseandreleasejobs to collect macOS tarballs alongside existing Linux assetsbartocpost-install fix, AUR PKGBUILDgdb-add-indexsuppressionWindows service/MSI (previous commits)
bartoc/src/service.rs— new Windows-only SCM dispatcher using thewindows-servicecrate; clean stop viaCancellationTokenpropagation--serviceflag activates SCM dispatch mode; without it, console behavior is unchanged on all platformsbartoc/src/runtime/mod.rs—run()gainsservice_tokenparameter so an SCM Stop cancels the retry loop and per-connection tokens;load_windows_credentials()reads secrets from Windows Credential Manager at startup (mirrorsbartoc-launcher.ps1)bartoc/src/main.rs— removes#[tokio::main]; checks argv for--servicebefore building the tokio runtimebartoc/src/db/mod.rs—create_dir_allon the redb parent path so%ProgramData%\bartoc\is created on first runbartoc/wix/main.wxs— WiX 3.x MSI installer: binary to%ProgramFiles%\barto\bartoc\, delayed-auto-start service with restart-on-failure, example config to%ProgramData%\bartoc\packaging/wix/README.Windows.md— setup guide: MSI install, dedicated service account, secret management, manualsc create.github/workflows/release.yml— newbuild-windowsjob (MSVC target,cargo-wix);pre-releaseandreleasejobs include Windows.exeand.msiartifacts.github/workflows/barto.yml— clippy-windows target changed tox86_64-pc-windows-msvc(required forwindows-servicelinker)keyring-core 1.0.0,windows-native-keyring-store 1.1.0,windows-service 0.8.1Nightly clippy fixes and PowerShell CI scripts (previous commits)
bartoc/src/runtime/mod.rs— wrapstd::env::set_varinunsafeblock (required by Rust 2024 edition); add#[allow(unsafe_code)]toload_windows_credentials; moveconstitems before thematchstatement to fixitems_after_statementsbartoc/src/service.rs— gateallow(non_exhaustive_omitted_patterns)onall(feature = "unstable", nightly)to match the deny condition;ServiceControlis#[non_exhaustive]from an external crate so a wildcard arm alone doesn't satisfy the lintscripts/run_all.ps1— PowerShell port ofscripts/run_all.fish; usesparam()switches (-NoTest,-NoCoverage,-NoDocs,-NoInstall,-NoMusl,-Unstable,-Clean) and$PSScriptRootfor sibling script discoveryscripts/run_install.ps1— PowerShell port ofscripts/run_install.fishscripts/run_musl.ps1— PowerShell port ofscripts/run_musl.fish; adapted for Windows Docker Desktop (dropssudo chown, uses$env:USERPROFILEpaths, invokes docker via arg array)CI fix: cargo-wix MSI generation (previous commit)
.github/workflows/release.yml— replace--bin-path target\x86_64-pc-windows-msvc\releasewith--target x86_64-pc-windows-msvc;--bin-pathis the WiX Toolset compiler directory flag, not the Rust binary output path —candle/lightare already in PATH onwindows-latestWiX XML fix (previous commit)
bartoc/wix/main.wxs— remove--servicefrom inside an XML comment; the XML spec forbids--within comments, causing WiX candle to abort with exit code 104Expose candle errors in CI (latest commit)
.github/workflows/release.yml— add--nocaptureto thecargo wixinvocation so candle/light output streams directly to CI logs; the previous-e WixUtilExtensionattempt was incorrect (WixUtilExtensionis included by default by cargo-wix) and has been revertedPrerequisites before first release
rustyhorde/homebrew-bartoGitHub repo with aFormula/directorybarto-homebrew-tap-push) scoped torustyhorde/homebrew-bartowith Contents: Read and writeHOMEBREW_TAP_TOKENsecret inrustyhorde/bartoTest plan
macOS
build-macosjob succeeds on an RC tag push and uploads both.tar.gzartifactsupdate-homebrewpushesbartoc.rbandbarto-cli.rbto the tapbrew tap rustyhorde/barto && brew install rustyhorde/barto/bartoc && bartoc --versionbrew services start bartocloads the launchd plistWindows
build-windowsjob succeeds on an RC tag push and uploads.exeand.msito pre-release assetsmsiexec /i bartoc-VERSION-x86_64.msi SERVICEACCOUNT=".\bartoc_svc" SERVICEPASSWORD="..." /l*v install.logsc query bartocshowsRUNNINGbarto-cli secrets set BARTOC_HMAC_KEYetc.; confirm tracing log shows credentials loaded from Credential Managersc stop bartoc— verify clean shutdown;sc delete bartoc; verify uninstall removes all filesbartoc.exe --config-absolute-path ...(no--service) works as beforePowerShell scripts
scripts\run_all.ps1 -?— verify help outputscripts\run_musl.ps1 -?— verify help outputscripts\run_all.ps1 -NoTest -NoCoverage -NoDocs -NoInstall -NoMusl— runs fmt + clippy + build only🤖 Generated with Claude Code