From 68eadeeac670539a2ba255111b3ee1232a3ce5f6 Mon Sep 17 00:00:00 2001 From: Kenneth Bingham Date: Tue, 30 Jul 2024 18:34:30 -0400 Subject: [PATCH] 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 681c0a5e..403f8b18 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 == 'helm/chart-releaser' 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..64bcb1c1 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") != "helm/chart-releaser" { + args = append(args, "--skip=docker,homebrew") + } + + return sh.RunV("goreleaser", args...) }