feat: add Windows support (amd64 + arm64) - #14
Merged
Merged
Conversation
Build and distribute the CLI for Windows alongside Linux and macOS. - Add windows to goreleaser build matrix - Extract shared internal/browser package (deduplicate openBrowser), add Windows case (cmd /c start) - Self-update: append .exe to download binary name on Windows, handle locked-exe replacement by renaming the running binary aside first, clean up .old file on next run - Switch config/cache dir fallbacks from hardcoded ~/.config and ~/.cache to os.UserConfigDir() / os.UserCacheDir() (returns %AppData% / %LocalAppData% on Windows, unchanged on Unix) - Add PowerShell install script (install.ps1) mirroring install.sh - Update upload-release.sh to handle .exe binaries and upload install.ps1
- browser.Open: add empty title arg to cmd /c start to prevent & in OAuth URLs from being interpreted as command separators - config/cache dirs: only use os.UserConfigDir() / os.UserCacheDir() on Windows; keep ~/.config and ~/.cache on Linux/macOS to avoid orphaning existing config files (macOS would move to ~/Library) - selfupdate: rollback the .old rename if the final rename fails, and clean up .old on success
Use rundll32 instead of cmd /c start to avoid URL truncation on &. Match test expectations to actual code paths (hardcoded .config/.cache, not os.UserConfigDir/os.UserCacheDir which differ on macOS).
Add [Net.ServicePointManager]::SecurityProtocol = Tls12 before HTTPS calls in install.ps1 for PS 5.1 on older Windows. Append .exe to binary name in test helpers so Update tests resolve the correct path on Windows (matching production selfupdate.go logic).
- Add PGP signature verification to PowerShell installer (uses gpg when available, warns when not) - Surface rollback error with recovery path in selfupdate on Windows - Make TestConfigDir_Default platform-aware for Windows
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
windowsto goreleaser build matrix (amd64 + arm64)openBrowserinto sharedinternal/browserpackage, addcmd /c startfor Windows.exeto binary name on Windows, handle locked-exe replacement (rename aside, clean up.oldon next run)os.UserConfigDir()/os.UserCacheDir()(returns%AppData%/%LocalAppData%on Windows, unchanged on Unix)install.ps1) forirm .../install.ps1 | iexupload-release.shto handle.exebinaries and uploadinstall.ps1Test plan
go test ./...passes (all packages)GOOS=windows GOARCH=amd64 go buildcross-compiles cleanlyGOOS=windows GOARCH=arm64 go buildcross-compiles cleanlyTestFindChecksum_WithExeSuffix: .exe entries found in checksums.txtTestReplaceBinary_CleansUpOldFile: .old cleanup worksTestConfigDir_Default/TestCacheDir_Default: use native OS dirsirm .../install.ps1 | iexinstalls,codebahn versionruns,codebahn updateself-updates