Skip to content

ci: add goreleaser#427

Open
andriygm wants to merge 6 commits intomainfrom
ci/goreleaser
Open

ci: add goreleaser#427
andriygm wants to merge 6 commits intomainfrom
ci/goreleaser

Conversation

@andriygm
Copy link
Copy Markdown
Member

@andriygm andriygm commented Mar 20, 2026

this PR updates CI/CD workflows to use goreleaser for building + aggregating artifacts. it also supports homebrew tap publishing and release generation with attestations. uses zigbuild for cross-arch support within OS + simultaneously aids in linking against specific libc version without needing to build on alma.

see https://github.com/andriygm/rv/actions/runs/23328047166/job/67853966813 for alma/libc compat + build evidence.

andriygm and others added 6 commits March 19, 2026 22:33
The caller workflow must grant all permissions that the reusable
workflow requests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
cargo-zigbuild defaults to glibc 2.28 which is what we want.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Setting flags overrides the default (--release), so it must be
included explicitly alongside --features=cli.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
List artifacts first, then find the tar.gz by name rather than
assuming a specific directory structure.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Instead of pinning zig version, use a wrapper script that appends
.2.28 to linux-gnu targets when invoking cargo-zigbuild. This
ensures RHEL 8/AlmaLinux 8 compat while using latest zig.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@andriygm andriygm changed the title ci add goreleaser ci: add goreleaser Mar 20, 2026
@andriygm andriygm requested review from Keats and dpastoor March 20, 2026 04:13
Copy link
Copy Markdown
Collaborator

@Keats Keats left a comment

Choose a reason for hiding this comment

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

I don't know goreleaser but we are losing some stuff from the current release process. What do we get from that change?

fetch-depth: 0

- name: Cache Rust
uses: Swatinem/rust-cache@v2
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

does that make a difference?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

it could go either way, I usually like to cache deps in case I need to make a patch. if the deps all change it's effectively useless.

- name: Check that rv version matches the tag
run: |
. "$HOME/.cargo/env"
python3 .github/scripts/tag_check.py "${{ github.ref_name }}"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

we're losing that check

Copy link
Copy Markdown
Member Author

@andriygm andriygm Mar 20, 2026

Choose a reason for hiding this comment

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

should still be in release.yml although takes a slightly different form:

      - name: Check version matches tag
        run: |
          TAG_VERSION="${{ github.ref_name }}"
          CARGO_VERSION=$(grep '^version = ' Cargo.toml | cut -d'"' -f2)
          if [ "$TAG_VERSION" != "v$CARGO_VERSION" ]; then
            echo "Version mismatch: tag=$TAG_VERSION, Cargo.toml=v$CARGO_VERSION"
            exit 1
          fi
          echo "Version check passed: $TAG_VERSION"

I can update to use existing format, but this form can be executed earlier (before building) since it's just reading the Cargo.toml file.

@andriygm
Copy link
Copy Markdown
Member Author

@Keats to answer your question, we can take advantage of some stuff it gives us "for free" for example GitHub release generation, homebrew casks, SBOMs/signing rather than needing to roll our own implementations there. I think standalone install scripts are also in the works within goreleaser, so we can take advantage of that when it comes out as well. a big headache that it resolves that is not as relevant here is generating deb/rpm packages, makes things much easier to deal with, maybe something to keep in mind for other projects though.

@dpastoor
Copy link
Copy Markdown
Member

i'm not sure about this for rv - in particular i generally agree with standardizing, particularly across our other projects using goreleaser, but also as of now rv's release process "just works" - we don't need the rpm/debs for now, and we'd need to add more checks around our builds properly working against older os's that we know currently works with the alma build vs the cross compiling that should...in theory work, but we don't know.

I'd be more inclined to just keep as is until we have a convincing case to update, eg if we want to add more release components then do it then. We also really can remove our homebrew tap and really should start pointing people to the fact that rv is now in homebrew core as https://formulae.brew.sh/formula/rv-r

@andriygm
Copy link
Copy Markdown
Member Author

@dpastoor yep fair point, can definitely leave this around if/when we need it. it might be good to add the checks you're describing even if we don't end up merging. afaik rv is only linking against libc dynamically, which is what enables us to take advantage of cargo-zigbuild, but agreed that there may be edge cases within it's implementation we would need to test for. there's also no reason we can't use this build system without zigbuild -- we can still build per target within alma8 if we want that option.

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.

3 participants