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

Release Merged Builds / Using Existing Builds During Release #2320

Closed
bflad opened this issue Jun 29, 2021 · 5 comments
Closed

Release Merged Builds / Using Existing Builds During Release #2320

bflad opened this issue Jun 29, 2021 · 5 comments
Labels
enhancement New feature or request

Comments

@bflad
Copy link
Contributor

bflad commented Jun 29, 2021

Is your feature request related to a problem? Please describe.

We would like to compile binaries natively on macOS GitHub Actions runners using the -tags=netcgo flag, to resolve DNS resolution issues, while performing builds for other operating systems on other runners. Essentially we need the ability to fan out the builds across different environments (e.g. using the existing goreleaser build --id X, thank you for this functionality ❤️ ), collect the binaries into a single location (e.g. outside of goreleaser using GitHub Actions functionality such as actions/upload-artifact), then run goreleaser release using those existing builds so checksums are performed across all files along with the rest of the release process.

Currently the release command expects to wholly manage the dist directory, returning an error if it exists, and does not seem to provide an opt-out for the always-build behavior on release.

Describe the solution you'd like

A workable solution may be to offer a --skip-build or --use-existing-dist type flag on the release command, which essentially skips the build processes in a given configuration and uses existing dist files. Processes outside of goreleaser would be responsible for getting those files named and placed correctly prior to executing goreleaser in this manner.

Describe alternatives you've considered

We could run our release solely on macOS GitHub Actions runners but this is much more expensive and will not work if/when we also need to release native binaries for other operating systems in addition to macOS.

The current recommendation for cross-compilation with CGO and Docker is not legally supported for running on non-Apple branded hardware according to the Xcode License Agreement.

Additional context

@bflad bflad added the enhancement New feature or request label Jun 29, 2021
@caarlos0
Copy link
Member

yeah, this is something I gave a lot of thought over the years, but its not simple to implement.

I can't promise anything because I don't know when I will have the time to work on it... its not just building from existing dist... there is the goreleaser internal state which needs to be handled as well...

The current recommendation for cross-compilation with CGO and Docker is not legally supported for running on non-Apple branded hardware according to the Xcode License Agreement.

yeah, that is a nightmare and one of the reasons we don't ship a "cgo-ready image" 😔

@ryancurrah
Copy link
Contributor

We build all our binaries using a cross-compilation image, though we would like to inspect the artifacts and binaries before they are published/uploaded. 👍 to this feature.

@kunickiaj
Copy link

I was thinking of doing something similar since it is easy to build CGO enabled binaries on their target systems via multiple build agents. I'd love to be able to do it while continuing to use goreleaser.

Specifically I'm trying to integrate 99designs/keychain support into my application.

@caarlos0
Copy link
Member

We build all our binaries using a cross-compilation image, though we would like to inspect the artifacts and binaries before they are published/uploaded. 👍 to this feature.

for that you could likely use goreleaser release --skip-publish and then run again without the --skip-publish flag.

I was thinking of doing something similar since it is easy to build CGO enabled binaries on their target systems via multiple build agents. I'd love to be able to do it while continuing to use goreleaser.

This might help: https://carlosbecker.com/posts/goreleaser-prebuilt/

@caarlos0
Copy link
Member

ok, we now have the prebuilt builder and also goreleaser-cross.

We also have another issue to split/join work ( #2686 ), so I'll close this one.

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants