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 44
44
mkdir -p build
45
45
cp yq.1 build/yq.1
46
46
./scripts/xcompile.sh
47
- env :
48
- VERSION : ${{ steps.get_version.outputs.VERSION }}
49
47
50
48
- name : Release
51
49
uses : softprops/action-gh-release@v1
Original file line number Diff line number Diff line change 13
13
runs-on : ubuntu-latest
14
14
steps :
15
15
- 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
27
16
- uses : snapcore/action-build@v1
28
17
id : build
29
18
- uses : snapcore/action-publish@v1
Original file line number Diff line number Diff line change 11
11
GitDescribe string
12
12
13
13
// Version is main version number that is being run at the moment.
14
- Version = ""
14
+ Version = "v4.30.4 "
15
15
16
16
// VersionPrerelease is a pre-release marker for the version. If this is "" (empty string)
17
17
// 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 2
2
set -e
3
3
# you may need to go install github.com/mitchellh/[email protected] first
4
4
echo $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"
6
6
7
7
cd build
8
8
Original file line number Diff line number Diff line change 1
1
name : yq
2
- version : ' v4.30.3 '
2
+ version : ' v4.30.4 '
3
3
summary : A lightweight and portable command-line YAML processor
4
4
description : |
5
5
The aim of the project is to be the jq or sed of yaml files.
6
-
7
6
base : core18
8
7
grade : stable # devel|stable. must be 'stable' to release into candidate/stable channels
9
8
confinement : strict
10
-
11
9
apps :
12
10
yq :
13
11
command : yq
14
12
plugs : [home]
15
-
16
13
parts :
17
14
yq :
18
15
plugin : go
You can’t perform that action at this time.
0 commit comments