From 20c6413f448213303a11eaf6306e353d31fd401b Mon Sep 17 00:00:00 2001 From: Karutoh Date: Mon, 1 Jul 2024 19:41:00 -0700 Subject: [PATCH] Added CI/CD. --- .gitea/workflows/BuildRelease.yaml | 107 +++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 .gitea/workflows/BuildRelease.yaml diff --git a/.gitea/workflows/BuildRelease.yaml b/.gitea/workflows/BuildRelease.yaml new file mode 100644 index 0000000..9be002a --- /dev/null +++ b/.gitea/workflows/BuildRelease.yaml @@ -0,0 +1,107 @@ +name: Build & Release +run-name: ${{ gitea.actor }} is testing out Gitea Actions +on: + push: + tags: + - "v*" + +jobs: + Windows-AMD64-Build: + runs-on: windows-x86_64 + steps: + - name: Check out repository code + uses: actions/checkout@v3 + + - name: Building/Compiling/Installing Project + run: | + cd ${{ gitea.workspace }} + cmake -A x64 -DCMAKE_BUILD_TYPE=Release --preset=default . + cd build + cmake --build . --config Release + cmake --install . + + - name: Creating Appropriate Directories + run: | + cd ${{ gitea.workspace }} + mv build/Release/Pong.exe . + mv build/Release/zlib1.dll . + + - name: Zipping Binaries + run: | + cd ${{ gitea.workspace }} + tar -a -c -f lwe-windows-amd64.zip include bin lib resources docs + + - uses: https://github.com/actions/setup-go@v4 + with: + go-version: '>=1.20.1' + + - name: Use Go Action + id: use-go-action + uses: https://gitea.com/actions/release-action@main + with: + files: |- + lwe-windows-amd64.zip + api_key: '${{secrets.RELEASE_TOKEN}}' + + Linux-AMD64-Build: + runs-on: linux-x86_64 + steps: + - name: Check out repository code + uses: actions/checkout@v3 + + - name: Installing Dependencies + run: | + sudo pacman -S --noconfirm zip alsa-lib libxcb xcb-util-cursor vulkan-headers mesa + + - name: Building/Compiling/Installing Project + run: | + cd ${{ gitea.workspace }} + cmake -DCMAKE_BUILD_TYPE=Release . + cmake --build . --config Release + cmake --install . + + - name: Zipping Binaries + run: zip -r pong-linux-amd64.zip Pong resources + + - uses: https://github.com/actions/setup-go@v4 + with: + go-version: '>=1.20.1' + + - name: Use Go Action + id: use-go-action + uses: https://gitea.com/actions/release-action@main + with: + files: |- + pong-linux-amd64.zip + api_key: '${{secrets.RELEASE_TOKEN}}' + + Linux-AARCH64-Build: + runs-on: linux-aarch64 + steps: + - name: Check out repository code + uses: actions/checkout@v3 + + - name: Installing Dependencies + run: sudo apt install -y zip libasound2-dev libxcb1-dev libxcb-xinput-dev libxcb-cursor-dev vulkan-headers + + - name: Building/Compiling/Installing Project + run: | + cd ${{ gitea.workspace }} + cmake -DCMAKE_BUILD_TYPE=Release . + cmake --build . --config Release + cmake --install . + + - name: Zipping Binaries + run: zip -r pong-linux-aarch64.zip Pong resources + + - uses: https://github.com/actions/setup-go@v4 + with: + go-version: '>=1.20.1' + + - name: Use Go Action + id: use-go-action + uses: https://gitea.com/actions/release-action@main + with: + files: |- + pong-linux-aarch64.zip + api_key: '${{secrets.RELEASE_TOKEN}}' \ No newline at end of file