mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-09-01 01:14:03 +03:00
Add task for static build
This commit is contained in:
+16
@@ -8,6 +8,22 @@ sources = ["**/*.go", "go.mod", "go.sum"]
|
||||
outputs = ["mtg"]
|
||||
run = "go build"
|
||||
|
||||
[tasks.static]
|
||||
description = "Build static binary"
|
||||
sources = ["**/*.go", "go.mod", "go.sum"]
|
||||
outputs = ["mtg"]
|
||||
run = """
|
||||
#!/bin/bash
|
||||
|
||||
version="$(git describe --exact-match HEAD 2>/dev/null || git describe --tags --always)"
|
||||
go build \
|
||||
-trimpath \
|
||||
-mod=readonly \
|
||||
-ldflags="-extldflags '-static' -s -w -X 'main.version=$version'" \
|
||||
-a \
|
||||
-tags netgo
|
||||
"""
|
||||
|
||||
[tasks.release]
|
||||
description = "Create release tarballs"
|
||||
tools.goreleaser = "latest"
|
||||
|
||||
Reference in New Issue
Block a user