dev: add a script to update Zig version used by CI
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
be6d5b8ac9
commit
59e82a6c5c
1 changed files with 20 additions and 0 deletions
20
dev/update-zig.sh
Executable file
20
dev/update-zig.sh
Executable file
|
|
@ -0,0 +1,20 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")"/..
|
||||
|
||||
update_zig() {
|
||||
gsed -i 's|\(https://ziglang.org/builds/zig-[^/ -]*-[^/ -]*-\)[^/ ]*\(\(\.tar\.xz\)[^/ ]*\)|\1'"$1"'\2|' $2
|
||||
gsed -i 's|\(https://ziglang.org/builds/zig-[^/ -]*-[^/ -]*-\)[^/ ]*\(\(\.zip\)[^/ ]*\)|\1'"$1"'\2|' $2
|
||||
}
|
||||
|
||||
if [ -n "${ZIG_VERSION:-}" ]; then
|
||||
version="${ZIG_VERSION:-}"
|
||||
|
||||
sources=$(find . | grep './.github/workflows' | grep -v 'third_party/' | grep -v 'DirectXShaderCompiler' | grep -v '/libs/' | grep '\.yml')
|
||||
echo "$sources" | while read line ; do update_zig "$version" "$line" ; done
|
||||
|
||||
update_zig "$version" README.md
|
||||
else
|
||||
echo "must specify e.g. ZIG_VERSION=0.10.0-dev.2017+a0a2ce92c"
|
||||
exit 0
|
||||
fi
|
||||
Loading…
Add table
Add a link
Reference in a new issue