-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRunfile.json
More file actions
138 lines (138 loc) · 3.79 KB
/
Copy pathRunfile.json
File metadata and controls
138 lines (138 loc) · 3.79 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
{
"$schema": "./schemas/v0.schema.json",
"globals": {
"env": {
"CARGO_TARGET_DIR": "target-{{ RUN.os }}"
},
"logging": true
},
"includes": [
{
"namespace": "wsl",
"path": "Runfile-wsl.json"
}
],
"targets": {
"build": {
"description": "Build all crates in debug mode",
"commands": [
"cargo build {{ ARGS }}",
{
"if": "{{ RUN.os == 'windows' }}",
"then": "@wsl:build"
},
"@install"
]
},
"build:release": {
"description": "Build all crates in release mode",
"commands": [
"cargo build --release {{ ARGS }}",
{
"if": "{{ RUN.os == 'windows' }}",
"then": "@wsl:build:release"
}
]
},
"clean": {
"description": "Remove build artifacts",
"commands": [
{
"for": "dir",
"in": [
"",
"-linux",
"-mac",
"-windows"
],
"do": "cargo clean --target-dir target{{ VAR.dir }}"
}
]
},
"install": {
"description": "Copies the built binary to .local/bin as \"rund\"",
"commands": [
{
"if": "{{ RUN.os == 'windows' }}",
"then": [
"{{ define(executable, 'run.exe') }}",
"{{ define(installed, 'rund.exe') }}"
],
"else": [
"{{ define(executable, 'run') }}",
"{{ define(installed, 'rund') }}"
]
},
"cp {{ ENV.CARGO_TARGET_DIR }}/debug/{{ VAR.executable }} ~/.local/bin/{{ VAR.installed }}"
],
"detach": true,
"forceShell": "sh",
"parallel": true
},
"lint": {
"description": "Completely lints (type-checks, formats, runs Clippy) the project",
"commands": [
"cargo check",
"cargo fmt --all",
"cargo clippy --all-targets --all-features -- -D warnings",
{
"if": "{{ RUN.os == 'windows' }}",
"then": "@wsl:lint"
}
]
},
"miri": {
"description": "Run Miri (UB checker) on the pure-logic crates (no FFI / no process spawning)",
"commands": [
"cargo +nightly miri test -p runfile-crypto",
"cargo +nightly miri test -p runfile-parser",
"cargo +nightly miri test -p runfile-env",
"cargo +nightly miri test -p runfile-shell"
]
},
"miri:setup": {
"description": "One-time: install the nightly Miri component and build its sysroot",
"commands": [
"rustup toolchain install nightly --component miri",
"cargo +nightly miri setup"
]
},
"release": {
"description": "Bumps the workspace version (major/minor/patch) in Cargo.toml, refreshes Cargo.lock, tags the commit, then pushes everything so CI runs the release",
"commands": [
"{{ define(part, one_of(ARGS, 'major', 'minor', 'patch')) }}",
"{{ define(cargo, read_file('Cargo.toml')) }}",
"{{ define(cur, regex_capture(VAR.cargo, '(?m)^version = \"([^\"]+)\"', '1')) }}",
{
"match": "{{ VAR.part }}",
"cases": {
"major": "{{ define(new, concat(add(nth(VAR.cur, '.', '0'), '1'), '.0.0')) }}",
"minor": "{{ define(new, concat(nth(VAR.cur, '.', '0'), '.', add(nth(VAR.cur, '.', '1'), '1'), '.0')) }}",
"patch": "{{ define(new, concat(nth(VAR.cur, '.', '0'), '.', nth(VAR.cur, '.', '1'), '.', add(nth(VAR.cur, '.', '2'), '1'))) }}"
}
},
"{{ define(updated, regex_replace(VAR.cargo, '(?m)^version = \"[^\"]+\"', concat('version = \"', VAR.new, '\"'))) }}",
"{{ write_file('Cargo.toml', VAR.updated) }}",
"cargo update --workspace",
"echo 'Bumped: version {{ VAR.cur }} -> {{ VAR.new }}'",
"git commit Cargo.toml Cargo.lock -m {{ shell_quote(concat('bump to ', VAR.new)) }}",
"{{ define(tag, concat('v', VAR.new)) }}",
"echo Tagging {{ VAR.tag }}",
"git tag {{ shell_quote(VAR.tag) }}",
"git push",
"git push --tags"
],
"forceShell": "sh"
},
"test": {
"description": "Run all workspace tests",
"commands": [
"cargo test {{ ARGS }}",
{
"if": "{{ RUN.os == 'windows' }}",
"then": "@wsl:test"
}
]
}
}
}