Repository navigation
Expand file tree
/
Copy pathjustfile
More file actions
107 lines (80 loc) · 2.59 KB
/
Copy pathjustfile
File metadata and controls
107 lines (80 loc) · 2.59 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
set dotenv-load := true
set export := true
set positional-arguments := true
NAME := "ssh-keyselect"
GO_EXE_SUFFIX := `go env GOEXE`
default:
@just --list
#
# clean
#
clean:
rm -rf dist release-packages CREDITS assets/gui/generated
bash scripts/windows-icon-resources.sh clean
mkdir -p dist
#
# update
#
update: update-aqua update-go
update-aqua:
aqua update
aqua update-checksum --prune
aqua i -l
update-go:
go get -t -u ./...
go mod tidy
#
# deps
#
deps:
go mod download
deps-credits:
bash scripts/generate-credits.sh
deps-credits-if-missing:
if [ ! -s CREDITS ] || [ ! -s internal/credits/dependencies.txt ]; then bash scripts/generate-credits.sh; fi
#
# dev
#
fmt:
gofmt -w .
lint:
golangci-lint run ./...
test: deps-credits-if-missing
go test ./...
go test -tags gui ./...
help *ARGS:
go run ./cmd/ssh-keyselect {{ARGS}} --help
#
# gen
#
gen-platform-icons:
go run ./scripts/generate-platform-icons.go
gen-windows-icons: gen-platform-icons
bash scripts/generate-windows-icons.sh
#
# build
#
build: clean deps gen-windows-icons deps-credits-if-missing
bash scripts/windows-icon-resources.sh with env CGO_ENABLED=0 go build -trimpath -ldflags "-s -w" -o dist/ssh-keyselect{{GO_EXE_SUFFIX}} ./cmd/ssh-keyselect
if [ "$(go env GOOS)" = "windows" ]; then \
bash scripts/windows-icon-resources.sh with env CGO_ENABLED=0 go build -trimpath -tags gui -ldflags "-s -w -H windowsgui" -o dist/ssh-keyselect-gui{{GO_EXE_SUFFIX}} ./cmd/ssh-keyselect-gui; \
else \
bash scripts/windows-icon-resources.sh with env CGO_ENABLED=0 go build -trimpath -tags gui -ldflags "-s -w" -o dist/ssh-keyselect-gui{{GO_EXE_SUFFIX}} ./cmd/ssh-keyselect-gui; \
fi
#
# run
#
run *ARGS: build
# Pass "$@" as-is via positional-arguments to avoid misparsing queries that include `>`.
./dist/ssh-keyselect{{GO_EXE_SUFFIX}} "$@"
#
# release
#
snapshot: deps gen-windows-icons deps-credits-if-missing
bash scripts/build-windows-msi.sh "$(bash scripts/mygo-version.sh snapshot)"
if [ "$(go env GOHOSTOS)" = darwin ]; then bash scripts/build-mygo-packages.sh macos "$(bash scripts/mygo-version.sh snapshot)"; fi
bash scripts/windows-icon-resources.sh with goreleaser release --skip=publish --clean --snapshot
release: deps gen-windows-icons deps-credits
bash scripts/build-windows-msi.sh "$(bash scripts/mygo-version.sh release)"
if [ "$(go env GOHOSTOS)" = darwin ]; then bash scripts/build-mygo-packages.sh macos "$(bash scripts/mygo-version.sh release)"; fi
bash scripts/windows-icon-resources.sh with goreleaser release --skip=publish --clean --skip=validate