Skip to content

Comments

chore: update CI to build multi-arch binaries#4

Merged
cowboyd merged 1 commit intothefrontside:mainfrom
LionyxML:main
Mar 27, 2025
Merged

chore: update CI to build multi-arch binaries#4
cowboyd merged 1 commit intothefrontside:mainfrom
LionyxML:main

Conversation

@LionyxML
Copy link
Contributor

@LionyxML LionyxML commented Mar 25, 2025

Motivation

This change introduces the creation of release tarballs (tar.gz archives) for multiple file types. These tarballs contain the packaged lspx executable for different target architectures. This is necessary to provide users with an easy way to download and install the application for their specific platform.

The idea here is to provide an easy way for users and automation scripts to integrate lspx. Meaning you could simply download the tarball for your system arch/OS, uncompress it, and run the compiled binary and/or add it to your PATH, like copying it to ~/.local/bin/ for example. It allows for the automated creation and distribution of releases across various platforms, streamlining the release management process.

This script runs after a new tag is applied with the v.* format.

Approach

The solution uses a build pipeline that ensures the creation of tarballs for multiple target architectures. The tarballs are generated using the tar command and are made available in the release assets. This process makes the release more accessible by packaging it into a common format (tar.gz), which is widely supported and easy to distribute. The build process has been verified to work successfully, and the tarballs have been validated for correctness.

Something changed for organization reasons is that the compile task now places the binary inside the /dist folder (ignored on .gitignore).

Alternate Designs

No significant alternative designs were considered since the tarball format (tar.gz) is widely accepted for this kind of release. An alternative could have been to use a .zip format, but tar.gz was chosen due to its widespread usage in Unix-like systems, where it is more commonly used for distribution.

Possible Drawbacks or Risks

The main potential risk is that users may encounter issues with extracting the tarballs on certain systems or platforms that do not have the necessary tools for handling .tar.gz files. However, this is unlikely as tar and gzip are commonly installed by default on most systems.

TODOs and Open Questions

  • Verify that the tarballs work on all targeted platforms (e.g., macOS, Linux).
  • I couldn't make this automation work for Windows binaries, so Windows is out for now.

Learning

This process involved understanding the correct packaging of executables for multiple platforms, which is a common practice in open-source projects. It reinforced the importance of providing easy-to-use release packages that are accessible across different environments.

Screenshots

It worked on my fork! :)

image

@cowboyd
Copy link
Member

cowboyd commented Mar 27, 2025

Thank you so much @LionyxML! I haven't had a chance to give it a proper look yet, but one question that did occur to me was how we can handle code-signing the binaries on MacOS and Windows. I have had problems with precompiled executables on those platforms before, and it makes me wonder what is the common practice to either a) do those things or b) circumvent them.

@cowboyd cowboyd merged commit 5df9fa6 into thefrontside:main Mar 27, 2025
3 checks passed
@cowboyd
Copy link
Member

cowboyd commented Mar 27, 2025

Well done! 🎉

@cowboyd
Copy link
Member

cowboyd commented Apr 2, 2025

@LionyxML I completely missed that this removed publication to JSR. Was that intentional?

@LionyxML
Copy link
Contributor Author

LionyxML commented Apr 2, 2025

Oh dang, that was completely unintentional :/ I might've grep/replaced something while testing it. Sorry.

@cowboyd
Copy link
Member

cowboyd commented Apr 3, 2025

@LionyxML No worries, I just wanted to make sure there wasn't a reason not to add it back. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants