|
|
@@ -8,6 +8,22 @@ sources = ["**/*.go", "go.mod", "go.sum"]
|
|
8
|
8
|
outputs = ["mtg"]
|
|
9
|
9
|
run = "go build"
|
|
10
|
10
|
|
|
|
11
|
+[tasks.static]
|
|
|
12
|
+description = "Build static binary"
|
|
|
13
|
+sources = ["**/*.go", "go.mod", "go.sum"]
|
|
|
14
|
+outputs = ["mtg"]
|
|
|
15
|
+run = """
|
|
|
16
|
+#!/bin/bash
|
|
|
17
|
+
|
|
|
18
|
+version="$(git describe --exact-match HEAD 2>/dev/null || git describe --tags --always)"
|
|
|
19
|
+go build \
|
|
|
20
|
+ -trimpath \
|
|
|
21
|
+ -mod=readonly \
|
|
|
22
|
+ -ldflags="-extldflags '-static' -s -w -X 'main.version=$version'" \
|
|
|
23
|
+ -a \
|
|
|
24
|
+ -tags netgo
|
|
|
25
|
+"""
|
|
|
26
|
+
|
|
11
|
27
|
[tasks.release]
|
|
12
|
28
|
description = "Create release tarballs"
|
|
13
|
29
|
tools.goreleaser = "latest"
|