set minimum required zig version from build.zig.zon in tests and dockerfile
parent
ea5ea5f98e
commit
402c492d94
|
|
@ -508,9 +508,9 @@ jobs:
|
||||||
- name: Install zig
|
- name: Install zig
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
# Get the zig version from build.zig so that it only needs to be updated
|
# Get the zig version from build.zig.zon so that it only needs to be updated
|
||||||
$fileContent = Get-Content -Path "build.zig" -Raw
|
$fileContent = Get-Content -Path "build.zig.zon" -Raw
|
||||||
$pattern = 'buildpkg\.requireZig\("(.*?)"\);'
|
$pattern = 'minimum_zig_version\s*=\s*"([^"]+)"'
|
||||||
$zigVersion = [regex]::Match($fileContent, $pattern).Groups[1].Value
|
$zigVersion = [regex]::Match($fileContent, $pattern).Groups[1].Value
|
||||||
$version = "zig-x86_64-windows-$zigVersion"
|
$version = "zig-x86_64-windows-$zigVersion"
|
||||||
Write-Output $version
|
Write-Output $version
|
||||||
|
|
@ -575,7 +575,7 @@ jobs:
|
||||||
- name: Get required Zig version
|
- name: Get required Zig version
|
||||||
id: zig
|
id: zig
|
||||||
run: |
|
run: |
|
||||||
echo "version=$(sed -n -e 's/^.*requireZig("\(.*\)").*$/\1/p' build.zig)" >> $GITHUB_OUTPUT
|
echo "version=$(sed -n -E 's/^\s*\.?minimum_zig_version\s*=\s*"([^"]+)".*/\1/p' build.zig.zon)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Setup Cache
|
- name: Setup Cache
|
||||||
uses: namespacelabs/nscloud-cache-action@7baedde84bbf5063413d621f282834bc2654d0c1 # v1.2.18
|
uses: namespacelabs/nscloud-cache-action@7baedde84bbf5063413d621f282834bc2654d0c1 # v1.2.18
|
||||||
|
|
|
||||||
|
|
@ -24,12 +24,12 @@ RUN DEBIAN_FRONTEND="noninteractive" apt-get -qq update && \
|
||||||
|
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
|
|
||||||
COPY ./build.zig /src
|
COPY ./build.zig ./build.zig.zon /src/
|
||||||
|
|
||||||
# Install zig
|
# Install zig
|
||||||
# https://ziglang.org/download/
|
# https://ziglang.org/download/
|
||||||
|
|
||||||
RUN export ZIG_VERSION=$(sed -n -e 's/^.*requireZig("\(.*\)").*$/\1/p' build.zig) && curl -L -o /tmp/zig.tar.xz "https://ziglang.org/download/$ZIG_VERSION/zig-$(uname -m)-linux-$ZIG_VERSION.tar.xz" && \
|
RUN export ZIG_VERSION=$(sed -n -E 's/^\s*\.?minimum_zig_version\s*=\s*"([^"]+)".*/\1/p' build.zig.zon) && curl -L -o /tmp/zig.tar.xz "https://ziglang.org/download/$ZIG_VERSION/zig-$(uname -m)-linux-$ZIG_VERSION.tar.xz" && \
|
||||||
tar -xf /tmp/zig.tar.xz -C /opt && \
|
tar -xf /tmp/zig.tar.xz -C /opt && \
|
||||||
rm /tmp/zig.tar.xz && \
|
rm /tmp/zig.tar.xz && \
|
||||||
ln -s "/opt/zig-$(uname -m)-linux-$ZIG_VERSION/zig" /usr/local/bin/zig
|
ln -s "/opt/zig-$(uname -m)-linux-$ZIG_VERSION/zig" /usr/local/bin/zig
|
||||||
|
|
@ -41,4 +41,3 @@ RUN zig build \
|
||||||
-Dcpu=baseline
|
-Dcpu=baseline
|
||||||
|
|
||||||
RUN ./zig-out/bin/ghostty +version
|
RUN ./zig-out/bin/ghostty +version
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue