Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish CLI binaries for cargo-binstall #1358

Merged
merged 27 commits into from
Aug 15, 2023
Merged

Publish CLI binaries for cargo-binstall #1358

merged 27 commits into from
Aug 15, 2023

Conversation

esimkowitz
Copy link
Contributor

@esimkowitz esimkowitz commented Aug 14, 2023

Summary

This PR adds a workflow that will run on every new release to generate binaries of the CLI for Windows, Linux, and macOS. It will then upload these binaries to the release, along with a SHA. This also adds new metadata to the dioxus-cli crate so that cargo-binstall can find the published artifacts.

Reason

The goal of this PR is to publish binaries that can be used in downstream partners' GitHub Actions workflows. By using the install-action, which uses cargo-binstall under the hood, developers can quickly install the latest CLI binary.

Here's a shorthand for installing the CLI using that action:

- uses: taiki-e/install-action@dioxus-cli

Caveats

Note that I have not tested the install via cargo-binstall yet as I do not have permissions to publish a new version of the package, though I have tested that it publishes the binaries to the GitHub Release.

@esimkowitz esimkowitz changed the title Pre-build binaries for cargo-binstall Pre-build CLI binaries for cargo-binstall Aug 14, 2023
@esimkowitz esimkowitz changed the title Pre-build CLI binaries for cargo-binstall Publish CLI binaries for cargo-binstall Aug 14, 2023
@esimkowitz esimkowitz marked this pull request as ready for review August 14, 2023 22:03
@esimkowitz
Copy link
Contributor Author

this resolves #1331

@esimkowitz
Copy link
Contributor Author

I found a simpler approach that uses the upload-rust-binary-action, which is from the same dev as the install-action mentioned above. This can handle the build and upload in a single action. I tried to add support for ARM Mac binaries as well but ran into a cross-compilation issue due to git2-rs's dependency on system installations of openssl (see rust-lang/git2-rs#623 for more info). It looks like GitHub is adding support for ARM Mac runners by the end of the year though, so we can add support for those then.

@esimkowitz
Copy link
Contributor Author

I've also updated the toolchain install step to use a new action as the actions-rs organization and repos appear to be unmaintained since 2020. I've opened another issue #1360 to track replacing the action in the other pipelines.

Copy link
Member

@ealmloff ealmloff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! This should make the docsite builds a lot shorter

Thank you!

@ealmloff ealmloff added enhancement New feature or request cli Related to the dioxus-cli program ci github ci labels Aug 15, 2023
@ealmloff ealmloff merged commit 3e24b3d into DioxusLabs:master Aug 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci github ci cli Related to the dioxus-cli program enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants