Support Ubi as an installation method
Context
Ubi is a CLI to install other CLIs that are distributed as binaries in repositories' releases. I tried to use it against the trycua/lume repository, which is already providing binaries, but it failed because it expects the artifact name to contain a reference to the OS, either macos or darwin:
[ubi::builder][DEBUG] install path = /Users/pepicrft/src/github.com/tuist/lume/bin/lume
[reqwest::connect][DEBUG] starting new connection: https://api.github.com/
[ubi::picker][DEBUG] filtering out assets that do not have a valid extension
[ubi::picker][DEBUG] found valid extension, `.tar.gz`
[ubi::picker][DEBUG] including this asset because this extension is valid for this platform
[ubi::picker][DEBUG] found valid extension, `.tar.gz`
[ubi::picker][DEBUG] including this asset because this extension is valid for this platform
[ubi::picker][DEBUG] current OS = macos
[ubi::picker][DEBUG] matching assets against OS using (?i:(?:\b|_)(?:darwin|mac(?:osx?)?|osx)(?:\b|_))
[ubi::picker][DEBUG] matching OS against asset name = lume.pkg.tar.gz
[ubi::picker][DEBUG] does not match our OS
[ubi::picker][DEBUG] matching OS against asset name = lume.tar.gz
[ubi::picker][DEBUG] does not match our OS
What
Would you be up for including darwin or macos in the name of the release artifact? By doing so, not only Ubi is supported, but developers can also use Mise through the Ubi backend to install, manage, and activate Lume versions:
mise use -g ubi:trycua/lume
# Or run it directly
mise x ubi:trycua/lume@latest -- lume
@pepicrft - I've automated the notarization process and made the changes in publish-lume to make it compatible with mise. The mise use -g ubi:trycua/lume is failing though (it seems to pick from a release that is not the latest)
mise use -g ubi:trycua/lume --verbose
DEBUG ARGS: mise use -g ubi:trycua/lume --verbose
DEBUG install_some_versions: ubi:trycua/lume@latest
INFO ubi:trycua/[email protected] install
DEBUG GET https://api.github.com/repos/trycua/lume/releases/tags/0.1.11
DEBUG starting new connection: https://api.github.com/
DEBUG redirecting 'https://api.github.com/repos/trycua/lume/releases/tags/0.1.11' to 'https://api.github.com/repositories/925270205/releases/tags/0.1.11'
DEBUG GET https://api.github.com/repos/trycua/lume/releases/tags/0.1.11 404 Not Found
DEBUG Failed to get release for ubi:trycua/[email protected], trying with 'v' prefix: HTTP status client error (404 Not Found) for url (https://api.github.com/repositories/925270205/releases/tags/0.1.11)
DEBUG Parsed --project trycua/lume = trycua / lume
DEBUG exe name = lume
DEBUG install path = /Users/f/.local/share/mise/installs/ubi-trycua-lume/0.1.11/lume
DEBUG Adding GitHub token to GitHub request.
DEBUG starting new connection: https://api.github.com/
DEBUG redirecting 'https://api.github.com/repos/trycua/lume/releases/tags/v0.1.11' to 'https://api.github.com/repositories/925270205/releases/tags/v0.1.11'
DEBUG filtering out assets that do not have a valid extension
DEBUG found valid extension, `.tar.gz`
DEBUG including this asset because this extension is valid for this platform
DEBUG found valid extension, `.tar.gz`
DEBUG including this asset because this extension is valid for this platform
DEBUG current OS = macos
DEBUG matching assets against OS using (?i:(?:\b|_)(?:darwin|mac(?:osx?)?|osx)(?:\b|_))
DEBUG matching OS against asset name = lume.pkg.tar.gz
DEBUG does not match our OS
DEBUG matching OS against asset name = lume.tar.gz
DEBUG does not match our OS
DEBUG Failed to install with ubi version 'v0.1.11': could not find a release asset for this OS (macos) from lume.pkg.tar.gz, lume.tar.gz, trying with 'ubi:trycua/[email protected]'
DEBUG Parsed --project trycua/lume = trycua / lume
DEBUG exe name = lume
DEBUG install path = /Users/f/.local/share/mise/installs/ubi-trycua-lume/0.1.11/lume
DEBUG Adding GitHub token to GitHub request.
DEBUG starting new connection: https://api.github.com/
DEBUG redirecting 'https://api.github.com/repos/trycua/lume/releases/tags/0.1.11' to 'https://api.github.com/repositories/925270205/releases/tags/0.1.11'
Error:
0: failed to install ubi:trycua/[email protected]
1: Failed to install with ubi 'ubi:trycua/[email protected]': could not find a release asset for this OS (macos) from lume.pkg.tar.gz, lume.tar.gz
Location:
src/backend/ubi.rs:132
Version:
2025.3.3 macos-arm64 (2025-03-14)
Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
@f-trycua if I'm not mistaken, I think it's because of UBI's logic for finding the right release artifact can't filter out the right artifact:
could not find a release asset for this OS (macos) from lume.pkg.tar.gz, lume.tar.gz
According to their docs:
Finally, if there are still multiple assets left, it sorts them by file name and picks the first one. The sorting is done to make sure it always picks the same one every time it's run.
Which makes me think it's trying to use lume.pkg.tar.gz, and it doesn't know how to run a pkg to install the binary. What you can do to force lume.tar.gz as the artifacts that it picks:
- Include the platform in it by renaming it to
lume-macos.tar.gz - Include a character to make it the first artifact when sorting:
lume.bin.tar.gz