From 0b8974359f0225653641d1c544578abc61b34bd2 Mon Sep 17 00:00:00 2001 From: mashrafi rahman Date: Sun, 30 Jun 2024 23:27:03 +0800 Subject: [PATCH] Create cd.yml. Will this work? --- .github/workflows/cd.yml | 51 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/cd.yml diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 0000000..689dfbc --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,51 @@ +name: Continuous Deployment + +on: + push: + tags: + - "v*.*.*" + +jobs: + publish-github: + name: Publish on GitHub + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + TARGET: + [ + x86_64-linux, + x86_64-macos, + x86_64-windows, + aarch64-linux, + aarch64-macos, + aarch64-windows, + arm-linux, + riscv64-linux, + i386-linux, + ] + steps: + - name: Checkout the repository + uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Set the release version + run: echo "RELEASE_VERSION=${GITHUB_REF:11}" >> $GITHUB_ENV + + - name: Install Zig + uses: goto-bus-stop/setup-zig@v2 + with: + version: 0.13.0 + + - name: Build + run: zig build -Drelease-fast -Dtarget=${{ matrix.TARGET }} + + - name: Upload the binary + uses: svenstaro/upload-release-action@v2 + with: + file: zig-out/bin/rf-${{ env.RELEASE_VERSION }}-${{ matrix.TARGET }}* + file_glob: true + overwrite: true + tag: ${{ github.ref }} + repo_token: ${{ secrets.GITHUB_TOKEN }}