-
-
Notifications
You must be signed in to change notification settings - Fork 610
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
46 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
if [ "$1" == "" ]; then | ||
echo "Please specify at a version" | ||
exit 1 | ||
fi | ||
|
||
version=$1 | ||
|
||
# validate version is in the right format | ||
echo $version | sed -r '/v4\.[0-9][0-9]\.[0-9][0-9]?$/!{q1}' | ||
|
||
previousVersion=$(cat cmd/version.go| sed -n 's/.*Version = "\([^"]*\)"/\1/p') | ||
|
||
echo "Updating from $previousVersion to $version" | ||
|
||
sed -i "s/\(.*Version =\).*/\1 \"$version\"/" cmd/version.go | ||
|
||
go build . | ||
actualVersion=$(./yq --version) | ||
|
||
if [ "$actualVersion" != "yq (https://github.com/mikefarah/yq/) version $version" ]; then | ||
echo "Failed to update version.go" | ||
exit 1 | ||
else | ||
echo "version.go updated" | ||
fi | ||
|
||
version=$version ./yq -i '.version=strenv(version)' snap/snapcraft.yaml | ||
|
||
actualSnapVersion=$(./yq '.version' snap/snapcraft.yaml) | ||
|
||
if [ "$actualSnapVersion" != "$version" ]; then | ||
echo "Failed to update snapcraft" | ||
exit 1 | ||
else | ||
echo "snapcraft updated" | ||
fi | ||
|
||
git add cmd/version.go snap/snapcraft.yaml | ||
git commit -m 'Bumping version' | ||
git tag $version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
set -e | ||
# you may need to go install github.com/mitchellh/[email protected] first | ||
echo $VERSION | ||
CGO_ENABLED=0 gox -ldflags "${LDFLAGS} -X github.com/mikefarah/yq/v4/cmd.Version=${VERSION}" -output="build/yq_{{.OS}}_{{.Arch}}" --osarch="darwin/amd64 darwin/arm64 freebsd/386 freebsd/amd64 freebsd/arm linux/386 linux/amd64 linux/arm linux/arm64 linux/mips linux/mips64 linux/mips64le linux/mipsle linux/ppc64 linux/ppc64le linux/s390x netbsd/386 netbsd/amd64 netbsd/arm openbsd/386 openbsd/amd64 windows/386 windows/amd64" | ||
CGO_ENABLED=0 gox -ldflags "${LDFLAGS}" -output="build/yq_{{.OS}}_{{.Arch}}" --osarch="darwin/amd64 darwin/arm64 freebsd/386 freebsd/amd64 freebsd/arm linux/386 linux/amd64 linux/arm linux/arm64 linux/mips linux/mips64 linux/mips64le linux/mipsle linux/ppc64 linux/ppc64le linux/s390x netbsd/386 netbsd/amd64 netbsd/arm openbsd/386 openbsd/amd64 windows/386 windows/amd64" | ||
|
||
cd build | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters