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

Alexlovelltroy/build improvements #48

Merged
merged 9 commits into from
Nov 13, 2024

Conversation

alexlovelltroy
Copy link
Member

Adding build automation from the work I did for smd that leads to better version reporting, multiarch containers, and native packages

* Refactor build_release.yml and unit_test.yaml workflows
* Modernize the .goreleaser
* Replace .version with LDFLAG-based versioning
* Add multiarch container
* Add native packaging ro deb, rpm, and apk
Copy link
Contributor

@davidallendj davidallendj left a comment

Choose a reason for hiding this comment

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

I made two inquiries about the changes, but neither are necessarily blockers.

@synackd
Copy link
Collaborator

synackd commented Nov 12, 2024

We should probably also update the README with build instructions using goreleaser (e.g. setting the env vars).

@synackd
Copy link
Collaborator

synackd commented Nov 12, 2024

Commenting here for posterity: .Arm64 was introduced in Goreleaser v2.4 so at least that Goreleaser version is required (see: https://goreleaser.com/customization/templates/#single-artifact-extra-fields).

Otherwise one will get the following error:

  ⨯ release failed after 2m34s               error=template: failed to apply "dist/bss_{{ .Os }}_{{ if eq .Arch \"amd64\" }}{{ .Arch }}_{{ .Amd64 }}{{ else if eq .Arch \"arm64\" }}{{ .Arch }}_{{ .Arm64 }}{{ else }}{{ .Arch }}{{ end }}/boot-script-service": map has no entry for key "Arm64"

Copy link
Collaborator

@synackd synackd left a comment

Choose a reason for hiding this comment

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

The build works using Goreleaser >=2.4 and I was able to test the amd64 container. I haven't been able to test arm64 yet.

.goreleaser.yaml Outdated Show resolved Hide resolved
Copy link
Collaborator

@synackd synackd left a comment

Choose a reason for hiding this comment

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

Tested goreleaser on the same amd64 machines and worked on all of them.

I obviously couldn't test the GitHub actions stuff, but found a small thing that should be fixed before merging.

Also, can we add the environment variable setting instructions for Goreleaser to the README (e.g. this)? I think the instructions are helpful for building locally, but also it's useful to, when building locally, do something like

eval $(grep ^export README.md)

to automatically source those variables.

.github/workflows/build_release.yml Outdated Show resolved Hide resolved
@synackd
Copy link
Collaborator

synackd commented Nov 13, 2024

Also, I am seeing go.mod and go.sum changes when I run goreleaser.

* README for goreleaser instructions
* go mod tidy
* v4->v3 in attestation
Copy link
Collaborator

@synackd synackd left a comment

Choose a reason for hiding this comment

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

Everything is resolved, LGTM.

@alexlovelltroy alexlovelltroy merged commit 9b34a38 into main Nov 13, 2024
3 checks passed
@alexlovelltroy alexlovelltroy deleted the alexlovelltroy/build-improvements branch November 13, 2024 21:11
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