RalfJung / cargo-careful

Execute Rust code carefully, with extra checking along the way

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Publish static Linux binaries with releases

langston-barrett opened this issue · comments

Hi, thanks for the awesome tool!

I'd like to use this in a CI build. The build would go faster and use fewer resources if I were able to download a statically-linked Linux executable from the Github releases, rather than use cargo install. It's actually pretty easy to set up Github Actions to automatically create draft releases with attached static binaries whenever you push a git tag. An example CI setup from one of my own projects is available here: https://github.com/langston-barrett/mdlynx/blob/main/.github/workflows/release.yml

Feel free to close this issue if this doesn't appeal to you or sounds like too much work, I just figured I'd share my use-case and the above link in case it's helpful!

If it's fully automated I am open to providing such builds.

We have a pipeline for this now, but it doesn't seem to actually work -- even after successful pipeline completion, the github release does not have any attached binaries: https://github.com/RalfJung/cargo-careful/releases/tag/v0.3.2.

@Luni-4 any idea what might be going on here?

Probably it has to do with this note from the action-gh-release

Pattern './binaries/*' does not match any files.
commented

We have a pipeline for this now, but it doesn't seem to actually work -- even after successful pipeline completion, the github release does not have any attached binaries: https://github.com/RalfJung/cargo-careful/releases/tag/v0.3.2.

@Luni-4 any idea what might be going on here?

@RalfJung We can try to follow this guide

And here we can explicitly state binaries like this:

      - name: Create a release
        uses: softprops/action-gh-release@v1
        with:
          name: Release name
          files: |
            ./binaries/**/cargo-careful.exe
            ./binaries/**/cargo-careful-ubuntu
            ./binaries/**/cargo-careful-macos

Looks like the action is just buggy. https://trstringer.com/github-actions-create-release-upload-artifacts/ explains how to do it with just github native actions, we should probably do that.

commented

Yep, I agree with following up the native solution