mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-09-18 13:22:17 +00:00
Copy newer Go into goreleaser image
This commit is contained in:
@@ -37,6 +37,14 @@ steps:
|
|||||||
- checkout
|
- checkout
|
||||||
- $TAG_NAME
|
- $TAG_NAME
|
||||||
|
|
||||||
|
# Copy a newer version of Go into the goreleaser workspace.
|
||||||
|
# Use the same source image as the builder in kustomize.Dockerfile
|
||||||
|
- name: golang:alpine
|
||||||
|
entrypoint: /bin/sh
|
||||||
|
args:
|
||||||
|
- '-c'
|
||||||
|
- 'mkdir -p /workspace/bin && cp $(go env GOROOT)/bin/go /workspace/bin'
|
||||||
|
|
||||||
# Run goreleaser indirectly via a shell script
|
# Run goreleaser indirectly via a shell script
|
||||||
# to configure it properly.
|
# to configure it properly.
|
||||||
- name: goreleaser/goreleaser:v0.179.0
|
- name: goreleaser/goreleaser:v0.179.0
|
||||||
@@ -44,6 +52,8 @@ steps:
|
|||||||
entrypoint: /bin/sh
|
entrypoint: /bin/sh
|
||||||
dir: myClone
|
dir: myClone
|
||||||
secretEnv: ['GITHUB_TOKEN']
|
secretEnv: ['GITHUB_TOKEN']
|
||||||
|
env:
|
||||||
|
- 'GO_BINARY_PATH=/workspace/bin/go'
|
||||||
args:
|
args:
|
||||||
- releasing/cloudbuild.sh
|
- releasing/cloudbuild.sh
|
||||||
- $TAG_NAME
|
- $TAG_NAME
|
||||||
|
|||||||
@@ -51,6 +51,16 @@ echo "module=$module"
|
|||||||
semVer=${fullTag#$module/}
|
semVer=${fullTag#$module/}
|
||||||
echo "semVer=$semVer"
|
echo "semVer=$semVer"
|
||||||
|
|
||||||
|
# Because of https://github.com/kubernetes-sigs/kustomize/issues/4542
|
||||||
|
# we need to manually install a newer version of Go into an older goreleaser image.
|
||||||
|
# This points goreleaser to that version of Go, or the version discovered from PATH if unspecified.
|
||||||
|
goBinary="go"
|
||||||
|
if [[ -n "${GO_BINARY_PATH:-}" ]]; then
|
||||||
|
echo "GO_BINARY_PATH is set, using go version from $GO_BINARY_PATH"
|
||||||
|
goBinary="$GO_BINARY_PATH"
|
||||||
|
fi
|
||||||
|
sh -c "$goBinary version"
|
||||||
|
|
||||||
# Generate the changelog for this release
|
# Generate the changelog for this release
|
||||||
# using the last two tags for the module
|
# using the last two tags for the module
|
||||||
changeLogFile=$(mktemp)
|
changeLogFile=$(mktemp)
|
||||||
@@ -101,6 +111,8 @@ builds:
|
|||||||
-X sigs.k8s.io/kustomize/api/provenance.gitCommit={{.Commit}}
|
-X sigs.k8s.io/kustomize/api/provenance.gitCommit={{.Commit}}
|
||||||
-X sigs.k8s.io/kustomize/api/provenance.buildDate={{.Date}}
|
-X sigs.k8s.io/kustomize/api/provenance.buildDate={{.Date}}
|
||||||
|
|
||||||
|
gobinary: ${goBinary}
|
||||||
|
|
||||||
goos:
|
goos:
|
||||||
- linux
|
- linux
|
||||||
- darwin
|
- darwin
|
||||||
|
|||||||
Reference in New Issue
Block a user