-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
52 lines (45 loc) · 1.6 KB
/
Copy pathjustfile
File metadata and controls
52 lines (45 loc) · 1.6 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
# List available recipes
default:
@just --list
# Build jinn (repo root)
build:
go build -ldflags "-X main.version=$(git describe --tags --always --dirty 2>/dev/null || echo dev)" -o jinn ./cmd/jinn/
# Resolve GOBIN, falling back to GOPATH/bin when it is unset.
gobin := `gobin="$(go env GOBIN)"; [ -n "$gobin" ] && echo "$gobin" || echo "$(go env GOPATH)/bin"`
# Build and symlink into the configured Go bin directory.
install: build
mkdir -p "{{gobin}}"
ln -sf "$(pwd)/jinn" "{{gobin}}/jinn"
# Run the full test suite with race detector
test:
go test -race ./...
GOWORK=off go -C examples/pi-go-tool-bridge/bin test -race ./...
# Remove the local jinn binary
clean:
rm -f ./jinn
# Print current version (latest git tag, sans v prefix)
version:
@git describe --tags --abbrev=0 2>/dev/null | sed 's/^v//' || echo "0.0.0"
# Tag, push, and create GitHub release. Bump = patch | minor | major | X.Y.Z
release bump:
#!/usr/bin/env bash
set -euo pipefail
CUR=$(just version)
if [[ "{{ bump }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
VER="{{ bump }}"
else
VER=$(echo "$CUR" | awk -F. -v b="{{ bump }}" '{
if(b=="major") print $1+1".0.0"
else if(b=="minor") print $1"."$2+1".0"
else if(b=="patch") print $1"."$2"."$3+1
else { print "bad bump: " b > "/dev/stderr"; exit 1 }
}')
fi
echo "v$CUR → v$VER"
just test
just build
git push origin main
git tag "v$VER"
git push origin "v$VER"
gh release create "v$VER" --repo dotcommander/jinn --title "v$VER" --generate-notes --latest
echo "✓ v$VER live"