From 0d3a8a9187bd7e773a79a6661209701a67169534 Mon Sep 17 00:00:00 2001 From: Timo Behrendt Date: Sat, 27 Dec 2025 12:23:23 +0100 Subject: [PATCH] ci: add release pipeline --- .gitea/workflows/cd.yaml | 78 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 .gitea/workflows/cd.yaml diff --git a/.gitea/workflows/cd.yaml b/.gitea/workflows/cd.yaml new file mode 100644 index 0000000..628d6f1 --- /dev/null +++ b/.gitea/workflows/cd.yaml @@ -0,0 +1,78 @@ +name: CD + +on: + push: + branches: + - main + paths: + - "src/**" + - "CMakeLists.txt" + - "schemas/**" + workflow_dispatch: + +jobs: + build: + strategy: + matrix: + include: + - runner: linux_amd64 + arch: amd64 + artifact_name: usbmakroboard-amd64 + - runner: linux_arm64 + arch: arm64 + artifact_name: usbmakroboard-arm64 + runs-on: ${{ matrix.runner }} + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 + with: + fetch-depth: 0 + - run: | + sudo apt-get update + sudo apt-get install -y build-essential cmake + - name: Configure and build + run: | + mkdir -p build + cd build + cmake .. + cmake --build . + - name: Verify binary + run: | + test -f build/usbmakroboard && echo "Binary built successfully" || exit 1 + - name: Upload artifact + uses: ChristopherHX/gitea-upload-artifact@v4 + with: + name: ${{ matrix.artifact_name }} + path: build/usbmakroboard + retention-days: 1 + + release: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 + with: + fetch-depth: 0 + - uses: https://gitea.t000-n.de/t.behrendt/conventional-semantic-git-tag-increment@0.1.22 + id: tag + with: + token: ${{ secrets.GITEA_TOKEN }} + prerelease: ${{ github.event_name == 'workflow_dispatch' }} + - uses: https://gitea.t000-n.de/t.behrendt/actions/release-git-tag@0.1.0 + with: + tag: ${{ steps.tag.outputs.new-tag }} + + - name: Download artifacts + uses: ChristopherHX/gitea-download-artifact@v4 + with: + path: artifacts + + - name: Create release + uses: akkuman/gitea-release-action@v1 + with: + tag_name: ${{ steps.tag.outputs.new-tag }} + name: ${{ steps.tag.outputs.new-tag }} + files: | + artifacts/usbmakroboard-amd64/usbmakroboard + artifacts/usbmakroboard-arm64/usbmakroboard + prerelease: ${{ github.event_name == 'workflow_dispatch' }} + token: ${{ secrets.GITHUB_TOKEN }}