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

_ci_: Use goreleaser to build macos universal binaries (including M1 macs) #9096

Merged
merged 4 commits into from Aug 1, 2022

Conversation

ianconsolata
Copy link
Contributor

This is a much needed change that creates a universal MacOS binary, including support for M1 based macs. We also automatically update the homebrew package repo to use the new universal binary.

I also used this opportunity to refactor the workflow slightly so we can test out goreleaser, a yaml based tool for building, packaging, and releasing go binaries on multiple platforms. It supports building binaries for to most of the platforms we care about, including Linux and MacOS, and also supports publishing those binaries automatically as releases in Github, Homebrew, Snap, and Apt.

If this trial goes well, I think we should eventually replace the entire release workflow with goreleaser. For now, this test is more tightly scoped to only change the MacOS release process, since that is the one we have the most issues with. This PR:
- Builds darwin-amd64 and darwin-arm64 binaries of lotus, lotus-miner,
and lotus-worker
- Packages them into a universal darwin binary
- Publishes those to a release in Github based on the current tag
- Uses the binaries in the release to auto-publish an updated homebrew
configuration to filecoin-project/homebrew-lotus
- Does a dry-run build to produce a snapshot on release branches
- Manually generate and upload checksums after goreleaser

I pushed a test tag on my private fork to ensure it works as expected, which generated a release and an update to homebrew:

By running brew install ianconsolata/lotus/lotus you can try out the new MacOS installation process. It's been verified anecdotally on a few M1 macs, and my own non-M1 mac.

Checklist

Before you mark the PR ready for review, please make sure that:

  • All commits have a clear commit message.
  • The PR title is in the form of of <PR type>: <area>: <change being made>
    • example: fix: mempool: Introduce a cache for valid signatures
    • PR type: fix, feat, INTERFACE BREAKING CHANGE, CONSENSUS BREAKING, build, chore, ci, docs,perf, refactor, revert, style, test
    • area: api, chain, state, vm, data transfer, market, mempool, message, block production, multisig, networking, paychan, proving, sealing, wallet, deps
  • This PR has tests for new functionality or change in behaviour
  • If new user-facing features are introduced, clear usage guidelines and / or documentation updates should be included in https://lotus.filecoin.io or Discussion Tutorials.
  • CI is green

This is a small refactor of our workflow to test out goreleaser, a yaml
based tool for building, packaging, and releasing go binaries on
multiple platforms. It supports building binaries for to most of the platforms we
care about, including linux and  macos, and also supports publishing
those binaries automatically as releases in Github, homebrew, snap, and
even apt / deb.

If this trial goes well, I think we should eventually replace the entire
release workflow with goreleaser. For now, this test is more tightly
scoped to only automated the MacOS release process, since that is the
one we have the most issues with. This PRi / commit:
- Builds darwin-amd64 and darwin-arm64 binaries of lotus, lotus-miner,
  and lotus-worker
- Packages them into a universal darwin binary
- Publishes those to a release in Github based on the current tag
- Uses the binaries in the release to auto-publish and updated homebrew
  configuration to filecoin-project/homebrew-lotus
- Does a `dry-run` build to produce a snapshot on release branches with
  no tag
- Manually generate and upload checksums after goreleaser
@geoff-vball
Copy link
Contributor

Merge this when you're ready :)

@ianconsolata ianconsolata merged commit b0b660b into master Aug 1, 2022
@ianconsolata ianconsolata deleted the goreleaser branch August 1, 2022 18:36
@ianconsolata ianconsolata restored the goreleaser branch August 3, 2022 16:40
@Reiers Reiers mentioned this pull request Aug 3, 2022
18 tasks
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.

None yet

3 participants