Merge pull request #171 from birth-software/change-zig-download-method
Change Zig download method
This commit is contained in:
commit
3c6aaf67d0
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@ -16,7 +16,7 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Build and test
|
||||
run: sh ci/linux_gnu_runner.sh
|
||||
run: ./ci/linux_gnu_runner.sh
|
||||
macos:
|
||||
runs-on: macos-latest
|
||||
timeout-minutes: 15
|
||||
@ -24,4 +24,4 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Build and test
|
||||
run: sh ci/macos_runner.sh
|
||||
run: ./ci/macos_runner.sh
|
||||
|
18
ci/download_zig.sh
Executable file
18
ci/download_zig.sh
Executable file
@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
set -ex
|
||||
|
||||
download_zig()
|
||||
{
|
||||
package_version=$1
|
||||
package_system=$2
|
||||
package_json=$(curl -s https://ziglang.org/download/index.json)
|
||||
package_info=$(jq ".$package_version[\"$package_system\"]" <<< $package_json)
|
||||
package_tarball=$(jq -n "$package_info" | jq --raw-output ".tarball")
|
||||
package_shasum=$(jq -n "$package_info" | jq --raw-output ".shasum")
|
||||
package_size=$(jq -n "$package_info" | jq --raw-output ".size")
|
||||
package_full_version=$(basename ${package_tarball} .tar.xz)
|
||||
destination_dir=$PWD/zig_download
|
||||
mkdir -p $destination_dir
|
||||
curl ${package_tarball} | tar -xJC $destination_dir
|
||||
export PATH="$destination_dir/$package_full_version:$PATH"
|
||||
}
|
10
ci/linux_gnu_runner.sh
Normal file → Executable file
10
ci/linux_gnu_runner.sh
Normal file → Executable file
@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
set -ex
|
||||
|
||||
# Install LLVM and system dependencies
|
||||
@ -8,10 +8,8 @@ sudo ./llvm.sh 17 all
|
||||
sudo apt install liblld-17-dev libclang-17-dev liblld-17 ninja-build cmake -y
|
||||
|
||||
# Install Zig
|
||||
ZIG_VERSION=0.12.0
|
||||
ZIG_PACKAGE_NAME=zig-linux-x86_64-$ZIG_VERSION
|
||||
wget https://ziglang.org/download/$ZIG_VERSION/$ZIG_PACKAGE_NAME.tar.xz
|
||||
tar xf $ZIG_PACKAGE_NAME.tar.xz
|
||||
source ci/download_zig.sh
|
||||
download_zig master x86_64-linux
|
||||
|
||||
# Build and test
|
||||
$ZIG_PACKAGE_NAME/zig build test -Dthird_party_ci=true
|
||||
zig build test -Dthird_party_ci=true
|
||||
|
10
ci/macos_runner.sh
Normal file → Executable file
10
ci/macos_runner.sh
Normal file → Executable file
@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
set -ex
|
||||
|
||||
# Install LLVM and system dependencies
|
||||
@ -6,10 +6,8 @@ brew update
|
||||
brew install llvm@17 ninja
|
||||
|
||||
# Install Zig
|
||||
ZIG_VERSION=0.12.0
|
||||
ZIG_PACKAGE_NAME=zig-macos-aarch64-$ZIG_VERSION
|
||||
wget https://ziglang.org/download/$ZIG_VERSION/$ZIG_PACKAGE_NAME.tar.xz
|
||||
tar xf $ZIG_PACKAGE_NAME.tar.xz
|
||||
source ci/download_zig.sh
|
||||
download_zig master aarch64-macos
|
||||
|
||||
# Build and test
|
||||
$ZIG_PACKAGE_NAME/zig build test -Dthird_party_ci=true
|
||||
zig build test -Dthird_party_ci=true
|
||||
|
Loading…
x
Reference in New Issue
Block a user