diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 37a531181b..bd5f785fea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: name: Format & Shader Checks steps: - uses: actions/checkout@v3 - - run: echo "VERSION=$(cat .zigversion)" >> $GITHUB_ENV + - run: echo "VERSION=$(grep -i "minimum_zig_version" build.zig.zon | cut -d'"' -f2)" >> $GITHUB_ENV - uses: mlugg/setup-zig@v2 with: version: ${{ env.VERSION }} @@ -47,7 +47,7 @@ jobs: shell: bash steps: - uses: actions/checkout@v3 - - run: echo "VERSION=$(cat .zigversion)" >> $GITHUB_ENV + - run: echo "VERSION=$(grep -i "minimum_zig_version" build.zig.zon | cut -d'"' -f2)" >> $GITHUB_ENV - uses: mlugg/setup-zig@v2 with: version: ${{ env.VERSION }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 87d066645d..82ff8fa173 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,7 @@ jobs: tag: ${{ github.ref_name }} steps: - uses: actions/checkout@v3 - - run: echo "VERSION=$(cat .zigversion)" >> $GITHUB_ENV + - run: echo "VERSION=$(grep -i "minimum_zig_version" build.zig.zon | cut -d'"' -f2)" >> $GITHUB_ENV - uses: mlugg/setup-zig@v2 with: version: ${{ env.VERSION }} diff --git a/.zigversion b/.zigversion deleted file mode 100644 index d183d4ace0..0000000000 --- a/.zigversion +++ /dev/null @@ -1 +0,0 @@ -0.16.0 \ No newline at end of file diff --git a/build.zig.zon b/build.zig.zon index 90e68ec5a7..38c6f55925 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -1,6 +1,7 @@ .{ .name = .Cubyzig, .fingerprint = 0x782a2e402c0ee887, + .minimum_zig_version = "0.16.0", .version = "0.0.0", .paths = .{""}, .dependencies = .{ diff --git a/scripts/install_compiler_linux.sh b/scripts/install_compiler_linux.sh index ffe641a544..69140d26a9 100755 --- a/scripts/install_compiler_linux.sh +++ b/scripts/install_compiler_linux.sh @@ -6,7 +6,7 @@ fail () { echo "Detecting Zig compiler..." -BASE_VERSION=$(< .zigversion) +BASE_VERSION=$(grep -i "minimum_zig_version" build.zig.zon | cut -d'"' -f2) case "$(uname -s)" in "Darwin") diff --git a/scripts/install_compiler_windows.bat b/scripts/install_compiler_windows.bat index 8b943cd84f..098583755e 100644 --- a/scripts/install_compiler_windows.bat +++ b/scripts/install_compiler_windows.bat @@ -2,7 +2,8 @@ echo Detecting Zig compiler... -set /p baseVersion=<".zigversion" +for /f "tokens=2 delims== " %%A in ('findstr "minimum_zig_version" build.zig.zon') do set "baseVersion=%%A" +set "baseVersion=%baseVersion:~1,-2%" IF "%PROCESSOR_ARCHITECTURE%"=="AMD64" (set arch=x86_64) IF "%PROCESSOR_ARCHITECTURE%"=="IA64" (set arch=x86_64)