File tree Expand file tree Collapse file tree 6 files changed +46
-19
lines changed
Expand file tree Collapse file tree 6 files changed +46
-19
lines changed Original file line number Diff line number Diff line change 4444 mkdir -p build
4545 cp yq.1 build/yq.1
4646 ./scripts/xcompile.sh
47- env :
48- VERSION : ${{ steps.get_version.outputs.VERSION }}
4947
5048 - name : Release
5149 uses : softprops/action-gh-release@v1
Original file line number Diff line number Diff line change 1313 runs-on : ubuntu-latest
1414 steps :
1515 - uses : actions/checkout@v3
16-
17- - name : Get the version
18- id : get_version
19- run : echo "VERSION=${GITHUB_REF##*/}" >> "${GITHUB_OUTPUT}"
20-
21- - name : Update snapcraft version file
22- env :
23- VERSION : ${{ steps.get_version.outputs.VERSION }}
24- uses : mikefarah/yq@master
25- with :
26- cmd : yq -i '.version = strenv(VERSION)' snap/snapcraft.yaml
2716 - uses : snapcore/action-build@v1
2817 id : build
2918 - uses : snapcore/action-publish@v1
Original file line number Diff line number Diff line change 1111 GitDescribe string
1212
1313 // Version is main version number that is being run at the moment.
14- Version = ""
14+ Version = "v4.30.4 "
1515
1616 // VersionPrerelease is a pre-release marker for the version. If this is "" (empty string)
1717 // then it means that it is a final release. Otherwise, this is a pre-release
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -e
3+
4+ if [ " $1 " == " " ]; then
5+ echo " Please specify at a version"
6+ exit 1
7+ fi
8+
9+ version=$1
10+
11+ # validate version is in the right format
12+ echo $version | sed -r ' /v4\.[0-9][0-9]\.[0-9][0-9]?$/!{q1}'
13+
14+ previousVersion=$( cat cmd/version.go| sed -n ' s/.*Version = "\([^"]*\)"/\1/p' )
15+
16+ echo " Updating from $previousVersion to $version "
17+
18+ sed -i " s/\(.*Version =\).*/\1 \" $version \" /" cmd/version.go
19+
20+ go build .
21+ actualVersion=$( ./yq --version)
22+
23+ if [ " $actualVersion " != " yq (https://github.com/mikefarah/yq/) version $version " ]; then
24+ echo " Failed to update version.go"
25+ exit 1
26+ else
27+ echo " version.go updated"
28+ fi
29+
30+ version=$version ./yq -i ' .version=strenv(version)' snap/snapcraft.yaml
31+
32+ actualSnapVersion=$( ./yq ' .version' snap/snapcraft.yaml)
33+
34+ if [ " $actualSnapVersion " != " $version " ]; then
35+ echo " Failed to update snapcraft"
36+ exit 1
37+ else
38+ echo " snapcraft updated"
39+ fi
40+
41+ git add cmd/version.go snap/snapcraft.yaml
42+ git commit -m ' Bumping version'
43+ git tag $version
Original file line number Diff line number Diff line change 22set -e
33# you may need to go install github.com/mitchellh/[email protected] first44echo $VERSION
5- 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"
5+ 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"
66
77cd build
88
Original file line number Diff line number Diff line change 11name : yq
2- version : ' v4.30.3 '
2+ version : ' v4.30.4 '
33summary : A lightweight and portable command-line YAML processor
44description : |
55 The aim of the project is to be the jq or sed of yaml files.
6-
76base : core18
87grade : stable # devel|stable. must be 'stable' to release into candidate/stable channels
98confinement : strict
10-
119apps :
1210 yq :
1311 command : yq
1412 plugs : [home]
15-
1613parts :
1714 yq :
1815 plugin : go
You can’t perform that action at this time.
0 commit comments