-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjustfile
116 lines (84 loc) · 4.71 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
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
108
109
110
111
112
113
114
115
116
prev_version := "0.2.2"
version := "0.3.0"
tempdir := `mktemp -d`
default: fmt test lint
fmt:
cargo fmt --all --check
nix fmt flake.nix
taplo format
test:
CLICOLOR_FORCE=true cargo test --all-features --workspace
lint:
cargo clippy --all-targets --all-features --workspace -- -D warnings
taplo lint
cov:
CLICOLOR_FORCE=true cargo llvm-cov --open
[linux]
flamegraph target="scripts/benchmarks/data/gitlab":
cargo flamegraph --profile bench --open -- check {{ target }}
[macos]
flamegraph target="scripts/benchmarks/data/gitlab":
# See https://github.com/flamegraph-rs/flamegraph#dtrace-on-macos
cargo flamegraph --root --profile bench --open -- check {{ target }}
fuzz target="linter":
cargo +nightly fuzz run {{ target }}
[private]
download-hash version target:
@echo 'Downloading v{{ version }}/{{ target }}...'
@wget -q -P {{ tempdir }} https://github.com/akiomik/mado/releases/download/v{{ version }}/{{ target }}
@mv {{ tempdir }}/{{ target }} {{ tempdir }}/v{{ version }}-{{ target }}
[private]
update-homebrew-hash target: (download-hash prev_version target) (download-hash version target)
@echo 'Updating pkg/homebrew/mado.rb for {{ target }}...'
@prev_hash=`cut -d ' ' -f 1 {{ tempdir }}/v{{ prev_version }}-{{ target }}` \
&& new_hash=`cut -d ' ' -f 1 {{ tempdir }}/v{{ version }}-{{ target }}` \
&& sed -I '' "s/$prev_hash/$new_hash/" pkg/homebrew/mado.rb
update-homebrew-hash-linux-arm64: (update-homebrew-hash "mado-Linux-gnu-arm64.tar.gz.sha256")
update-homebrew-hash-linux-amd64: (update-homebrew-hash "mado-Linux-gnu-x86_64.tar.gz.sha256")
update-homebrew-hash-macos-arm64: (update-homebrew-hash "mado-macOS-arm64.tar.gz.sha256")
update-homebrew-hash-macos-amd64: (update-homebrew-hash "mado-macOS-x86_64.tar.gz.sha256")
update-homebrew-hash-all: update-homebrew-hash-linux-arm64 update-homebrew-hash-linux-amd64 update-homebrew-hash-macos-arm64 update-homebrew-hash-macos-amd64
update-homebrew: update-homebrew-hash-all
@echo 'Updating pkg/homebrew/mado.rb for {{ version }}...'
@sed -I '' "s/{{ prev_version }}/{{ version }}/" pkg/homebrew/mado.rb
[private]
update-scoop-hash target: (download-hash prev_version target) (download-hash version target)
@echo 'Updating pkg/scoop/mado.json for {{ target }}...'
@prev_hash=`cut -d ' ' -f 1 {{ tempdir }}/v{{ prev_version }}-{{ target }}` \
&& new_hash=`cut -d ' ' -f 1 {{ tempdir }}/v{{ version }}-{{ target }}` \
&& sed -I '' "s/$prev_hash/$new_hash/" pkg/scoop/mado.json
update-scoop-hash-windows-amd64: (update-scoop-hash "mado-Windows-msvc-x86_64.zip.sha256")
update-scoop-hash-all: update-scoop-hash-windows-amd64
update-scoop: update-scoop-hash-all
@echo 'Updating pkg/scoop/mado.json for {{ version }}...'
@sed -I '' "s/{{ prev_version }}/{{ version }}/" pkg/scoop/mado.json
[private]
update-winget-hash target: (download-hash prev_version target) (download-hash version target)
@echo 'Updating pkg/winget/mado.yml for {{ target }}...'
@prev_hash=`cut -d ' ' -f 1 {{ tempdir }}/v{{ prev_version }}-{{ target }}` \
&& new_hash=`cut -d ' ' -f 1 {{ tempdir }}/v{{ version }}-{{ target }}` \
&& sed -I '' "s/$prev_hash/$new_hash/" pkg/winget/mado.yml
update-winget-hash-windows-amd64: (update-winget-hash "mado-Windows-msvc-x86_64.zip.sha256")
update-winget-hash-all: update-winget-hash-windows-amd64
update-winget: update-winget-hash-all
@echo 'Updating pkg/winget/mado.yml for {{ version }}...'
@sed -I '' "s/{{ prev_version }}/{{ version }}/" pkg/winget/mado.yml
[private]
nix-hash version target:
@echo 'Downloading v{{ version }}/{{ target }}...'
@nix-prefetch-url --unpack https://github.com/akiomik/mado/releases/download/v{{ version }}/{{ target }} \
> {{ tempdir }}/v{{ version }}-{{ target }}.sha256
[private]
update-flake-hash target: (nix-hash prev_version target) (nix-hash version target)
@echo 'Updating flake.nix for {{ target }}...'
@prev_hash=`cat {{ tempdir }}/v{{ prev_version }}-{{ target }}.sha256` \
&& new_hash=`cat {{ tempdir }}/v{{ version }}-{{ target }}.sha256` \
&& sed -I '' "s/$prev_hash/$new_hash/" flake.nix
update-flake-hash-linux-arm64: (update-flake-hash "mado-Linux-gnu-arm64.tar.gz")
update-flake-hash-linux-amd64: (update-flake-hash "mado-Linux-gnu-x86_64.tar.gz")
update-flake-hash-macos-arm64: (update-flake-hash "mado-macOS-arm64.tar.gz")
update-flake-hash-macos-amd64: (update-flake-hash "mado-macOS-x86_64.tar.gz")
update-flake-hash-all: update-flake-hash-linux-arm64 update-flake-hash-linux-amd64 update-flake-hash-macos-arm64 update-flake-hash-macos-amd64
update-flake: update-flake-hash-all
@echo 'Updating flake.nix for {{ version }}...'
@sed -I '' "s/{{ prev_version }}/{{ version }}/" flake.nix