tangled
alpha
login
or
join now
altagos.dev
/
website
0
fork
atom
this repo has no description
0
fork
atom
overview
issues
pulls
pipelines
bootstrap mise
altagos.dev
3 months ago
7602b918
05693ea2
verified
This commit was signed with the committer's
known signature
.
altagos.dev
SSH Key Fingerprint:
SHA256:UbTjEcCZlc6GzQWLCuDK3D//HESWD2xFPkzue9XMras=
0/1
build.yml
failed
16s
+348
-74
4 changed files
expand all
collapse all
unified
split
.tangled
workflows
build.yml
bin
mise
zig
.gitignore
download.sh
+9
-7
.tangled/workflows/build.yml
reviewed
···
9
9
nixpkgs:
10
10
- curl
11
11
- dart-sass
12
12
-
- mise
13
12
- zip
14
13
15
14
environment:
16
15
ZIG_VERSION: "0.15.1"
17
16
18
17
steps:
19
19
-
- name: Setup Zig
18
18
+
- name: Setup mise
20
19
command: |
21
21
-
mise trust
22
22
-
mise doctor
23
23
-
mise exec zig -- zig version
24
24
-
MISE_VERBOSE=1 mise exec bun -- bun -v
20
20
+
./bin/mise install
21
21
+
./bin/mise trust
22
22
+
./bin/mise doctor
23
23
+
- name: Setup Zig + Bun
24
24
+
command: |
25
25
+
./bin/mise exec zig -- zig version
26
26
+
./bin/mise exec bun -- bun -v
25
27
- name: Download statichost cli
26
28
command: |
27
29
curl -so shcli https://www.statichost.eu/shcli
28
30
chmod +x shcli
29
31
- name: Build website
30
32
command: |
31
31
-
mise dist
33
33
+
./bin/mise dist
32
34
- name: Upload
33
35
command: |
34
36
./shcli altagos-dev ./zig-out/website
+339
bin/mise
reviewed
···
1
1
+
#!/usr/bin/env bash
2
2
+
set -eu
3
3
+
4
4
+
__mise_bootstrap() {
5
5
+
local script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
6
6
+
local project_dir=$( cd -- "$( dirname -- "$script_dir" )" &> /dev/null && pwd )
7
7
+
export MISE_BOOTSTRAP_PROJECT_DIR="$project_dir"
8
8
+
local localized_dir="$project_dir/.mise"
9
9
+
export MISE_BOOTSTRAP_PROJECT_DIR="$project_dir"
10
10
+
export MISE_DATA_DIR="$localized_dir"
11
11
+
export MISE_CONFIG_DIR="$localized_dir"
12
12
+
export MISE_CACHE_DIR="$localized_dir/cache"
13
13
+
export MISE_STATE_DIR="$localized_dir/state"
14
14
+
export MISE_INSTALL_PATH="$localized_dir/mise-2025.11.11"
15
15
+
export MISE_TRUSTED_CONFIG_PATHS="$project_dir${MISE_TRUSTED_CONFIG_PATHS:+:$MISE_TRUSTED_CONFIG_PATHS}"
16
16
+
export MISE_IGNORED_CONFIG_PATHS="$HOME/.config/mise${MISE_IGNORED_CONFIG_PATHS:+:$MISE_IGNORED_CONFIG_PATHS}"
17
17
+
install() {
18
18
+
#!/bin/sh
19
19
+
set -eu
20
20
+
21
21
+
#region logging setup
22
22
+
if [ "${MISE_DEBUG-}" = "true" ] || [ "${MISE_DEBUG-}" = "1" ]; then
23
23
+
debug() {
24
24
+
echo "$@" >&2
25
25
+
}
26
26
+
else
27
27
+
debug() {
28
28
+
:
29
29
+
}
30
30
+
fi
31
31
+
32
32
+
if [ "${MISE_QUIET-}" = "1" ] || [ "${MISE_QUIET-}" = "true" ]; then
33
33
+
info() {
34
34
+
:
35
35
+
}
36
36
+
else
37
37
+
info() {
38
38
+
echo "$@" >&2
39
39
+
}
40
40
+
fi
41
41
+
42
42
+
error() {
43
43
+
echo "$@" >&2
44
44
+
exit 1
45
45
+
}
46
46
+
#endregion
47
47
+
48
48
+
#region environment setup
49
49
+
get_os() {
50
50
+
os="$(uname -s)"
51
51
+
if [ "$os" = Darwin ]; then
52
52
+
echo "macos"
53
53
+
elif [ "$os" = Linux ]; then
54
54
+
echo "linux"
55
55
+
else
56
56
+
error "unsupported OS: $os"
57
57
+
fi
58
58
+
}
59
59
+
60
60
+
get_arch() {
61
61
+
musl=""
62
62
+
if type ldd >/dev/null 2>/dev/null; then
63
63
+
if [ "${MISE_INSTALL_MUSL-}" = "1" ] || [ "${MISE_INSTALL_MUSL-}" = "true" ]; then
64
64
+
musl="-musl"
65
65
+
elif [ "$(uname -o)" = "Android" ]; then
66
66
+
# Android (Termux) always uses musl
67
67
+
musl="-musl"
68
68
+
else
69
69
+
libc=$(ldd /bin/ls | grep 'musl' | head -1 | cut -d ' ' -f1)
70
70
+
if [ -n "$libc" ]; then
71
71
+
musl="-musl"
72
72
+
fi
73
73
+
fi
74
74
+
fi
75
75
+
arch="$(uname -m)"
76
76
+
if [ "$arch" = x86_64 ]; then
77
77
+
echo "x64$musl"
78
78
+
elif [ "$arch" = aarch64 ] || [ "$arch" = arm64 ]; then
79
79
+
echo "arm64$musl"
80
80
+
elif [ "$arch" = armv7l ]; then
81
81
+
echo "armv7$musl"
82
82
+
else
83
83
+
error "unsupported architecture: $arch"
84
84
+
fi
85
85
+
}
86
86
+
87
87
+
get_ext() {
88
88
+
if [ -n "${MISE_INSTALL_EXT:-}" ]; then
89
89
+
echo "$MISE_INSTALL_EXT"
90
90
+
elif [ -n "${MISE_VERSION:-}" ] && echo "$MISE_VERSION" | grep -q '^v2024'; then
91
91
+
# 2024 versions don't have zstd tarballs
92
92
+
echo "tar.gz"
93
93
+
elif tar_supports_zstd; then
94
94
+
echo "tar.zst"
95
95
+
elif command -v zstd >/dev/null 2>&1; then
96
96
+
echo "tar.zst"
97
97
+
else
98
98
+
echo "tar.gz"
99
99
+
fi
100
100
+
}
101
101
+
102
102
+
tar_supports_zstd() {
103
103
+
# tar is bsdtar or version is >= 1.31
104
104
+
if tar --version | grep -q 'bsdtar' && command -v zstd >/dev/null 2>&1; then
105
105
+
true
106
106
+
elif tar --version | grep -q '1\.(3[1-9]|[4-9][0-9]'; then
107
107
+
true
108
108
+
else
109
109
+
false
110
110
+
fi
111
111
+
}
112
112
+
113
113
+
shasum_bin() {
114
114
+
if command -v shasum >/dev/null 2>&1; then
115
115
+
echo "shasum"
116
116
+
elif command -v sha256sum >/dev/null 2>&1; then
117
117
+
echo "sha256sum"
118
118
+
else
119
119
+
error "mise install requires shasum or sha256sum but neither is installed. Aborting."
120
120
+
fi
121
121
+
}
122
122
+
123
123
+
get_checksum() {
124
124
+
version=$1
125
125
+
os=$2
126
126
+
arch=$3
127
127
+
ext=$4
128
128
+
url="https://github.com/jdx/mise/releases/download/v${version}/SHASUMS256.txt"
129
129
+
130
130
+
# For current version use static checksum otherwise
131
131
+
# use checksum from releases
132
132
+
if [ "$version" = "v2025.11.11" ]; then
133
133
+
checksum_linux_x86_64="f1ba51b26998d5d75fe14c74e16f8a66a13bf2a403f5ca97e3efb1f952ee5bf7 ./mise-v2025.11.11-linux-x64.tar.gz"
134
134
+
checksum_linux_x86_64_musl="b3d0ada98b5319ca9e1095d8761ab10c8854fdd5c7487e85cbb7e6972a69ffea ./mise-v2025.11.11-linux-x64-musl.tar.gz"
135
135
+
checksum_linux_arm64="2d9e3e27da8323d331ed01c0424dfc282856c1124626eb3f1ad79a1588e33763 ./mise-v2025.11.11-linux-arm64.tar.gz"
136
136
+
checksum_linux_arm64_musl="502059f4c449e7a18f4994ceba8c91c27f05364bb80b14c51f19be03a8f267d0 ./mise-v2025.11.11-linux-arm64-musl.tar.gz"
137
137
+
checksum_linux_armv7="2be7aec10ec9a79fcede2b930fcfbf1a5e755900a4861c01ba4a3ceef2d516a8 ./mise-v2025.11.11-linux-armv7.tar.gz"
138
138
+
checksum_linux_armv7_musl="293c94b0cedf2fb53c6fea7f7149e2217d53c0dddb6aea1692c56c6bbcb3159f ./mise-v2025.11.11-linux-armv7-musl.tar.gz"
139
139
+
checksum_macos_x86_64="c64c00028db0bbb73d4a9801a2ecb68f9cf5927c4e53740871e5d7ba8ab0b3c7 ./mise-v2025.11.11-macos-x64.tar.gz"
140
140
+
checksum_macos_arm64="afbf065a2759dcbee8fc56b7afa0324c5f76e09b7bac245284a5f8b8d4bb1d81 ./mise-v2025.11.11-macos-arm64.tar.gz"
141
141
+
checksum_linux_x86_64_zstd="9fefbbef115f9dad3ed3068edd52bcdd27a04d4829a63d4917ddd20c14367c11 ./mise-v2025.11.11-linux-x64.tar.zst"
142
142
+
checksum_linux_x86_64_musl_zstd="59e9267bb388784ff17dbf99104e1d8f03aaafae6e84e4eeb8437ebe683b27a3 ./mise-v2025.11.11-linux-x64-musl.tar.zst"
143
143
+
checksum_linux_arm64_zstd="3d6242e5296292a1aa4d42cfd8631ef12a3cf9f3c7cc5eb39a102896d93e0784 ./mise-v2025.11.11-linux-arm64.tar.zst"
144
144
+
checksum_linux_arm64_musl_zstd="2f4116d30bd99e3eb9b3fe949c02d46d99339d3e573bd824ecd0185a69367275 ./mise-v2025.11.11-linux-arm64-musl.tar.zst"
145
145
+
checksum_linux_armv7_zstd="f00100833cc08aa854b2af77dd559191cc1c7d54a32ff8121170dbc8c965e62b ./mise-v2025.11.11-linux-armv7.tar.zst"
146
146
+
checksum_linux_armv7_musl_zstd="96afb1ccc771b7310f870a1df7699f9601da0fe5083fbb0a0f760ecbe66a697c ./mise-v2025.11.11-linux-armv7-musl.tar.zst"
147
147
+
checksum_macos_x86_64_zstd="f5ffcf4c2263bcdce78ae5344f4ccc4bbf0e93f7619799cac140079a50bbb37a ./mise-v2025.11.11-macos-x64.tar.zst"
148
148
+
checksum_macos_arm64_zstd="c07ca98edb30062879b47e5eb46f31d86b71cbd88f62d3350236178e5a8552a9 ./mise-v2025.11.11-macos-arm64.tar.zst"
149
149
+
150
150
+
# TODO: refactor this, it's a bit messy
151
151
+
if [ "$ext" = "tar.zst" ]; then
152
152
+
if [ "$os" = "linux" ]; then
153
153
+
if [ "$arch" = "x64" ]; then
154
154
+
echo "$checksum_linux_x86_64_zstd"
155
155
+
elif [ "$arch" = "x64-musl" ]; then
156
156
+
echo "$checksum_linux_x86_64_musl_zstd"
157
157
+
elif [ "$arch" = "arm64" ]; then
158
158
+
echo "$checksum_linux_arm64_zstd"
159
159
+
elif [ "$arch" = "arm64-musl" ]; then
160
160
+
echo "$checksum_linux_arm64_musl_zstd"
161
161
+
elif [ "$arch" = "armv7" ]; then
162
162
+
echo "$checksum_linux_armv7_zstd"
163
163
+
elif [ "$arch" = "armv7-musl" ]; then
164
164
+
echo "$checksum_linux_armv7_musl_zstd"
165
165
+
else
166
166
+
warn "no checksum for $os-$arch"
167
167
+
fi
168
168
+
elif [ "$os" = "macos" ]; then
169
169
+
if [ "$arch" = "x64" ]; then
170
170
+
echo "$checksum_macos_x86_64_zstd"
171
171
+
elif [ "$arch" = "arm64" ]; then
172
172
+
echo "$checksum_macos_arm64_zstd"
173
173
+
else
174
174
+
warn "no checksum for $os-$arch"
175
175
+
fi
176
176
+
else
177
177
+
warn "no checksum for $os-$arch"
178
178
+
fi
179
179
+
else
180
180
+
if [ "$os" = "linux" ]; then
181
181
+
if [ "$arch" = "x64" ]; then
182
182
+
echo "$checksum_linux_x86_64"
183
183
+
elif [ "$arch" = "x64-musl" ]; then
184
184
+
echo "$checksum_linux_x86_64_musl"
185
185
+
elif [ "$arch" = "arm64" ]; then
186
186
+
echo "$checksum_linux_arm64"
187
187
+
elif [ "$arch" = "arm64-musl" ]; then
188
188
+
echo "$checksum_linux_arm64_musl"
189
189
+
elif [ "$arch" = "armv7" ]; then
190
190
+
echo "$checksum_linux_armv7"
191
191
+
elif [ "$arch" = "armv7-musl" ]; then
192
192
+
echo "$checksum_linux_armv7_musl"
193
193
+
else
194
194
+
warn "no checksum for $os-$arch"
195
195
+
fi
196
196
+
elif [ "$os" = "macos" ]; then
197
197
+
if [ "$arch" = "x64" ]; then
198
198
+
echo "$checksum_macos_x86_64"
199
199
+
elif [ "$arch" = "arm64" ]; then
200
200
+
echo "$checksum_macos_arm64"
201
201
+
else
202
202
+
warn "no checksum for $os-$arch"
203
203
+
fi
204
204
+
else
205
205
+
warn "no checksum for $os-$arch"
206
206
+
fi
207
207
+
fi
208
208
+
else
209
209
+
if command -v curl >/dev/null 2>&1; then
210
210
+
debug ">" curl -fsSL "$url"
211
211
+
checksums="$(curl --compressed -fsSL "$url")"
212
212
+
else
213
213
+
if command -v wget >/dev/null 2>&1; then
214
214
+
debug ">" wget -qO - "$url"
215
215
+
checksums="$(wget -qO - "$url")"
216
216
+
else
217
217
+
error "mise standalone install specific version requires curl or wget but neither is installed. Aborting."
218
218
+
fi
219
219
+
fi
220
220
+
# TODO: verify with minisign or gpg if available
221
221
+
222
222
+
checksum="$(echo "$checksums" | grep "$os-$arch.$ext")"
223
223
+
if ! echo "$checksum" | grep -Eq "^([0-9a-f]{32}|[0-9a-f]{64})"; then
224
224
+
warn "no checksum for mise $version and $os-$arch"
225
225
+
else
226
226
+
echo "$checksum"
227
227
+
fi
228
228
+
fi
229
229
+
}
230
230
+
231
231
+
#endregion
232
232
+
233
233
+
download_file() {
234
234
+
url="$1"
235
235
+
download_dir="$2"
236
236
+
filename="$(basename "$url")"
237
237
+
file="$download_dir/$filename"
238
238
+
239
239
+
info "mise: installing mise..."
240
240
+
241
241
+
if command -v curl >/dev/null 2>&1; then
242
242
+
debug ">" curl -#fLo "$file" "$url"
243
243
+
curl -#fLo "$file" "$url"
244
244
+
else
245
245
+
if command -v wget >/dev/null 2>&1; then
246
246
+
debug ">" wget -qO "$file" "$url"
247
247
+
stderr=$(mktemp)
248
248
+
wget -O "$file" "$url" >"$stderr" 2>&1 || error "wget failed: $(cat "$stderr")"
249
249
+
rm "$stderr"
250
250
+
else
251
251
+
error "mise standalone install requires curl or wget but neither is installed. Aborting."
252
252
+
fi
253
253
+
fi
254
254
+
255
255
+
echo "$file"
256
256
+
}
257
257
+
258
258
+
install_mise() {
259
259
+
version="${MISE_VERSION:-v2025.11.11}"
260
260
+
version="${version#v}"
261
261
+
os="${MISE_INSTALL_OS:-$(get_os)}"
262
262
+
arch="${MISE_INSTALL_ARCH:-$(get_arch)}"
263
263
+
ext="${MISE_INSTALL_EXT:-$(get_ext)}"
264
264
+
install_path="${MISE_INSTALL_PATH:-$HOME/.local/bin/mise}"
265
265
+
install_dir="$(dirname "$install_path")"
266
266
+
install_from_github="${MISE_INSTALL_FROM_GITHUB:-}"
267
267
+
if [ "$version" != "v2025.11.11" ] || [ "$install_from_github" = "1" ] || [ "$install_from_github" = "true" ]; then
268
268
+
tarball_url="https://github.com/jdx/mise/releases/download/v${version}/mise-v${version}-${os}-${arch}.${ext}"
269
269
+
elif [ -n "${MISE_TARBALL_URL-}" ]; then
270
270
+
tarball_url="$MISE_TARBALL_URL"
271
271
+
else
272
272
+
tarball_url="https://mise.jdx.dev/v${version}/mise-v${version}-${os}-${arch}.${ext}"
273
273
+
fi
274
274
+
275
275
+
download_dir="$(mktemp -d)"
276
276
+
cache_file=$(download_file "$tarball_url" "$download_dir")
277
277
+
debug "mise-setup: tarball=$cache_file"
278
278
+
279
279
+
debug "validating checksum"
280
280
+
cd "$(dirname "$cache_file")" && get_checksum "$version" "$os" "$arch" "$ext" | "$(shasum_bin)" -c >/dev/null
281
281
+
282
282
+
# extract tarball
283
283
+
mkdir -p "$install_dir"
284
284
+
rm -rf "$install_path"
285
285
+
extract_dir="$(mktemp -d)"
286
286
+
cd "$extract_dir"
287
287
+
if [ "$ext" = "tar.zst" ] && ! tar_supports_zstd; then
288
288
+
zstd -d -c "$cache_file" | tar -xf -
289
289
+
else
290
290
+
tar -xf "$cache_file"
291
291
+
fi
292
292
+
mv mise/bin/mise "$install_path"
293
293
+
294
294
+
# cleanup
295
295
+
cd / # Move out of $extract_dir before removing it
296
296
+
rm -rf "$download_dir"
297
297
+
rm -rf "$extract_dir"
298
298
+
299
299
+
info "mise: installed successfully to $install_path"
300
300
+
}
301
301
+
302
302
+
after_finish_help() {
303
303
+
case "${SHELL:-}" in
304
304
+
*/zsh)
305
305
+
info "mise: run the following to activate mise in your shell:"
306
306
+
info "echo \"eval \\\"\\\$($install_path activate zsh)\\\"\" >> \"${ZDOTDIR-$HOME}/.zshrc\""
307
307
+
info ""
308
308
+
info "mise: run \`mise doctor\` to verify this is setup correctly"
309
309
+
;;
310
310
+
*/bash)
311
311
+
info "mise: run the following to activate mise in your shell:"
312
312
+
info "echo \"eval \\\"\\\$($install_path activate bash)\\\"\" >> ~/.bashrc"
313
313
+
info ""
314
314
+
info "mise: run \`mise doctor\` to verify this is setup correctly"
315
315
+
;;
316
316
+
*/fish)
317
317
+
info "mise: run the following to activate mise in your shell:"
318
318
+
info "echo \"$install_path activate fish | source\" >> ~/.config/fish/config.fish"
319
319
+
info ""
320
320
+
info "mise: run \`mise doctor\` to verify this is setup correctly"
321
321
+
;;
322
322
+
*)
323
323
+
info "mise: run \`$install_path --help\` to get started"
324
324
+
;;
325
325
+
esac
326
326
+
}
327
327
+
328
328
+
install_mise
329
329
+
if [ "${MISE_INSTALL_HELP-}" != 0 ]; then
330
330
+
after_finish_help
331
331
+
fi
332
332
+
333
333
+
cd "$MISE_BOOTSTRAP_PROJECT_DIR"
334
334
+
}
335
335
+
local MISE_INSTALL_HELP=0
336
336
+
test -f "$MISE_INSTALL_PATH" || install
337
337
+
}
338
338
+
__mise_bootstrap
339
339
+
exec "$MISE_INSTALL_PATH" "$@"
-3
zig/.gitignore
reviewed
···
1
1
-
*
2
2
-
!download.sh
3
3
-
!.gitignore
-64
zig/download.sh
reviewed
···
1
1
-
#!/usr/bin/env bash
2
2
-
set -e
3
3
-
4
4
-
[ -z "$ZIG_VERSION" ] && ZIG_VERSION="0.15.1"
5
5
-
[ -z "$ZIG_PUBLIC_KEY" ] && ZIG_PUBLIC_KEY="RWSGOq2NVecA2UPNdBUZykf1CCb147pkmdtYxgb3Ti+JO/wCYvhbAb/U"
6
6
-
7
7
-
command -v jq >/dev/null || { echo "jq required"; exit 1; }
8
8
-
command -v minisign >/dev/null || { echo "minisign required"; exit 1; }
9
9
-
10
10
-
# Clean up previous installation
11
11
-
if [ -L "zig/zig" ]; then
12
12
-
prev_dir=$(readlink zig/zig | cut -d '/' -f 2)
13
13
-
[ -d "zig/$prev_dir" ] && rm -rf "zig/$prev_dir"
14
14
-
rm -f "zig/zig"
15
15
-
fi
16
16
-
17
17
-
case "$(uname -s)" in
18
18
-
Linux)
19
19
-
case "$(uname -m)" in
20
20
-
x86_64) p="x86_64-linux" ;;
21
21
-
aarch64) p="aarch64-linux" ;;
22
22
-
armv7l) p="arm-linux" ;;
23
23
-
i686) p="x86-linux" ;;
24
24
-
*) echo "Arch unsupported"; exit 1 ;;
25
25
-
esac
26
26
-
;;
27
27
-
Darwin)
28
28
-
case "$(uname -m)" in
29
29
-
x86_64) p="x86_64-macos" ;;
30
30
-
arm64) p="aarch64-macos" ;;
31
31
-
*) echo "Arch unsupported"; exit 1 ;;
32
32
-
esac
33
33
-
;;
34
34
-
*) echo "OS unsupported"; exit 1 ;;
35
35
-
esac
36
36
-
37
37
-
u=$(curl -s https://ziglang.org/download/index.json | jq -r ".\"$ZIG_VERSION\".\"$p\".tarball")
38
38
-
[ -z "$u" ] && { echo "Version not found"; exit 1; }
39
39
-
40
40
-
f=$(basename "$u")
41
41
-
curl -sfL "$u" -o "zig/$f" || { echo "Download failed"; exit 1; }
42
42
-
curl -sfL "$u.minisig" -o "zig/$f.minisig" || { echo "Sig download failed"; exit 1; }
43
43
-
minisign -Vm "zig/$f" -P "$ZIG_PUBLIC_KEY" || { echo "Sig verification failed"; exit 1; }
44
44
-
45
45
-
# Extract directly to zig folder
46
46
-
if [[ "$f" == *.zip ]]; then
47
47
-
unzip -q "zig/$f" -d zig
48
48
-
else
49
49
-
tar -xJf "zig/$f" --no-same-owner -C zig
50
50
-
fi
51
51
-
52
52
-
# Derive directory name
53
53
-
d=$(echo "$f" | sed -E 's/\.(tar\.xz|tar\.gz|zip|tgz|tar)$//')
54
54
-
55
55
-
# Verify binary exists
56
56
-
[ ! -f "zig/$d/zig" ] && { echo "Binary not found"; exit 1; }
57
57
-
58
58
-
# Create symlink with absolute paths
59
59
-
ln -sf "$(pwd)/zig/$d/zig" "$(pwd)/zig/zig"
60
60
-
61
61
-
# Cleanup
62
62
-
rm -f "zig/$f" "zig/$f.minisig"
63
63
-
64
64
-
echo "Zig installed successfully"