File tree Expand file tree Collapse file tree 3 files changed +56
-6
lines changed Expand file tree Collapse file tree 3 files changed +56
-6
lines changed Original file line number Diff line number Diff line change
1
+ name : Publish release
2
+
3
+ on :
4
+ push :
5
+ tags :
6
+ - ' v*'
7
+ jobs :
8
+
9
+ publish :
10
+ strategy :
11
+ matrix :
12
+ os : [ubuntu-latest]
13
+ go : [1.14]
14
+ name : ${{ matrix.os }} @ Go ${{ matrix.go }}
15
+ runs-on : ${{ matrix.os }}
16
+ steps :
17
+ - name : Set up Go ${{ matrix.go }}
18
+ uses : actions/setup-go@v1
19
+ with :
20
+ go-version : ${{ matrix.go }}
21
+
22
+ - name : Set GOPATH, PATH and ENV
23
+ run : |
24
+ echo "::set-env name=GOPATH::$(dirname $GITHUB_WORKSPACE)"
25
+ echo "::set-env name=GO111MODULE::on"
26
+ echo "::set-env name=GOPROXY::https://proxy.golang.org"
27
+ echo "::add-path::$(dirname $GITHUB_WORKSPACE)/bin"
28
+ shell : bash
29
+
30
+ - name : Checkout Code
31
+ uses : actions/checkout@v2
32
+
33
+ - name : Build
34
+ run : ./make_release.sh
35
+
36
+ - name : Upload artifacts
37
+ uses : svenstaro/upload-release-action@v1-release
38
+ with :
39
+ repo_token : ${{ secrets.GITHUB_TOKEN }}
40
+ file : dist/*
41
+ file_glob : true
42
+ overwrite : true
43
+ tag : ${{ github.ref }}
Original file line number Diff line number Diff line change @@ -22,12 +22,13 @@ const (
22
22
)
23
23
24
24
var (
25
- debugFlag = false
25
+ debugFlag = false
26
+ appVersion string
26
27
)
27
28
28
29
func main () {
29
30
app := cli .NewApp ()
30
- app .Version = "0.5"
31
+ app .Version = appVersion
31
32
app .Usage = "tool for managing .mcm character sets for MAX7456"
32
33
app .Flags = []cli.Flag {
33
34
& cli.BoolFlag {
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
- VERSION=$( grep app.Version main.go | cut -d= -f 2 | tr -d ' [:space:]"' )
2
+
3
+ set -e
4
+ set -x
5
+
6
+ REV=$( git rev-parse --short HEAD)
7
+ TAG=$( git describe --tags)
8
+ VERSION=" ${TAG} (${REV} )"
3
9
GO_OSARCH=" darwin/amd64 linux/386 linux/amd64 linux/arm windows/386 windows/amd64"
4
10
5
11
mkdir -p dist
6
12
7
13
for v in ${GO_OSARCH} ; do
8
14
GOOS=$( echo ${v} | cut -d/ -f 1)
9
15
GOARCH=$( echo ${v} | cut -d/ -f 2)
10
- GOOS=${GOOS} GOARCH=${GOARCH} go build
16
+ GOOS=${GOOS} GOARCH=${GOARCH} go build -ldflags " -X \" main.appVersion= ${VERSION} \" "
11
17
exe=max7456tool
12
- rel=max7456tool_${VERSION } _${GOOS} _${GOARCH}
18
+ rel=max7456tool_${TAG } _${GOOS} _${GOARCH}
13
19
if [ ${GOOS} = " windows" ]; then
14
20
exe=${exe} .exe
15
21
zip=${rel} .zip
@@ -22,4 +28,4 @@ for v in ${GO_OSARCH}; do
22
28
fi
23
29
done
24
30
25
- go clean
31
+ go clean
You can’t perform that action at this time.
0 commit comments