mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-12 01:14:22 +00:00
Add tag check to release script
This commit is contained in:
@@ -5,12 +5,16 @@
|
|||||||
[Google Cloud Build]: https://cloud.google.com/cloud-build
|
[Google Cloud Build]: https://cloud.google.com/cloud-build
|
||||||
[semver]: https://semver.org
|
[semver]: https://semver.org
|
||||||
[Go modules]: https://github.com/golang/go/wiki/Modules
|
[Go modules]: https://github.com/golang/go/wiki/Modules
|
||||||
|
[multi-module repo]: https://github.com/go-modules-by-example/index/blob/master/009_submodules/README.md
|
||||||
|
|
||||||
This document describes how to perform a [semver] release
|
This document describes how to perform a [semver] release
|
||||||
of one of the [Go modules] in this repository.
|
of one of the [Go modules] in this repository.
|
||||||
|
|
||||||
These modules release independently.
|
These modules release independently.
|
||||||
|
|
||||||
|
See this [multi-module repo] tagging discussion
|
||||||
|
for an explanation of the `foo/v2.3.0` tags applied below.
|
||||||
|
|
||||||
## Module summaries
|
## Module summaries
|
||||||
|
|
||||||
[`sigs.k8s.io/kustomize/kustomize`]: #sigsk8siokustomizekustomize
|
[`sigs.k8s.io/kustomize/kustomize`]: #sigsk8siokustomizekustomize
|
||||||
|
|||||||
@@ -10,6 +10,23 @@ set -x
|
|||||||
module=$1
|
module=$1
|
||||||
shift
|
shift
|
||||||
|
|
||||||
|
# The following assumes git tags formatted like
|
||||||
|
# "api/v1.2.3" and splits on the slash.
|
||||||
|
# Goreleaser doesn't know what to do with this
|
||||||
|
# tag format, and fails when creating an archive
|
||||||
|
# with a / in the name.
|
||||||
|
fullTag=$(git describe)
|
||||||
|
export tModule=${fullTag%/*}
|
||||||
|
export tSemver=${fullTag#*/}
|
||||||
|
echo "tModule=$tModule"
|
||||||
|
echo "tSemver=$tSemver"
|
||||||
|
if [ "$module" != "$tModule" ]; then
|
||||||
|
# Tag and argument sanity check
|
||||||
|
echo "Unexpected mismatch: moduleFromArg=$module, moduleFromTag=$tModule"
|
||||||
|
echo "Either the module arg to this script is wrong, or the git tag is wrong."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
configFile=$(mktemp)
|
configFile=$(mktemp)
|
||||||
cat <<EOF >$configFile
|
cat <<EOF >$configFile
|
||||||
project_name: $module
|
project_name: $module
|
||||||
@@ -44,6 +61,8 @@ builds:
|
|||||||
- windows
|
- windows
|
||||||
goarch:
|
goarch:
|
||||||
- amd64
|
- amd64
|
||||||
|
archive:
|
||||||
|
name_template: "{{ .ProjectName }}_${tSemver}_{{ .Os }}_{{ .Arch }}"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat $configFile
|
cat $configFile
|
||||||
|
|||||||
Reference in New Issue
Block a user