From 2951b4868000f013c982ca7aaaab1c039172ad05 Mon Sep 17 00:00:00 2001 From: bartfaik04 Date: Mon, 2 Jun 2025 13:39:06 +0200 Subject: [PATCH] Added CI --- .gitea/workflows/ci.yml | 58 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .gitea/workflows/ci.yml diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..c14b36e --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,58 @@ +name: CI + +on: + push: {} + +jobs: + build: + runs-on: ubuntu-24.04 + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Install build tools + run: sudo apt update && sudo apt install -y build-essential zip + + - name: Compile project + run: make + + - name: Save build output + uses: actions/upload-artifact@v3 + with: + name: ncsambawatcher + path: ./ncsambawatcher + + release: + if: startsWith(github.ref, 'refs/tags/') + runs-on: ubuntu-24.04 + needs: build + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Download compiled binary + uses: actions/download-artifact@v3 + with: + name: ncsambawatcher + + - name: Copy files + run: | + mkdir build + cp ncsambawatcher build/ncsambawatcher + cp configs/ncsambawatcher.config.default build/ncsambawatcher.config + cp init.sh config/init.sh + + - name: Create release zip + run: | + cd build + zip ../ncsambawatcher.zip ./* + + - name: Publish release + uses: actions/create-release@v1 + env: + GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} + with: + tag_name: ${{ github.ref_name }} + release_name: Release ${{ github.ref_name }} + files: | + ncsambawatcher.zip