-
Notifications
You must be signed in to change notification settings - Fork 3
/
justfile
58 lines (45 loc) · 1.24 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
51
52
53
54
55
56
57
58
GIT_DIR := `git rev-parse --show-toplevel`
MAIN := "./cmd/deepl"
BIN_NAME := "deepl"
BIN_DIR := "bin"
DIST_DIR := "dist"
# list available recipes
default:
@just --list
# format code
fmt:
go fmt ./...
# lint code
lint:
golangci-lint run ./...
# vet code
vet:
go vet ./...
# build application
build *args="":
{{GIT_DIR}}/scripts/build.sh -p {{MAIN}} {{args}}
# create binary distribution
dist *args="":
{{GIT_DIR}}/scripts/dist.sh -p {{MAIN}} {{args}}
# create a new release
release *args="": clean
export GITHUB_REPO=deepl-go
{{GIT_DIR}}/scripts/release.sh -p {{MAIN}} {{args}}
changes from="" to="":
#!/bin/sh
source {{GIT_DIR}}/scripts/functions.sh
get_changes {{from}} {{to}}
clean:
@# build artifacts
@echo "rm {{BIN_DIR}}/{{BIN_NAME}}"
@-[ -f {{BIN_DIR}}/{{BIN_NAME}} ] && rm {{BIN_DIR}}/{{BIN_NAME}}
@-[ -d {{BIN_DIR}} ] && rmdir {{BIN_DIR}}
@# distribution archives
@echo "rm {{DIST_DIR}}/{{BIN_NAME}}_*.tar.gz"
@rm {{DIST_DIR}}/{{BIN_NAME}}_*.tar.gz 2>/dev/null || true
@echo "rm {{DIST_DIR}}/{{BIN_NAME}}_*.zip"
@rm {{DIST_DIR}}/{{BIN_NAME}}_*.zip 2>/dev/null || true
@-[ -d {{DIST_DIR}} ] && rmdir {{DIST_DIR}}
# ---
_system-info:
@echo "{{os()}}_{{arch()}}"