From 23f528865aa0b607c4fdeb53440621d41545b411 Mon Sep 17 00:00:00 2001 From: AnemoFlower Date: Mon, 20 Apr 2026 12:57:43 +0800 Subject: [PATCH 1/8] chore: bump actions --- .github/workflows/build.yaml | 196 +++++++++++++++++++++-------------- .github/workflows/gitee.yaml | 2 +- 2 files changed, 122 insertions(+), 76 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index de7dcb84..3fac4a52 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -40,9 +40,7 @@ jobs: name: Build (${{ matrix.target }}) steps: - name: Checkout - uses: actions/checkout@v4 - - name: Install GitHub Artifact Client - uses: lhotari/gh-actions-artifact-client@v2 + uses: actions/checkout@v6 - name: Compute Version run: | if [ -z "${{ github.event.inputs.version }}" ]; then @@ -59,12 +57,11 @@ jobs: -Z build-std-features=default,optimize_for_size env: RUSTFLAGS: -Zunstable-options -Cpanic=immediate-abort - - name: Upload Artifact - run: | - source="terracotta-${TERRACOTTA_VERSION}-${{ matrix.os }}-${{ matrix.arch }}.exe" - cp "target/${{ matrix.target }}/release/terracotta.exe" "$source" - 7z a "$source.zip" "$source" - cat "$source.zip" | gh-actions-artifact-client.js upload -r 90 "$source" + - name: Upload artifact + uses: actions/upload-artifact@v7 + with: + name: terracotta-${TERRACOTTA_VERSION}-${{ matrix.os }}-${{ matrix.arch }}.exe + path: target/${{ matrix.target }}/release/terracotta.exe build-unix: strategy: fail-fast: false @@ -83,9 +80,8 @@ jobs: name: Build (${{ matrix.target }}) steps: - name: Checkout - uses: actions/checkout@v4 - - name: Install GitHub Artifact Client - uses: lhotari/gh-actions-artifact-client@v2 + uses: actions/checkout@v6 + - name: Compute Version run: | if [ -z "${{ github.event.inputs.version }}" ]; then @@ -93,29 +89,56 @@ jobs: else echo "TERRACOTTA_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV fi + - name: Setup Android SDK (Android) if: ${{ matrix.os == 'android' }} - uses: android-actions/setup-android@v3 + uses: android-actions/setup-android@v4 with: cmdline-tools-version: 11076708 packages: 'build-tools;34.0.0 ndk;26.0.10792818 tools platform-tools platforms;android-34 ' + - name: Install cargo-ndk and protobuf-compiler (Android) if: ${{ matrix.os == 'android' }} run: | sudo apt update sudo apt install --yes --no-install-recommends protobuf-compiler libprotobuf-dev cargo install cargo-ndk --force + - name: Install musl libc (linux x86_64 | linux arm64) if: ${{ contains(fromJSON('["x86_64", "arm64"]'), matrix.arch) && matrix.os == 'linux' }} run: | sudo apt update sudo apt install --yes --no-install-recommends build-essential musl-tools musl-dev + - name: Install Zig (linux riscv64 | linux loongarch64) if: ${{ contains(fromJSON('["riscv64", "loongarch64"]'), matrix.arch) && matrix.os == 'linux' }} - uses: mlugg/setup-zig@v2 + run: | + ZIG_VERSION="0.14.0" + + case "${{ runner.arch }}" in + riscv64) + ZIG_KEY="riscv64-linux" + ;; + loongarch64) + ZIG_KEY="loongarch64-linux" + ;; + *) + echo "Unsupported runner.arch: ${{ runner.arch }}" + exit 1 + ;; + esac + + ZIG_URL="https://ziglang.org/download/${ZIG_VERSION}/zig-${ZIG_KEY}-${ZIG_VERSION}.tar.xz" + echo "Downloading Zig from: ${ZIG_URL}" + curl -fsSL "$ZIG_URL" -o zig.tar.xz + tar -xf zig.tar.xz + echo "$PWD/zig-${ZIG_KEY}-${ZIG_VERSION}" >> "$GITHUB_PATH" + zig version + - name: Install cargo-zigbuild (linux riscv64 | linux loongarch64) if: ${{ contains(fromJSON('["riscv64", "loongarch64"]'), matrix.arch) && matrix.os == 'linux' }} run: cargo install cargo-zigbuild --force + - name: Build (linux x86_64 | linux arm64) if: ${{ contains(fromJSON('["x86_64", "arm64"]'), matrix.arch) && matrix.os == 'linux' }} run: | @@ -126,14 +149,16 @@ jobs: -Z build-std-features=default,optimize_for_size env: RUSTFLAGS: -Zunstable-options -Cpanic=immediate-abort + - name: Build (linux riscv64 | linux loongarch64) if: ${{ contains(fromJSON('["riscv64", "loongarch64"]'), matrix.arch) && matrix.os == 'linux' }} run: | rustup target add --toolchain nightly "${{ matrix.target }}" cargo +nightly zigbuild --release --bin terracotta --target "${{ matrix.target }}.${{ matrix.glibc-version }}" + - name: Build (freebsd x86_64) if: ${{ contains(fromJSON('["x86_64"]'), matrix.arch) && matrix.os == 'freebsd' }} - uses: cross-platform-actions/action@v0.30.0 + uses: cross-platform-actions/action@v1.0.0 with: operating_system: freebsd architecture: ${{ matrix.arch }} @@ -147,6 +172,7 @@ jobs: . $HOME/.cargo/env rustup target add --toolchain nightly "${{ matrix.target }}" cargo +nightly build --release --bin terracotta --target "${{ matrix.target }}" + - name: Build (Android) if: ${{ matrix.os == 'android' }} run: | @@ -160,7 +186,8 @@ jobs: -Z build-std-features=default,optimize_for_size env: RUSTFLAGS: -Zunstable-options -Cpanic=unwind - - name: Upload Artifact + + - name: Prepare Artifact run: | if [ "${{ matrix.os }}" = "android" ]; then source="terracotta-${TERRACOTTA_VERSION}-${{ matrix.os }}-${{ matrix.arch }}.so" @@ -172,7 +199,13 @@ jobs: chmod 755 "$source" tar -cf "$source.tar" "$source" - zip -q - "$source.tar" | gh-actions-artifact-client.js upload -r 90 "$source.tar" + echo "ARTIFACT=$source.tar" >> "$GITHUB_ENV" + + - name: Upload Artifact + uses: actions/upload-artifact@v7 + with: + name: ${{ env.ARTIFACT }} + path: ${{ env.ARTIFACT }} build-macos: strategy: fail-fast: false @@ -190,9 +223,8 @@ jobs: name: Build (${{ matrix.target }}) steps: - name: Checkout - uses: actions/checkout@v4 - - name: Install GitHub Artifact Client - uses: lhotari/gh-actions-artifact-client@v2 + uses: actions/checkout@v6 + - name: Compute Version run: | if [ -z "${{ github.event.inputs.version }}" ]; then @@ -200,6 +232,7 @@ jobs: else echo "TERRACOTTA_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV fi + - name: Build run: | rustup target add --toolchain nightly "${{ matrix.target }}" @@ -209,7 +242,8 @@ jobs: -Z build-std-features=default,optimize_for_size env: RUSTFLAGS: -Zunstable-options -Cpanic=immediate-abort - - name: Upload Artifact + + - name: Prepare Artifact run: | source="terracotta-${TERRACOTTA_VERSION}-${{ matrix.os }}-${{ matrix.arch }}" @@ -237,7 +271,14 @@ jobs: --scripts build/macos/scripts \ --component-plist build/macos/terracotta.plist \ "$PKG_OUTPUT" - zip -q - $PKG_OUTPUT | gh-actions-artifact-client.js upload -r 90 "$source.pkg" + echo "ARTIFACT=$PKG_OUTPUT" >> "$GITHUB_ENV" + + - name: Upload artifact + uses: actions/upload-artifact@v7 + with: + name: ${{ env.ARTIFACT }} + path: ${{ env.ARTIFACT }} + assemble-packages: runs-on: ubuntu-latest name: Assemble Artifact @@ -246,8 +287,6 @@ jobs: - build-unix - build-macos steps: - - name: Install GitHub Artifact Client - uses: lhotari/gh-actions-artifact-client@v2 - name: Compute Version run: | if [ -z "${{ github.event.inputs.version }}" ]; then @@ -255,65 +294,72 @@ jobs: else echo "TERRACOTTA_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV fi + + - name: Download Artifacts + uses: actions/download-artifact@v8 + with: + path: artifacts + - name: Assemble Artifacts run: | - artifacts_direct=( - "terracotta-${TERRACOTTA_VERSION}-windows-x86_64.exe" - "terracotta-${TERRACOTTA_VERSION}-windows-arm64.exe" - "terracotta-${TERRACOTTA_VERSION}-macos-x86_64.pkg" - "terracotta-${TERRACOTTA_VERSION}-macos-arm64.pkg" - ) - artifacts_tar=( - "terracotta-${TERRACOTTA_VERSION}-linux-x86_64" - "terracotta-${TERRACOTTA_VERSION}-linux-arm64" - "terracotta-${TERRACOTTA_VERSION}-linux-riscv64" - "terracotta-${TERRACOTTA_VERSION}-linux-loongarch64" - "terracotta-${TERRACOTTA_VERSION}-freebsd-x86_64" - "terracotta-${TERRACOTTA_VERSION}-macos-x86_64" - "terracotta-${TERRACOTTA_VERSION}-macos-arm64" - "terracotta-${TERRACOTTA_VERSION}-android-armv7.so" - "terracotta-${TERRACOTTA_VERSION}-android-arm64v8a.so" - "terracotta-${TERRACOTTA_VERSION}-android-x86.so" - "terracotta-${TERRACOTTA_VERSION}-android-x86_64.so" - ) + find artifacts + # artifacts_direct=( + # "terracotta-${TERRACOTTA_VERSION}-windows-x86_64.exe" + # "terracotta-${TERRACOTTA_VERSION}-windows-arm64.exe" + # "terracotta-${TERRACOTTA_VERSION}-macos-x86_64.pkg" + # "terracotta-${TERRACOTTA_VERSION}-macos-arm64.pkg" + # ) + # artifacts_tar=( + # "terracotta-${TERRACOTTA_VERSION}-linux-x86_64" + # "terracotta-${TERRACOTTA_VERSION}-linux-arm64" + # "terracotta-${TERRACOTTA_VERSION}-linux-riscv64" + # "terracotta-${TERRACOTTA_VERSION}-linux-loongarch64" + # "terracotta-${TERRACOTTA_VERSION}-freebsd-x86_64" + # "terracotta-${TERRACOTTA_VERSION}-macos-x86_64" + # "terracotta-${TERRACOTTA_VERSION}-macos-arm64" + # "terracotta-${TERRACOTTA_VERSION}-android-armv7.so" + # "terracotta-${TERRACOTTA_VERSION}-android-arm64v8a.so" + # "terracotta-${TERRACOTTA_VERSION}-android-x86.so" + # "terracotta-${TERRACOTTA_VERSION}-android-x86_64.so" + # ) - file=$(mktemp -t XXXXXX.zip) - for artifact in "${artifacts_direct[@]}"; do - gh-actions-artifact-client.js download "$artifact" > "$file" - unzip -p "$file" > "$artifact" - done - for artifact in "${artifacts_tar[@]}"; do - gh-actions-artifact-client.js download "$artifact.tar" > "$file" - unzip -p "$file" | tar -xOf - > "$artifact" - done - rm "$file" + # file=$(mktemp -t XXXXXX.zip) + # for artifact in "${artifacts_direct[@]}"; do + # gh-actions-artifact-client.js download "$artifact" > "$file" + # unzip -p "$file" > "$artifact" + # done + # for artifact in "${artifacts_tar[@]}"; do + # gh-actions-artifact-client.js download "$artifact.tar" > "$file" + # unzip -p "$file" | tar -xOf - > "$artifact" + # done + # rm "$file" - chmod 755 terracotta-${TERRACOTTA_VERSION}-* - 7z -m0=LZMA2 -mx=9 -ms=on a terracotta.7z terracotta-${TERRACOTTA_VERSION}-* - zip -r - terracotta.7z | gh-actions-artifact-client.js upload -r 90 "terracotta-${TERRACOTTA_VERSION}-all.7z" + # chmod 755 terracotta-${TERRACOTTA_VERSION}-* + # 7z -m0=LZMA2 -mx=9 -ms=on a terracotta.7z terracotta-${TERRACOTTA_VERSION}-* + # zip -r - terracotta.7z | gh-actions-artifact-client.js upload -r 90 "terracotta-${TERRACOTTA_VERSION}-all.7z" - if [ ! -z "${{ github.event.inputs.version }}" ]; then - mkdir -p bundle + # if [ ! -z "${{ github.event.inputs.version }}" ]; then + # mkdir -p bundle - curl -L -o VCRUNTIME140.DLL "https://github.com/burningtnt/Terracotta/raw/refs/heads/binaries/windows_x86_64/vcruntime140.dll" - tar -czvf bundle/terracotta-${TERRACOTTA_VERSION}-windows-x86_64-pkg.tar.gz terracotta-${TERRACOTTA_VERSION}-windows-x86_64.exe VCRUNTIME140.DLL - curl -L -o VCRUNTIME140.DLL "https://github.com/burningtnt/Terracotta/raw/refs/heads/binaries/windows_arm64/vcruntime140.dll" - tar -czvf bundle/terracotta-${TERRACOTTA_VERSION}-windows-arm64-pkg.tar.gz terracotta-${TERRACOTTA_VERSION}-windows-arm64.exe VCRUNTIME140.DLL - tar -czvf bundle/terracotta-${TERRACOTTA_VERSION}-linux-x86_64-pkg.tar.gz terracotta-${TERRACOTTA_VERSION}-linux-x86_64 - tar -czvf bundle/terracotta-${TERRACOTTA_VERSION}-linux-arm64-pkg.tar.gz terracotta-${TERRACOTTA_VERSION}-linux-arm64 - tar -czvf bundle/terracotta-${TERRACOTTA_VERSION}-linux-riscv64-pkg.tar.gz terracotta-${TERRACOTTA_VERSION}-linux-riscv64 - tar -czvf bundle/terracotta-${TERRACOTTA_VERSION}-linux-loongarch64-pkg.tar.gz terracotta-${TERRACOTTA_VERSION}-linux-loongarch64 - tar -czvf bundle/terracotta-${TERRACOTTA_VERSION}-freebsd-x86_64-pkg.tar.gz terracotta-${TERRACOTTA_VERSION}-freebsd-x86_64 + # curl -L -o VCRUNTIME140.DLL "https://github.com/burningtnt/Terracotta/raw/refs/heads/binaries/windows_x86_64/vcruntime140.dll" + # tar -czvf bundle/terracotta-${TERRACOTTA_VERSION}-windows-x86_64-pkg.tar.gz terracotta-${TERRACOTTA_VERSION}-windows-x86_64.exe VCRUNTIME140.DLL + # curl -L -o VCRUNTIME140.DLL "https://github.com/burningtnt/Terracotta/raw/refs/heads/binaries/windows_arm64/vcruntime140.dll" + # tar -czvf bundle/terracotta-${TERRACOTTA_VERSION}-windows-arm64-pkg.tar.gz terracotta-${TERRACOTTA_VERSION}-windows-arm64.exe VCRUNTIME140.DLL + # tar -czvf bundle/terracotta-${TERRACOTTA_VERSION}-linux-x86_64-pkg.tar.gz terracotta-${TERRACOTTA_VERSION}-linux-x86_64 + # tar -czvf bundle/terracotta-${TERRACOTTA_VERSION}-linux-arm64-pkg.tar.gz terracotta-${TERRACOTTA_VERSION}-linux-arm64 + # tar -czvf bundle/terracotta-${TERRACOTTA_VERSION}-linux-riscv64-pkg.tar.gz terracotta-${TERRACOTTA_VERSION}-linux-riscv64 + # tar -czvf bundle/terracotta-${TERRACOTTA_VERSION}-linux-loongarch64-pkg.tar.gz terracotta-${TERRACOTTA_VERSION}-linux-loongarch64 + # tar -czvf bundle/terracotta-${TERRACOTTA_VERSION}-freebsd-x86_64-pkg.tar.gz terracotta-${TERRACOTTA_VERSION}-freebsd-x86_64 - tar -czvf bundle/terracotta-${TERRACOTTA_VERSION}-macos-x86_64-pkg.tar.gz terracotta-${TERRACOTTA_VERSION}-macos-x86_64 terracotta-${TERRACOTTA_VERSION}-macos-x86_64.pkg - tar -czvf bundle/terracotta-${TERRACOTTA_VERSION}-macos-arm64-pkg.tar.gz terracotta-${TERRACOTTA_VERSION}-macos-arm64 terracotta-${TERRACOTTA_VERSION}-macos-arm64.pkg + # tar -czvf bundle/terracotta-${TERRACOTTA_VERSION}-macos-x86_64-pkg.tar.gz terracotta-${TERRACOTTA_VERSION}-macos-x86_64 terracotta-${TERRACOTTA_VERSION}-macos-x86_64.pkg + # tar -czvf bundle/terracotta-${TERRACOTTA_VERSION}-macos-arm64-pkg.tar.gz terracotta-${TERRACOTTA_VERSION}-macos-arm64 terracotta-${TERRACOTTA_VERSION}-macos-arm64.pkg - cp terracotta-${TERRACOTTA_VERSION}-android-armv7.so bundle/terracotta-${TERRACOTTA_VERSION}-android-armv7.so - cp terracotta-${TERRACOTTA_VERSION}-android-arm64v8a.so bundle/terracotta-${TERRACOTTA_VERSION}-android-arm64v8a.so - cp terracotta-${TERRACOTTA_VERSION}-android-x86.so bundle/terracotta-${TERRACOTTA_VERSION}-android-x86.so - cp terracotta-${TERRACOTTA_VERSION}-android-x86_64.so bundle/terracotta-${TERRACOTTA_VERSION}-android-x86_64.so + # cp terracotta-${TERRACOTTA_VERSION}-android-armv7.so bundle/terracotta-${TERRACOTTA_VERSION}-android-armv7.so + # cp terracotta-${TERRACOTTA_VERSION}-android-arm64v8a.so bundle/terracotta-${TERRACOTTA_VERSION}-android-arm64v8a.so + # cp terracotta-${TERRACOTTA_VERSION}-android-x86.so bundle/terracotta-${TERRACOTTA_VERSION}-android-x86.so + # cp terracotta-${TERRACOTTA_VERSION}-android-x86_64.so bundle/terracotta-${TERRACOTTA_VERSION}-android-x86_64.so - gh release create v"${{ github.event.inputs.version }}" -R "${{ github.repository }}" --draft --generate-notes bundle/terracotta-${TERRACOTTA_VERSION}-* - fi + # gh release create v"${{ github.event.inputs.version }}" -R "${{ github.repository }}" --draft --generate-notes bundle/terracotta-${TERRACOTTA_VERSION}-* + # fi env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/gitee.yaml b/.github/workflows/gitee.yaml index 0d619587..8a0cf9ea 100644 --- a/.github/workflows/gitee.yaml +++ b/.github/workflows/gitee.yaml @@ -46,7 +46,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Install NPM Dependencies run: npm install --no-save got form-data chunk-data - name: Publish Releases to Mirrors From 3263374f82a023bc96654f62ded9d1a3f14c2202 Mon Sep 17 00:00:00 2001 From: AnemoFlower Date: Mon, 20 Apr 2026 13:11:05 +0800 Subject: [PATCH 2/8] fix --- .github/workflows/build.yaml | 42 +++++++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 3fac4a52..345c2412 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -41,6 +41,7 @@ jobs: steps: - name: Checkout uses: actions/checkout@v6 + - name: Compute Version run: | if [ -z "${{ github.event.inputs.version }}" ]; then @@ -48,6 +49,7 @@ jobs: else echo "TERRACOTTA_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV fi + - name: Build run: | rustup target add --toolchain nightly "${{ matrix.target }}" @@ -57,11 +59,21 @@ jobs: -Z build-std-features=default,optimize_for_size env: RUSTFLAGS: -Zunstable-options -Cpanic=immediate-abort - - name: Upload artifact + + - name: Prepare Artifact + run: | + source="terracotta-${TERRACOTTA_VERSION}-${{ matrix.os }}-${{ matrix.arch }}.exe" + cp "target/${{ matrix.target }}/release/terracotta.exe" "$source" + 7z a "$source.zip" "$source" + echo "ARTIFACT=$source" >> "$GITHUB_ENV" + + - name: Upload Artifact uses: actions/upload-artifact@v7 with: - name: terracotta-${TERRACOTTA_VERSION}-${{ matrix.os }}-${{ matrix.arch }}.exe - path: target/${{ matrix.target }}/release/terracotta.exe + name: ${{ env.ARTIFACT }} + path: ${{ env.ARTIFACT }}.zip + archive: false + build-unix: strategy: fail-fast: false @@ -116,11 +128,11 @@ jobs: ZIG_VERSION="0.14.0" case "${{ runner.arch }}" in - riscv64) - ZIG_KEY="riscv64-linux" + X64) + ZIG_KEY="linux-x86_64" ;; - loongarch64) - ZIG_KEY="loongarch64-linux" + ARM64) + ZIG_KEY="linux-aarch64" ;; *) echo "Unsupported runner.arch: ${{ runner.arch }}" @@ -250,7 +262,7 @@ jobs: cp "target/${{ matrix.target }}/release/terracotta" "$source" chmod 755 "$source" tar -cf "$source.tar" "$source" - zip -q - "$source.tar" | gh-actions-artifact-client.js upload -r 90 "$source.tar" + echo "TAR_ARTIFACT=$source.tar" >> "$GITHUB_ENV" chmod -R 755 build/macos/scripts TEMP_DIR=$(mktemp -d) @@ -271,13 +283,19 @@ jobs: --scripts build/macos/scripts \ --component-plist build/macos/terracotta.plist \ "$PKG_OUTPUT" - echo "ARTIFACT=$PKG_OUTPUT" >> "$GITHUB_ENV" + echo "PKG_ARTIFACT=$PKG_OUTPUT" >> "$GITHUB_ENV" - - name: Upload artifact + - name: Upload TAR Artifact uses: actions/upload-artifact@v7 with: - name: ${{ env.ARTIFACT }} - path: ${{ env.ARTIFACT }} + name: ${{ env.TAR_ARTIFACT }} + path: ${{ env.TAR_ARTIFACT }} + + - name: Upload PKG Artifact + uses: actions/upload-artifact@v7 + with: + name: ${{ env.PKG_ARTIFACT }} + path: ${{ env.PKG_ARTIFACT }} assemble-packages: runs-on: ubuntu-latest From 87f2083dc5e977877a255689c14099a009983aa6 Mon Sep 17 00:00:00 2001 From: AnemoFlower Date: Mon, 20 Apr 2026 13:20:53 +0800 Subject: [PATCH 3/8] fix --- .github/workflows/build.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 345c2412..e6e2f484 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -64,15 +64,13 @@ jobs: run: | source="terracotta-${TERRACOTTA_VERSION}-${{ matrix.os }}-${{ matrix.arch }}.exe" cp "target/${{ matrix.target }}/release/terracotta.exe" "$source" - 7z a "$source.zip" "$source" echo "ARTIFACT=$source" >> "$GITHUB_ENV" - name: Upload Artifact uses: actions/upload-artifact@v7 with: name: ${{ env.ARTIFACT }} - path: ${{ env.ARTIFACT }}.zip - archive: false + path: ${{ env.ARTIFACT }} build-unix: strategy: @@ -145,6 +143,8 @@ jobs: curl -fsSL "$ZIG_URL" -o zig.tar.xz tar -xf zig.tar.xz echo "$PWD/zig-${ZIG_KEY}-${ZIG_VERSION}" >> "$GITHUB_PATH" + export PATH="$PWD/zig-${ZIG_KEY}-${ZIG_VERSION}:$PATH" + which zig zig version - name: Install cargo-zigbuild (linux riscv64 | linux loongarch64) From 6d3134e5a386c9f3de2b87cf3fafe14aaea84e9d Mon Sep 17 00:00:00 2001 From: AnemoFlower Date: Mon, 20 Apr 2026 14:01:55 +0800 Subject: [PATCH 4/8] fix: Assemble Artifacts --- .DS_Store | Bin 0 -> 8196 bytes .github/workflows/build.yaml | 98 ++++++++++++++++------------------- flatten_artifacts/file1 | 0 flatten_artifacts/file2 | 0 flatten_artifacts/file3 | 0 temp.bash | 16 ++++++ 6 files changed, 61 insertions(+), 53 deletions(-) create mode 100644 .DS_Store create mode 100644 flatten_artifacts/file1 create mode 100644 flatten_artifacts/file2 create mode 100644 flatten_artifacts/file3 create mode 100755 temp.bash diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..da6e0d1bca751ac853de090f778872f867890b6d GIT binary patch literal 8196 zcmeHMTWl0n7(U;$r89J(1GKVW2R1E4z!pk@wB?d)Z%Vlp*_K`?EVDZ!9hlCPo!Ko| zY8n$?Kr}vSyak`U5P48h;)^DVqK}Fu7~=y*Iejf-F~*ok)u&1sHMc3g+^Yye_0f-jU za8RgEc|c$j4{0K#6PyO7G$+p<5Sk)PF~H499{1IWCPF&FDK}@}<_zJ=2s0D}tCL+k zP-jSR8nuxJA`eXUfSzkpCwTr#V)R4Oei-JcwCMw6cA<=j>+yU*vk9mh%+`dWIgX^f_niZ;jgG}AV+ zfq|(Tq%zoR+PX8^>f~(Q4Q!KKAW5Q>QetCc>(@2Z#@9ACkJrY>nj7kCXYG zvS!VuJ*gwsu49l^eF*lrk@)S(%)rc}9z6CC!Hn z8Y_1*S;w+=JFe+Z)8FSA$2?y)MbtOoI$5tRm@K6zIoH@@&|GHTXr~$7K9iR84J#&( z$UBhE&0V;3*^0V`#?6V2&YcfjE?4HwUm#b?1LRfPGaodKY`^Aa3|lwtLp`IW?hWW09Lvy{Z5ySSkbcxIEBiVpE zq-Bk+QG#Q*qir-AJW?9>jXHGGa{?iGV^_7R_WRSd=z4I5#j!=@YEtbHl}|-_M5diL zDFo=T@<&-ep>;+jw*EEHnGBB5HS73zf5 zLZi?mY!o&LyM!*GPtb(Jf+LLZ{R@S#+aI1MB*Jm(Oc!?Hl_H$Geb`mqzqNClyyHI; zc30*GfmTs@*TVSnRcqEaZE2YVBu8)ov^R!Afd8AKCcuAyk6W;NIfzJk$4U!^qEu308h;3y>_yJ97=+m%_It*TosQjjV_z{*t(>m&+Ar6^?U8i@sG z;XQ z=)nP`a1d$e7={f8M+x&MFph^Yfkz1Oj}hjdz>|0e&*C}4{Y!Wmuiz|RBhdBJ}@=pKd|)&YKa9-=;%!KAE*G$38^zLNwfLI%8ZBUn%D2{~go+{y$^; zi57}H5P4wcJ%Hl&WP2;EJKcTc=h|_q2dVnS*PGxpFrmg*@yCO7oap2qhSZOTvP4KH ZI3)>{8UG>R-~QSiz5k>4{~hrD{~Pv&r%wO? literal 0 HcmV?d00001 diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index e6e2f484..8181354c 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -320,64 +320,56 @@ jobs: - name: Assemble Artifacts run: | - find artifacts - # artifacts_direct=( - # "terracotta-${TERRACOTTA_VERSION}-windows-x86_64.exe" - # "terracotta-${TERRACOTTA_VERSION}-windows-arm64.exe" - # "terracotta-${TERRACOTTA_VERSION}-macos-x86_64.pkg" - # "terracotta-${TERRACOTTA_VERSION}-macos-arm64.pkg" - # ) - # artifacts_tar=( - # "terracotta-${TERRACOTTA_VERSION}-linux-x86_64" - # "terracotta-${TERRACOTTA_VERSION}-linux-arm64" - # "terracotta-${TERRACOTTA_VERSION}-linux-riscv64" - # "terracotta-${TERRACOTTA_VERSION}-linux-loongarch64" - # "terracotta-${TERRACOTTA_VERSION}-freebsd-x86_64" - # "terracotta-${TERRACOTTA_VERSION}-macos-x86_64" - # "terracotta-${TERRACOTTA_VERSION}-macos-arm64" - # "terracotta-${TERRACOTTA_VERSION}-android-armv7.so" - # "terracotta-${TERRACOTTA_VERSION}-android-arm64v8a.so" - # "terracotta-${TERRACOTTA_VERSION}-android-x86.so" - # "terracotta-${TERRACOTTA_VERSION}-android-x86_64.so" - # ) - - # file=$(mktemp -t XXXXXX.zip) - # for artifact in "${artifacts_direct[@]}"; do - # gh-actions-artifact-client.js download "$artifact" > "$file" - # unzip -p "$file" > "$artifact" - # done - # for artifact in "${artifacts_tar[@]}"; do - # gh-actions-artifact-client.js download "$artifact.tar" > "$file" - # unzip -p "$file" | tar -xOf - > "$artifact" - # done - # rm "$file" + shopt -s nullglob + for dir in artifacts/*/; do + file="$(find "$dir" -maxdepth 1 -type f | head -n 1)" + if [ -n "$file" ]; then + name="$(basename "$dir")" + + if [[ "$name" == *.tar ]]; then + tar -xOf "$file" > "${name%.tar}" + else + mv "$file" "$name" + fi + fi + done + rm -r artifacts - # chmod 755 terracotta-${TERRACOTTA_VERSION}-* - # 7z -m0=LZMA2 -mx=9 -ms=on a terracotta.7z terracotta-${TERRACOTTA_VERSION}-* - # zip -r - terracotta.7z | gh-actions-artifact-client.js upload -r 90 "terracotta-${TERRACOTTA_VERSION}-all.7z" + chmod 755 ./terracotta-${TERRACOTTA_VERSION}-* + + 7z -m0=LZMA2 -mx=9 -ms=on a terracotta-${TERRACOTTA_VERSION}-all.7z terracotta-${TERRACOTTA_VERSION}-* + echo "ARTIFACT=terracotta-${TERRACOTTA_VERSION}-all.7z" >> $GITHUB_ENV - # if [ ! -z "${{ github.event.inputs.version }}" ]; then - # mkdir -p bundle + if [ ! -z "${{ github.event.inputs.version }}" ]; then + mkdir -p bundle - # curl -L -o VCRUNTIME140.DLL "https://github.com/burningtnt/Terracotta/raw/refs/heads/binaries/windows_x86_64/vcruntime140.dll" - # tar -czvf bundle/terracotta-${TERRACOTTA_VERSION}-windows-x86_64-pkg.tar.gz terracotta-${TERRACOTTA_VERSION}-windows-x86_64.exe VCRUNTIME140.DLL - # curl -L -o VCRUNTIME140.DLL "https://github.com/burningtnt/Terracotta/raw/refs/heads/binaries/windows_arm64/vcruntime140.dll" - # tar -czvf bundle/terracotta-${TERRACOTTA_VERSION}-windows-arm64-pkg.tar.gz terracotta-${TERRACOTTA_VERSION}-windows-arm64.exe VCRUNTIME140.DLL - # tar -czvf bundle/terracotta-${TERRACOTTA_VERSION}-linux-x86_64-pkg.tar.gz terracotta-${TERRACOTTA_VERSION}-linux-x86_64 - # tar -czvf bundle/terracotta-${TERRACOTTA_VERSION}-linux-arm64-pkg.tar.gz terracotta-${TERRACOTTA_VERSION}-linux-arm64 - # tar -czvf bundle/terracotta-${TERRACOTTA_VERSION}-linux-riscv64-pkg.tar.gz terracotta-${TERRACOTTA_VERSION}-linux-riscv64 - # tar -czvf bundle/terracotta-${TERRACOTTA_VERSION}-linux-loongarch64-pkg.tar.gz terracotta-${TERRACOTTA_VERSION}-linux-loongarch64 - # tar -czvf bundle/terracotta-${TERRACOTTA_VERSION}-freebsd-x86_64-pkg.tar.gz terracotta-${TERRACOTTA_VERSION}-freebsd-x86_64 + curl -L -o VCRUNTIME140.DLL "https://github.com/burningtnt/Terracotta/raw/refs/heads/binaries/windows_x86_64/vcruntime140.dll" + tar -czvf bundle/terracotta-${TERRACOTTA_VERSION}-windows-x86_64-pkg.tar.gz terracotta-${TERRACOTTA_VERSION}-windows-x86_64.exe VCRUNTIME140.DLL + curl -L -o VCRUNTIME140.DLL "https://github.com/burningtnt/Terracotta/raw/refs/heads/binaries/windows_arm64/vcruntime140.dll" + tar -czvf bundle/terracotta-${TERRACOTTA_VERSION}-windows-arm64-pkg.tar.gz terracotta-${TERRACOTTA_VERSION}-windows-arm64.exe VCRUNTIME140.DLL + tar -czvf bundle/terracotta-${TERRACOTTA_VERSION}-linux-x86_64-pkg.tar.gz terracotta-${TERRACOTTA_VERSION}-linux-x86_64 + tar -czvf bundle/terracotta-${TERRACOTTA_VERSION}-linux-arm64-pkg.tar.gz terracotta-${TERRACOTTA_VERSION}-linux-arm64 + tar -czvf bundle/terracotta-${TERRACOTTA_VERSION}-linux-riscv64-pkg.tar.gz terracotta-${TERRACOTTA_VERSION}-linux-riscv64 + tar -czvf bundle/terracotta-${TERRACOTTA_VERSION}-linux-loongarch64-pkg.tar.gz terracotta-${TERRACOTTA_VERSION}-linux-loongarch64 + tar -czvf bundle/terracotta-${TERRACOTTA_VERSION}-freebsd-x86_64-pkg.tar.gz terracotta-${TERRACOTTA_VERSION}-freebsd-x86_64 - # tar -czvf bundle/terracotta-${TERRACOTTA_VERSION}-macos-x86_64-pkg.tar.gz terracotta-${TERRACOTTA_VERSION}-macos-x86_64 terracotta-${TERRACOTTA_VERSION}-macos-x86_64.pkg - # tar -czvf bundle/terracotta-${TERRACOTTA_VERSION}-macos-arm64-pkg.tar.gz terracotta-${TERRACOTTA_VERSION}-macos-arm64 terracotta-${TERRACOTTA_VERSION}-macos-arm64.pkg + tar -czvf bundle/terracotta-${TERRACOTTA_VERSION}-macos-x86_64-pkg.tar.gz terracotta-${TERRACOTTA_VERSION}-macos-x86_64 terracotta-${TERRACOTTA_VERSION}-macos-x86_64.pkg + tar -czvf bundle/terracotta-${TERRACOTTA_VERSION}-macos-arm64-pkg.tar.gz terracotta-${TERRACOTTA_VERSION}-macos-arm64 terracotta-${TERRACOTTA_VERSION}-macos-arm64.pkg - # cp terracotta-${TERRACOTTA_VERSION}-android-armv7.so bundle/terracotta-${TERRACOTTA_VERSION}-android-armv7.so - # cp terracotta-${TERRACOTTA_VERSION}-android-arm64v8a.so bundle/terracotta-${TERRACOTTA_VERSION}-android-arm64v8a.so - # cp terracotta-${TERRACOTTA_VERSION}-android-x86.so bundle/terracotta-${TERRACOTTA_VERSION}-android-x86.so - # cp terracotta-${TERRACOTTA_VERSION}-android-x86_64.so bundle/terracotta-${TERRACOTTA_VERSION}-android-x86_64.so + cp terracotta-${TERRACOTTA_VERSION}-android-armv7.so bundle/terracotta-${TERRACOTTA_VERSION}-android-armv7.so + cp terracotta-${TERRACOTTA_VERSION}-android-arm64v8a.so bundle/terracotta-${TERRACOTTA_VERSION}-android-arm64v8a.so + cp terracotta-${TERRACOTTA_VERSION}-android-x86.so bundle/terracotta-${TERRACOTTA_VERSION}-android-x86.so + cp terracotta-${TERRACOTTA_VERSION}-android-x86_64.so bundle/terracotta-${TERRACOTTA_VERSION}-android-x86_64.so - # gh release create v"${{ github.event.inputs.version }}" -R "${{ github.repository }}" --draft --generate-notes bundle/terracotta-${TERRACOTTA_VERSION}-* - # fi + gh release create v"${{ github.event.inputs.version }}" -R "${{ github.repository }}" --draft --generate-notes bundle/terracotta-${TERRACOTTA_VERSION}-* + fi env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload Artifact + uses: actions/upload-artifact@v7 + with: + name: ${{ env.ARTIFACT }} + path: ${{ env.ARTIFACT }} + retention-days: 90 + archive: false diff --git a/flatten_artifacts/file1 b/flatten_artifacts/file1 new file mode 100644 index 00000000..e69de29b diff --git a/flatten_artifacts/file2 b/flatten_artifacts/file2 new file mode 100644 index 00000000..e69de29b diff --git a/flatten_artifacts/file3 b/flatten_artifacts/file3 new file mode 100644 index 00000000..e69de29b diff --git a/temp.bash b/temp.bash new file mode 100755 index 00000000..9899ba5f --- /dev/null +++ b/temp.bash @@ -0,0 +1,16 @@ +#!/bin/bash + +shopt -s nullglob +mkdir -p flatten_artifacts +for dir in artifacts/*/; do + file="$(find "$dir" -maxdepth 1 -type f | head -n 1)" + if [ -n "$file" ]; then + name="$(basename "$dir")" + + if [[ "$name" == *.tar ]]; then + tar -xOf "$file" > "flatten_artifacts/${name%.tar}" + else + mv "$file" "flatten_artifacts/$name" + fi + fi +done \ No newline at end of file From b8f98b7090767b318b7b9d8803a9219ce004c546 Mon Sep 17 00:00:00 2001 From: AnemoFlower Date: Mon, 20 Apr 2026 14:18:10 +0800 Subject: [PATCH 5/8] chore: remove temp files --- .DS_Store | Bin 8196 -> 0 bytes flatten_artifacts/file1 | 0 flatten_artifacts/file2 | 0 flatten_artifacts/file3 | 0 temp.bash | 16 ---------------- 5 files changed, 16 deletions(-) delete mode 100644 .DS_Store delete mode 100644 flatten_artifacts/file1 delete mode 100644 flatten_artifacts/file2 delete mode 100644 flatten_artifacts/file3 delete mode 100755 temp.bash diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index da6e0d1bca751ac853de090f778872f867890b6d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8196 zcmeHMTWl0n7(U;$r89J(1GKVW2R1E4z!pk@wB?d)Z%Vlp*_K`?EVDZ!9hlCPo!Ko| zY8n$?Kr}vSyak`U5P48h;)^DVqK}Fu7~=y*Iejf-F~*ok)u&1sHMc3g+^Yye_0f-jU za8RgEc|c$j4{0K#6PyO7G$+p<5Sk)PF~H499{1IWCPF&FDK}@}<_zJ=2s0D}tCL+k zP-jSR8nuxJA`eXUfSzkpCwTr#V)R4Oei-JcwCMw6cA<=j>+yU*vk9mh%+`dWIgX^f_niZ;jgG}AV+ zfq|(Tq%zoR+PX8^>f~(Q4Q!KKAW5Q>QetCc>(@2Z#@9ACkJrY>nj7kCXYG zvS!VuJ*gwsu49l^eF*lrk@)S(%)rc}9z6CC!Hn z8Y_1*S;w+=JFe+Z)8FSA$2?y)MbtOoI$5tRm@K6zIoH@@&|GHTXr~$7K9iR84J#&( z$UBhE&0V;3*^0V`#?6V2&YcfjE?4HwUm#b?1LRfPGaodKY`^Aa3|lwtLp`IW?hWW09Lvy{Z5ySSkbcxIEBiVpE zq-Bk+QG#Q*qir-AJW?9>jXHGGa{?iGV^_7R_WRSd=z4I5#j!=@YEtbHl}|-_M5diL zDFo=T@<&-ep>;+jw*EEHnGBB5HS73zf5 zLZi?mY!o&LyM!*GPtb(Jf+LLZ{R@S#+aI1MB*Jm(Oc!?Hl_H$Geb`mqzqNClyyHI; zc30*GfmTs@*TVSnRcqEaZE2YVBu8)ov^R!Afd8AKCcuAyk6W;NIfzJk$4U!^qEu308h;3y>_yJ97=+m%_It*TosQjjV_z{*t(>m&+Ar6^?U8i@sG z;XQ z=)nP`a1d$e7={f8M+x&MFph^Yfkz1Oj}hjdz>|0e&*C}4{Y!Wmuiz|RBhdBJ}@=pKd|)&YKa9-=;%!KAE*G$38^zLNwfLI%8ZBUn%D2{~go+{y$^; zi57}H5P4wcJ%Hl&WP2;EJKcTc=h|_q2dVnS*PGxpFrmg*@yCO7oap2qhSZOTvP4KH ZI3)>{8UG>R-~QSiz5k>4{~hrD{~Pv&r%wO? diff --git a/flatten_artifacts/file1 b/flatten_artifacts/file1 deleted file mode 100644 index e69de29b..00000000 diff --git a/flatten_artifacts/file2 b/flatten_artifacts/file2 deleted file mode 100644 index e69de29b..00000000 diff --git a/flatten_artifacts/file3 b/flatten_artifacts/file3 deleted file mode 100644 index e69de29b..00000000 diff --git a/temp.bash b/temp.bash deleted file mode 100755 index 9899ba5f..00000000 --- a/temp.bash +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -shopt -s nullglob -mkdir -p flatten_artifacts -for dir in artifacts/*/; do - file="$(find "$dir" -maxdepth 1 -type f | head -n 1)" - if [ -n "$file" ]; then - name="$(basename "$dir")" - - if [[ "$name" == *.tar ]]; then - tar -xOf "$file" > "flatten_artifacts/${name%.tar}" - else - mv "$file" "flatten_artifacts/$name" - fi - fi -done \ No newline at end of file From 1aace4468ea82314fb027c2fde3f2a0df979e783 Mon Sep 17 00:00:00 2001 From: AnemoFlower Date: Mon, 20 Apr 2026 15:28:29 +0800 Subject: [PATCH 6/8] chore: disable archive for tarballs and PKGs --- .github/workflows/build.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 8181354c..d75ec53e 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -218,6 +218,7 @@ jobs: with: name: ${{ env.ARTIFACT }} path: ${{ env.ARTIFACT }} + archive: false build-macos: strategy: fail-fast: false @@ -290,12 +291,14 @@ jobs: with: name: ${{ env.TAR_ARTIFACT }} path: ${{ env.TAR_ARTIFACT }} + archive: false - name: Upload PKG Artifact uses: actions/upload-artifact@v7 with: name: ${{ env.PKG_ARTIFACT }} path: ${{ env.PKG_ARTIFACT }} + archive: false assemble-packages: runs-on: ubuntu-latest From 2504070864002510c3d2796e11e99be8b770ddc3 Mon Sep 17 00:00:00 2001 From: AnemoFlower Date: Mon, 20 Apr 2026 15:46:16 +0800 Subject: [PATCH 7/8] chore: enable gzip compression for tarballs --- .github/workflows/build.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index d75ec53e..0a8d422c 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -210,8 +210,8 @@ jobs: fi chmod 755 "$source" - tar -cf "$source.tar" "$source" - echo "ARTIFACT=$source.tar" >> "$GITHUB_ENV" + tar -czf "$source.tar.gz" "$source" + echo "ARTIFACT=$source.tar.gz" >> "$GITHUB_ENV" - name: Upload Artifact uses: actions/upload-artifact@v7 @@ -262,8 +262,8 @@ jobs: cp "target/${{ matrix.target }}/release/terracotta" "$source" chmod 755 "$source" - tar -cf "$source.tar" "$source" - echo "TAR_ARTIFACT=$source.tar" >> "$GITHUB_ENV" + tar -czf "$source.tar.gz" "$source" + echo "TAR_ARTIFACT=$source.tar.gz" >> "$GITHUB_ENV" chmod -R 755 build/macos/scripts TEMP_DIR=$(mktemp -d) @@ -329,8 +329,8 @@ jobs: if [ -n "$file" ]; then name="$(basename "$dir")" - if [[ "$name" == *.tar ]]; then - tar -xOf "$file" > "${name%.tar}" + if [[ "$name" == *.tar.gz ]]; then + tar -xzOf "$file" > "${name%.tar.gz}" else mv "$file" "$name" fi From e2745b3b7358b55ec5ffeefed6bb40bbcccea5db Mon Sep 17 00:00:00 2001 From: burningtnt Date: Thu, 14 May 2026 18:39:53 +0800 Subject: [PATCH 8/8] Update workflows. --- .github/workflows/build.yaml | 53 ++---------------------------------- 1 file changed, 3 insertions(+), 50 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 0a8d422c..7b1d095c 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -41,7 +41,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v6 - - name: Compute Version run: | if [ -z "${{ github.event.inputs.version }}" ]; then @@ -49,7 +48,6 @@ jobs: else echo "TERRACOTTA_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV fi - - name: Build run: | rustup target add --toolchain nightly "${{ matrix.target }}" @@ -59,19 +57,16 @@ jobs: -Z build-std-features=default,optimize_for_size env: RUSTFLAGS: -Zunstable-options -Cpanic=immediate-abort - - name: Prepare Artifact run: | source="terracotta-${TERRACOTTA_VERSION}-${{ matrix.os }}-${{ matrix.arch }}.exe" cp "target/${{ matrix.target }}/release/terracotta.exe" "$source" echo "ARTIFACT=$source" >> "$GITHUB_ENV" - - name: Upload Artifact uses: actions/upload-artifact@v7 with: name: ${{ env.ARTIFACT }} path: ${{ env.ARTIFACT }} - build-unix: strategy: fail-fast: false @@ -91,7 +86,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v6 - - name: Compute Version run: | if [ -z "${{ github.event.inputs.version }}" ]; then @@ -99,58 +93,31 @@ jobs: else echo "TERRACOTTA_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV fi - - name: Setup Android SDK (Android) if: ${{ matrix.os == 'android' }} uses: android-actions/setup-android@v4 with: cmdline-tools-version: 11076708 packages: 'build-tools;34.0.0 ndk;26.0.10792818 tools platform-tools platforms;android-34 ' - - name: Install cargo-ndk and protobuf-compiler (Android) if: ${{ matrix.os == 'android' }} run: | sudo apt update sudo apt install --yes --no-install-recommends protobuf-compiler libprotobuf-dev cargo install cargo-ndk --force - - name: Install musl libc (linux x86_64 | linux arm64) if: ${{ contains(fromJSON('["x86_64", "arm64"]'), matrix.arch) && matrix.os == 'linux' }} run: | sudo apt update sudo apt install --yes --no-install-recommends build-essential musl-tools musl-dev - - name: Install Zig (linux riscv64 | linux loongarch64) if: ${{ contains(fromJSON('["riscv64", "loongarch64"]'), matrix.arch) && matrix.os == 'linux' }} - run: | - ZIG_VERSION="0.14.0" - - case "${{ runner.arch }}" in - X64) - ZIG_KEY="linux-x86_64" - ;; - ARM64) - ZIG_KEY="linux-aarch64" - ;; - *) - echo "Unsupported runner.arch: ${{ runner.arch }}" - exit 1 - ;; - esac - - ZIG_URL="https://ziglang.org/download/${ZIG_VERSION}/zig-${ZIG_KEY}-${ZIG_VERSION}.tar.xz" - echo "Downloading Zig from: ${ZIG_URL}" - curl -fsSL "$ZIG_URL" -o zig.tar.xz - tar -xf zig.tar.xz - echo "$PWD/zig-${ZIG_KEY}-${ZIG_VERSION}" >> "$GITHUB_PATH" - export PATH="$PWD/zig-${ZIG_KEY}-${ZIG_VERSION}:$PATH" - which zig - zig version - + uses: mlugg/setup-zig@v2 + env: + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true - name: Install cargo-zigbuild (linux riscv64 | linux loongarch64) if: ${{ contains(fromJSON('["riscv64", "loongarch64"]'), matrix.arch) && matrix.os == 'linux' }} run: cargo install cargo-zigbuild --force - - name: Build (linux x86_64 | linux arm64) if: ${{ contains(fromJSON('["x86_64", "arm64"]'), matrix.arch) && matrix.os == 'linux' }} run: | @@ -161,13 +128,11 @@ jobs: -Z build-std-features=default,optimize_for_size env: RUSTFLAGS: -Zunstable-options -Cpanic=immediate-abort - - name: Build (linux riscv64 | linux loongarch64) if: ${{ contains(fromJSON('["riscv64", "loongarch64"]'), matrix.arch) && matrix.os == 'linux' }} run: | rustup target add --toolchain nightly "${{ matrix.target }}" cargo +nightly zigbuild --release --bin terracotta --target "${{ matrix.target }}.${{ matrix.glibc-version }}" - - name: Build (freebsd x86_64) if: ${{ contains(fromJSON('["x86_64"]'), matrix.arch) && matrix.os == 'freebsd' }} uses: cross-platform-actions/action@v1.0.0 @@ -184,7 +149,6 @@ jobs: . $HOME/.cargo/env rustup target add --toolchain nightly "${{ matrix.target }}" cargo +nightly build --release --bin terracotta --target "${{ matrix.target }}" - - name: Build (Android) if: ${{ matrix.os == 'android' }} run: | @@ -198,7 +162,6 @@ jobs: -Z build-std-features=default,optimize_for_size env: RUSTFLAGS: -Zunstable-options -Cpanic=unwind - - name: Prepare Artifact run: | if [ "${{ matrix.os }}" = "android" ]; then @@ -212,7 +175,6 @@ jobs: chmod 755 "$source" tar -czf "$source.tar.gz" "$source" echo "ARTIFACT=$source.tar.gz" >> "$GITHUB_ENV" - - name: Upload Artifact uses: actions/upload-artifact@v7 with: @@ -237,7 +199,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v6 - - name: Compute Version run: | if [ -z "${{ github.event.inputs.version }}" ]; then @@ -245,7 +206,6 @@ jobs: else echo "TERRACOTTA_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV fi - - name: Build run: | rustup target add --toolchain nightly "${{ matrix.target }}" @@ -255,7 +215,6 @@ jobs: -Z build-std-features=default,optimize_for_size env: RUSTFLAGS: -Zunstable-options -Cpanic=immediate-abort - - name: Prepare Artifact run: | source="terracotta-${TERRACOTTA_VERSION}-${{ matrix.os }}-${{ matrix.arch }}" @@ -285,21 +244,18 @@ jobs: --component-plist build/macos/terracotta.plist \ "$PKG_OUTPUT" echo "PKG_ARTIFACT=$PKG_OUTPUT" >> "$GITHUB_ENV" - - name: Upload TAR Artifact uses: actions/upload-artifact@v7 with: name: ${{ env.TAR_ARTIFACT }} path: ${{ env.TAR_ARTIFACT }} archive: false - - name: Upload PKG Artifact uses: actions/upload-artifact@v7 with: name: ${{ env.PKG_ARTIFACT }} path: ${{ env.PKG_ARTIFACT }} archive: false - assemble-packages: runs-on: ubuntu-latest name: Assemble Artifact @@ -315,12 +271,10 @@ jobs: else echo "TERRACOTTA_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV fi - - name: Download Artifacts uses: actions/download-artifact@v8 with: path: artifacts - - name: Assemble Artifacts run: | shopt -s nullglob @@ -368,7 +322,6 @@ jobs: fi env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Upload Artifact uses: actions/upload-artifact@v7 with: