A CLI for publishing standard.site documents to ATProto sequoia.pub

Add Binary Distribution #17

Open stevedylan.dev
Open opened by stevedylan.dev

Bun offers the ability to build programs as a single binary: https://bun.com/docs/bundler/executables

If possible we should create a workflow that can build the binaries for available architectures and attach them for releases. Ideally we would also include a dynamic curl install script that is uploaded along with the binaries.

If you want, I could create a brew formula that would do that for binary distribution on macOS and linux as well. brew install sequoia would be easy.

That would be sweet! In an ideal world we could find something like cargo-dist for typescript. In theory I think cargo-dist can actually be used for typescript/javascript apps.

Seems like overkill. Sets up its own CI and more. With homebrew, it will build binaries for selected platforms (if you want) - bottles - but build on any supported homebrew-supported platform for which a bottle isn't available. This is what I did for linux-arm64 for a while until homebrew finally added support for it.

We could do something like cargo-dist and set up subordinate packages that are platform-specific and download binaries. This is basically what gyp does for python-based node native adding (NNAs) and what I did for MISE Native (rust wrapper around .NET AoT-compiled MISE binaries), but there's a lot of maintenance overhead. With brew, you define one Formula and it does the rest, even if you host your own tap like I do: https://github.com/heaths/homebrew-tap. I don't think we need to host a tap, though. Initially I did because I was doing things outside homebrew's normal formula build, but even then brew has a dev command to set up all the workflows for you.

I see that tags are published in tangled. Is there a way to get the source hash? GitHub provides it in the UI as well as via API.

For example, I was trying to find a TypeScript-built formula. While I didn't (surprisingly, but not hard to make), one that came to mind that at least uses some TypeScript is Typeshare from 1Password that helps create FFI between Rust and TypeScript. See https://github.com/Homebrew/homebrew-core/commit/7f77226942620562432fefb38b0669ca7df6248c for their initial formula (the next commit attaches the bottles their build system create), as well as a subsequent update that only needs the source tarball URL and the hash of said tarball: https://github.com/Homebrew/homebrew-core/commit/685c2d03f7e1ca9542f459ee75c8187cb1429e34. With one that information, everything else is automated.

Ooo this is interesting! I will say something like this would probably only be worth it if we got enough requests for it. Most people have node/npm installed which handles the bulk of the issues of cross compatibility, but there's always a few outliners.

If you want I can try to add a nix flake, it would allow distribution to linux, mac and WSL. If available both on github and tangled, users could choose where to run from

nix run git+https://tangled.org/stevedylan.dev/sequoia
# or
nix run github:stevedylandev/sequoia
# or open a shell with the sequoia cli:
nix shell github:stevedylandev/sequoia
sequoia --help
# or install in the user profile
nix profile install github:stevedylandev/sequoia
sequoia --help
Sign up or Sign in to add to the discussion.