-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjustfile
50 lines (38 loc) · 1.18 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
38
39
40
41
42
43
44
45
46
47
48
49
50
set shell := ["bash", "-eu", "-o", "pipefail", "-c"]
build:
#!/usr/bin/env bash
# Determine version
if [ "$(git rev-parse --abbrev-ref HEAD)" = "main" ]; then
version="latest"
elif git describe --tags --exact-match >/dev/null 2>&1; then
version="$(git describe --tags --exact-match)"
else
version="$(git rev-parse --short HEAD)"
fi
echo "Building version: $version"
platforms=("linux" "windows" "darwin")
archs=("amd64" "arm64")
for GOOS in "${platforms[@]}"; do
for GOARCH in "${archs[@]}"; do
output="fgc-${GOOS}-${GOARCH}-${version}"
if [ "$GOOS" = "windows" ]; then
output+=".exe"
fi
echo "Building for $GOOS/$GOARCH: $output"
# Build the binary
env CGO_ENABLED=0 GOOS="$GOOS" GOARCH="$GOARCH" \
go build -ldflags="-s -w" -o "build/$output" .
done
done
lint:
staticcheck ./...
test:
go test ./...
format:
go fmt ./...
docs-dev:
pnpm -C docs docs:dev
docs-build:
pnpm -C docs docs:build
docs-deploy: docs-build
pnpx wrangler pages deploy --project-name fql docs/.vitepress/dist