Added goreleaser instead of gox #30896#30913
Conversation
Signed-off-by: Bhargavkonidena <Bhargavkonidena@users.noreply.github.com>
Signed-off-by: Bhargavkonidena <Bhargavkonidena@users.noreply.github.com>
Signed-off-by: Bhargavkonidena <Bhargavkonidena@users.noreply.github.com>
Signed-off-by: Bhargavkonidena <Bhargavkonidena@users.noreply.github.com>
Signed-off-by: Bhargavkonidena <Bhargavkonidena@users.noreply.github.com>
Signed-off-by: Bhargavkonidena <Bhargavkonidena@users.noreply.github.com>
Signed-off-by: Bhargavkonidena <Bhargavkonidena@users.noreply.github.com>
Signed-off-by: Bhargavkonidena <Bhargavkonidena@users.noreply.github.com>
Signed-off-by: Bhargavkonidena <Bhargavkonidena@users.noreply.github.com>
gjenkins8
left a comment
There was a problem hiding this comment.
Thanks for the PR! I took an initial pass, I still need to review some of the specifics. But some initial comments:
- Please don't remove
.github/issue_template.md. That should be done in a separate and specific PR. - can we update the
build-crosstarget inMakefileto also usegoreleaser, and any related/then unused functionality e.g.TARGETS,TARGET_OBJS,GOX(and download), etc- the
test-acceptancetarget will need to be updated somehow. currently this only requires a build oflinux/amd64. ideally we could emulate this logic
- the
plus the comments inline on the PR. Thanks!
Signed-off-by: Bhargavkonidena <Bhargavkonidena@users.noreply.github.com>
Signed-off-by: Bhargavkonidena <Bhargavkonidena@users.noreply.github.com>
Signed-off-by: Bhargavkonidena <Bhargavkonidena@users.noreply.github.com>
Signed-off-by: Bhargavkonidena <Bhargavkonidena@users.noreply.github.com>
I am done with incorporating these review comments. Please check. |
|
@gjenkins8 can you please review this PR |
|
@mattfarina and I can review this on the next Helmternoon. |
gjenkins8
left a comment
There was a problem hiding this comment.
there are quite a few things to fix up here. once these are fixed, it is needed to test this change (as much as possible) locally. Then we can consider how to validate in github actions.
| GOFLAGS="-trimpath" CGO_ENABLED=0 $(GOX) -parallel=3 -output="_dist/{{.OS}}-{{.Arch}}/$(BINNAME)" -osarch='$(TARGETS)' $(GOFLAGS) -tags '$(TAGS)' -ldflags '$(LDFLAGS)' ./cmd/helm | ||
| build-cross: | ||
| @echo "==> Building cross-platform binaries using GoReleaser" | ||
| goreleaser build --clean --skip-validate --single-target |
There was a problem hiding this comment.
--skip-validate is deprecated -- see: https://goreleaser.com/deprecations/
don't you want/need to refer to the config file? And why is --single-target being passed here?
|
|
||
| .PHONY: build-linux-amd64 | ||
| build-linux-amd64: | ||
| GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build $(GOFLAGS) -trimpath -tags '$(TAGS)' -ldflags '$(LDFLAGS)' -o '$(BINDIR)/$(BINNAME)' ./cmd/helm |
There was a problem hiding this comment.
I think it would be better to use (for consistency) goreleaser w/ --single-target?
| - linux | ||
| - darwin | ||
| - windows | ||
| goarch: |
There was a problem hiding this comment.
for GOARCH we previously had:
darwin/amd64 darwin/arm64 linux/amd64 linux/386 linux/arm linux/arm64 linux/ppc64le linux/s390x linux/riscv64 windows/amd64 windows/arm64
ie. linux/386, linux/arm, linux/ppc64le, linux/s390x linux/riscv64 need to continue to be built, but are missing here.
| make build-cross VERSION="${{ github.ref_name }}" | ||
| make dist checksum VERSION="${{ github.ref_name }}" | ||
| - name: Run Go Release | ||
| uses: goreleaser/goreleaser-action@v6.3.0 |
There was a problem hiding this comment.
we need to pin to a specific release via hash (see other uses:). Please also include the semver version as a comment.
|
|
||
| - name: Build Helm Binaries | ||
| - name: Run Go Release | ||
| uses: goreleaser/goreleaser-action@v6.3.0 |
There was a problem hiding this comment.
as above (we need to pin to a specific release via hash (see other uses:). Please also include the semver version as a comment.)
| .PHONY: test-acceptance | ||
| test-acceptance: TARGETS = linux/amd64 | ||
| test-acceptance: build build-cross | ||
| test-acceptance: build build-linux-amd64 |
There was a problem hiding this comment.
test-acceptance previously built current arch + all architectures. Now it is building current + linux/amd64.
If I'm not mistaken, we previously did this to:
- build all architectures to ensure all architectures build
- build current arch, to run acceptable tests
We need to continue the above behavior here (rather than building current + linux/amd64 only; runners are most likely to be linux/amd64, which makes this redundant too)
| make dist checksum VERSION="${{ github.ref_name }}" | ||
| - name: Run Go Release | ||
| uses: goreleaser/goreleaser-action@v6.3.0 | ||
| if: success() && startsWith(github.ref, 'refs/tags/') |
There was a problem hiding this comment.
| @@ -0,0 +1,38 @@ | |||
| project_name: helm | |||
There was a problem hiding this comment.
How are you testing this change? A superficial run fails with:
$ goreleaser build --clean --skip validate -f .github/workflows/.goreleaser.yaml
• only version: 2 configuration files are supported, yours is version: 0 , please update your configuration
⨯ build failed after 0s error=only version: 2 configuration files are supported, yours is version: 0 , please update your configuration
|
|
||
| - name: Verify checksum | ||
| run: | | ||
| make dist checksum VERSION="${{ github.ref_name }}" |
There was a problem hiding this comment.
unless I'm mistaken, make dist is recreating the release archives. Which .goreleaser.yaml is also configured to do:
https://github.com/helm/helm/pull/30913/files#diff-413d66267886290506ba7e2df00c65cb65341ec7347cd34568117ff435f63623R25
please use one or the other (preference would be to use goreleaser, rather than makefile logic I think)
| ldflags: | ||
| - -s -w -extldflags "-static" | ||
| flags: | ||
| - -tags=netgo |
There was a problem hiding this comment.
where did this "netgo" tag come from?
The merge-base changed after approval.
|
This pull request has been marked as stale because it has been open for 90 days with no activity. This pull request will be automatically closed in 30 days if no further activity occurs. |
Resolves #30896
Special notes for your reviewer:
If applicable:
docs neededlabel should be applied if so)