-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
47 lines (38 loc) · 1.17 KB
/
Copy pathjustfile
File metadata and controls
47 lines (38 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
alias h := _help
_help:
@just --list --unsorted --alias-style left --color always \
--list-heading='' --list-prefix=' ' \
| sed -e 's/alias: //'
CGO_ENABLED := '0' # otherwise binaries produced are dynamically linked and don't work on musl distros like alpine0
# simple build
build:
go build -v -o emd
# build for amd64, arm64 and arm
build-all:
#!/bin/bash
version=$(grep VERSION cmd/globals.go | awk -F= '{ print $2 }' | tr -d '"' | sed -e 's/ //')
echo $version
GOARCH=amd64 go build -v -o emd-${version}-linux-amd64
GOARCH=arm64 go build -v -o emd-${version}-linux-arm64
GOARCH=arm go build -v -o emd-${version}-linux-arm
xz --compress --keep -9 --extreme --verbose emd-*-linux-*
# tag for release
tag:
#!/bin/bash
git tag
tag=$(grep VERSION cmd/globals.go | awk -F= '{ print $2 }' | tr -d '"' | sed -e 's/ /v/')
echo -n "Please confirm you want to add this tag: [${tag}] [y/N]? "
read yesno ; [[ "${yesno,,}" =~ ^(y|yes)$ ]] || exit 0
git tag "${tag}"
git push origin --tags
# clean built binaries
clean:
rm -v emd*
# show version in the source tree
version:
grep VERSION cmd/globals.go
[private]
v:
just --evaluate
set export
set shell := ["bash","-uc"]