-
-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathjustfile
37 lines (27 loc) · 1.04 KB
/
justfile
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
default: release
app := "yubikey-touch-detector"
version := `git describe --tags`
release: clean vendor
mkdir -p dist
git -c tar.tar.gz.command="gzip -cn" archive -o "dist/{{app}}-{{version}}.tar.gz" --format tar.gz --prefix "{{app}}-{{version}}/" "{{version}}"
git -c tar.tar.gz.command="gzip -cn" archive -o "dist/{{app}}-{{version}}-vendored.tar.gz" --format tar.gz \
`find vendor -type f -printf '--prefix={{app}}-{{version}}/%h/ --add-file=%p '` \
--prefix "{{app}}-{{version}}/" "{{version}}"
for file in dist/*; do \
gpg --detach-sign --armor "$file"; \
done
rm -f "dist/{{app}}-{{version}}.tar.gz"
run *args:
go run main.go {{args}}
build:
# if you are building from git-archive tarballs, no need to pass -ldflags, the version is already hardcoded in main.go
go build -ldflags "-X main.version={{version}}" -o {{app}} main.go
scdoc < '{{app}}.1.scd' > '{{app}}.1'
vendor:
go mod tidy
go mod vendor
clean:
rm -f {{app}}
rm -f {{app}}.1
rm -rf dist
rm -rf vendor