From f165ffe73f8e16ff3515271a334a87320c99c575 Mon Sep 17 00:00:00 2001 From: rimuspp Date: Wed, 6 Mar 2024 18:16:50 -0500 Subject: [PATCH] Update CI.yml --- .github/workflows/CI.yml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 751c768..3715932 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -39,3 +39,41 @@ jobs: - name: Run Tests run: zig build test + + - name: Build artifacts + if: ${{ matrix.os == 'ubuntu-latest' }} + run: | + declare -a targets=("x86_64-windows" "x86_64-linux" "x86_64-macos" "aarch64-macos") + mkdir -p "artifacts/" + for target in "${targets[@]}"; do + mkdir -p artifacts/$target + echo "Building target ${target}..." + zig build -Dtarget=${target} -Doptimize=ReleaseSafe --prefix artifacts/${target}/ & + sed -e '1,5d' < README.md > artifacts/${target}/README.md + cp LICENSE artifacts/${target}/ + done + wait + - name: Upload artifacts Target Windows + if: ${{ matrix.os == 'ubuntu-latest' }} + uses: actions/upload-artifact@v2 + with: + name: builds + path: artifacts/x86_64-windows + - name: Upload artifacts Target Linux + if: ${{ matrix.os == 'ubuntu-latest' }} + uses: actions/upload-artifact@v2 + with: + name: builds + path: artifacts/x86_64-linux + - name: Upload artifacts Target MacOS + if: ${{ matrix.os == 'ubuntu-latest' }} + uses: actions/upload-artifact@v2 + with: + name: builds + path: artifacts/x86_64-macos + - name: Upload artifacts Target MacOS 2 + if: ${{ matrix.os == 'ubuntu-latest' }} + uses: actions/upload-artifact@v2 + with: + name: builds + path: artifacts/aarch64-macos