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

Add Goreleaser #60

Open
edoardottt opened this issue Apr 15, 2024 · 4 comments
Open

Add Goreleaser #60

edoardottt opened this issue Apr 15, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@edoardottt
Copy link
Owner

In resource-constrained environments we sometimes cannot afford to install full-blown Go + build packages with it: good practice is to have pre-packaged binary releases for each platform.

You can include this in a GitHub action workflow, by leveraging something like the https://github.com/marketplace/actions/go-release-binaries action which automates the process.

For reference:

@edoardottt edoardottt added the enhancement New feature or request label Apr 15, 2024
@Azathothas
Copy link

Hi,
I was trying to package this for https://github.com/pkgforge/soarpkgs
But the way the cmdlets are structured, it's kind of tricky to build.
I ended up with this: https://github.com/pkgforge/soarpkgs/blob/main/binaries/lit-bb-hack-tools/static.official.source.yaml#L117
I wanted to create a new issue, but since this already exists, the resulting change (able to run go build -C "${DIR}") would also fix it for us.

In case, you restructure the code/dirs, please remind us (by creating an issue or pinging one of the maintainers)
For now, it builds fine: https://github.com/orgs/pkgforge/packages?q=lit-bb-hack-tools&tab=packages&q=lit-bb-hack-tools%2Fofficial%2F
It can be downloaded from our index or installed using soar

Image

@edoardottt
Copy link
Owner Author

Hi @Azathothas , thanks for reaching out!

I'm not completely understanding your request to be honest :/ Could you elaborate a lil bit?

@Azathothas
Copy link

Sure.

To add goreleaser, you will have to restructure the tools a bit, specifically goreleaser will expect a main.go or at least a go.mod or similar files in all the tool's dir:
The way it works in goreleaser is they use go build -C

However, currently only way to build these tools is to pass the filename directly (or chdir to dir and build), it won't build if we use only the dirname with go build -C
Or you could also extend the existing Makefile to support user provided CFLAGS, LDFLAGS (because we build it more optimizaion & as static pie)
either of these will work for us.

@edoardottt
Copy link
Owner Author

Hi @Azathothas , thanks for clarification.
I don't have time to apply the changes as the tools work fine now.
If you have an easy and quick solution to propose, just open a PR.

edoardo

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

2 participants