From 92c1d6c7f26039c4d590f6114b383ba221e4a413 Mon Sep 17 00:00:00 2001 From: Kenneth Bingham Date: Tue, 30 Jul 2024 18:34:30 -0400 Subject: [PATCH 1/2] tweak build to enable contributions from forks Signed-off-by: Kenneth Bingham --- .github/workflows/release.yaml | 1 + .goreleaser.yml | 10 +++++----- magefile.go | 9 ++++++++- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 17029c28..5e3e0d30 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -54,6 +54,7 @@ jobs: - uses: chainguard-dev/actions/goimports@main - name: Login to registry + if: github.repository_owner == 'helm' uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 with: registry: quay.io diff --git a/.goreleaser.yml b/.goreleaser.yml index 148e778f..209c6d15 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -58,7 +58,7 @@ snapshot: dockers: - goos: linux goarch: amd64 - skip_push: "{{ ne .GitURL 'https://github.com/helm/chart-releaser' | toYaml }}" + skip_push: "{{ if ne .GitURL \"https://github.com/helm/chart-releaser\" }}true{{ else }}false{{ end }}" dockerfile: Dockerfile use: buildx image_templates: @@ -77,7 +77,7 @@ dockers: - goos: linux goarch: arm64 - skip_push: "{{ ne .GitURL 'https://github.com/helm/chart-releaser' | toYaml }}" + skip_push: "{{ if ne .GitURL \"https://github.com/helm/chart-releaser\" }}true{{ else }}false{{ end }}" dockerfile: Dockerfile use: buildx image_templates: @@ -97,7 +97,7 @@ dockers: - goos: linux goarch: arm goarm: 7 - skip_push: "{{ ne .GitURL 'https://github.com/helm/chart-releaser' | toYaml }}" + skip_push: "{{ if ne .GitURL \"https://github.com/helm/chart-releaser\" }}true{{ else }}false{{ end }}" dockerfile: Dockerfile use: buildx image_templates: @@ -116,7 +116,7 @@ dockers: - goos: linux goarch: s390x - skip_push: "{{ ne .GitURL 'https://github.com/helm/chart-releaser' | toYaml }}" + skip_push: "{{ if ne .GitURL \"https://github.com/helm/chart-releaser\" }}true{{ else }}false{{ end }}" dockerfile: Dockerfile use: buildx image_templates: @@ -135,7 +135,7 @@ dockers: - goos: linux goarch: ppc64le - skip_push: "{{ ne .GitURL 'https://github.com/helm/chart-releaser' | toYaml }}" + skip_push: "{{ if ne .GitURL \"https://github.com/helm/chart-releaser\" }}true{{ else }}false{{ end }}" dockerfile: Dockerfile use: buildx image_templates: diff --git a/magefile.go b/magefile.go index 721f8416..ce3a6abb 100644 --- a/magefile.go +++ b/magefile.go @@ -137,5 +137,12 @@ func Release() error { return err } - return sh.RunV("goreleaser", "release", "--clean") + var args []string + args = append(args, "release", "--clean") + + if os.Getenv("GITHUB_REPOSITORY_OWNER") != "helm" { + args = append(args, "--skip=docker,homebrew") + } + + return sh.RunV("goreleaser", args...) } From f5305aa626e5bd78a9f73a6cc40e2e30668e14de Mon Sep 17 00:00:00 2001 From: Matt Clegg Date: Mon, 19 Aug 2024 10:43:17 +0100 Subject: [PATCH 2/2] CLEANUP toYaml --- .goreleaser.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 209c6d15..71d2c6fb 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -58,7 +58,7 @@ snapshot: dockers: - goos: linux goarch: amd64 - skip_push: "{{ if ne .GitURL \"https://github.com/helm/chart-releaser\" }}true{{ else }}false{{ end }}" + skip_push: "{{ ne .GitURL \"https://github.com/helm/chart-releaser\" }}" dockerfile: Dockerfile use: buildx image_templates: @@ -77,7 +77,7 @@ dockers: - goos: linux goarch: arm64 - skip_push: "{{ if ne .GitURL \"https://github.com/helm/chart-releaser\" }}true{{ else }}false{{ end }}" + skip_push: "{{ ne .GitURL \"https://github.com/helm/chart-releaser\" }}" dockerfile: Dockerfile use: buildx image_templates: @@ -97,7 +97,7 @@ dockers: - goos: linux goarch: arm goarm: 7 - skip_push: "{{ if ne .GitURL \"https://github.com/helm/chart-releaser\" }}true{{ else }}false{{ end }}" + skip_push: "{{ ne .GitURL \"https://github.com/helm/chart-releaser\" }}" dockerfile: Dockerfile use: buildx image_templates: @@ -116,7 +116,7 @@ dockers: - goos: linux goarch: s390x - skip_push: "{{ if ne .GitURL \"https://github.com/helm/chart-releaser\" }}true{{ else }}false{{ end }}" + skip_push: "{{ ne .GitURL \"https://github.com/helm/chart-releaser\" }}" dockerfile: Dockerfile use: buildx image_templates: @@ -135,7 +135,7 @@ dockers: - goos: linux goarch: ppc64le - skip_push: "{{ if ne .GitURL \"https://github.com/helm/chart-releaser\" }}true{{ else }}false{{ end }}" + skip_push: "{{ ne .GitURL \"https://github.com/helm/chart-releaser\" }}" dockerfile: Dockerfile use: buildx image_templates: