File tree Expand file tree Collapse file tree 2 files changed +40
-1
lines changed Expand file tree Collapse file tree 2 files changed +40
-1
lines changed Original file line number Diff line number Diff line change
1
+ .DEFAULT_GOAL := build
2
+
1
3
PKG := github.com/lightninglabs/loop
2
4
3
5
GOTEST := GO111MODULE=on go test -v
Original file line number Diff line number Diff line change 4
4
# we support with the golang cross-compiler.
5
5
#
6
6
# Copyright (c) 2016 Company 0, LLC.
7
- # Copyright (c) 2019 Lightning Labs
8
7
# Use of this source code is governed by the ISC
9
8
# license.
10
9
10
+ # Exit on errors.
11
+ set -e
12
+
11
13
# If no tag specified, use date + version otherwise use tag.
12
14
if [[ $1 x = x ]]; then
13
15
DATE=` date +%Y%m%d`
14
16
VERSION=" 01"
15
17
TAG=$DATE -$VERSION
16
18
else
17
19
TAG=$1
20
+
21
+ # If a tag is specified, ensure that that tag is present and checked out.
22
+ if [[ $TAG != $( git describe) ]]; then
23
+ echo " tag $TAG not checked out"
24
+ exit 1
25
+ fi
26
+
27
+ # Verify that it is signed.
28
+ if ! git verify-tag $TAG ; then
29
+ echo " tag $TAG not signed"
30
+ exit 1
31
+ fi
32
+
33
+ # Build loop to extract version.
34
+ make
35
+
36
+ # Extract version command output.
37
+ LOOP_VERSION_OUTPUT=` ./loopd-debug --version`
38
+
39
+ # Use a regex to isolate the version string.
40
+ LOOP_VERSION_REGEX=" version (.+) "
41
+ if [[ $LOOP_VERSION_OUTPUT =~ $LOOP_VERSION_REGEX ]]; then
42
+ # Prepend 'v' to match git tag naming scheme.
43
+ LOOP_VERSION=" v${BASH_REMATCH[1]} "
44
+ echo " version: $LOOP_VERSION "
45
+
46
+ # Match git tag with loop version.
47
+ if [[ $TAG != $LOOP_VERSION ]]; then
48
+ echo " loop version $LOOP_VERSION does not match tag $TAG "
49
+ exit 1
50
+ fi
51
+ else
52
+ echo " malformed loop version output"
53
+ exit 1
54
+ fi
18
55
fi
19
56
20
57
go mod vendor
You can’t perform that action at this time.
0 commit comments