From 9dfbafbb91f005fc7b7f62fe8431eb107c8a4092 Mon Sep 17 00:00:00 2001 From: Timo Behrendt Date: Sat, 27 Dec 2025 10:16:29 +0100 Subject: [PATCH 1/6] ci: add simple test pipeline --- .gitea/workflows/ci.yaml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .gitea/workflows/ci.yaml diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml new file mode 100644 index 0000000..3110c82 --- /dev/null +++ b/.gitea/workflows/ci.yaml @@ -0,0 +1,24 @@ +name: CI + +on: + pull_request: + +jobs: + build: + runs-on: + - ubuntu-latest + - linux_amd64 + steps: + - uses: actions/checkout@v4 + - 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 -- 2.49.1 From 0d3a8a9187bd7e773a79a6661209701a67169534 Mon Sep 17 00:00:00 2001 From: Timo Behrendt Date: Sat, 27 Dec 2025 12:23:23 +0100 Subject: [PATCH 2/6] 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 }} -- 2.49.1 From 875a27802a2a7bd61e72eddcedc15f544b39064a Mon Sep 17 00:00:00 2001 From: Timo Behrendt Date: Sat, 27 Dec 2025 12:24:16 +0100 Subject: [PATCH 3/6] test: release in feature branch --- .gitea/workflows/cd.yaml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.gitea/workflows/cd.yaml b/.gitea/workflows/cd.yaml index 628d6f1..fd0bee3 100644 --- a/.gitea/workflows/cd.yaml +++ b/.gitea/workflows/cd.yaml @@ -3,11 +3,7 @@ name: CD on: push: branches: - - main - paths: - - "src/**" - - "CMakeLists.txt" - - "schemas/**" + - ci-add-cicd workflow_dispatch: jobs: -- 2.49.1 From 45051c015d9990c6aac373029d34096f7329915d Mon Sep 17 00:00:00 2001 From: Timo Behrendt Date: Sat, 27 Dec 2025 12:25:00 +0100 Subject: [PATCH 4/6] always run on ubuntu-latest --- .gitea/workflows/cd.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/cd.yaml b/.gitea/workflows/cd.yaml index fd0bee3..82388c4 100644 --- a/.gitea/workflows/cd.yaml +++ b/.gitea/workflows/cd.yaml @@ -17,7 +17,9 @@ jobs: - runner: linux_arm64 arch: arm64 artifact_name: usbmakroboard-arm64 - runs-on: ${{ matrix.runner }} + runs-on: + - ubuntu-latest + - ${{ matrix.runner }} steps: - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 with: -- 2.49.1 From 263b61336e5be22a278501bc0a462872cfaed94c Mon Sep 17 00:00:00 2001 From: Timo Behrendt Date: Sat, 27 Dec 2025 12:32:31 +0100 Subject: [PATCH 5/6] ci: add checksum and differentiage between releases --- .gitea/workflows/cd.yaml | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/cd.yaml b/.gitea/workflows/cd.yaml index 82388c4..d2d1ffd 100644 --- a/.gitea/workflows/cd.yaml +++ b/.gitea/workflows/cd.yaml @@ -26,7 +26,7 @@ jobs: fetch-depth: 0 - run: | sudo apt-get update - sudo apt-get install -y build-essential cmake + sudo apt-get install -y build-essential cmake zip - name: Configure and build run: | mkdir -p build @@ -36,11 +36,21 @@ jobs: - name: Verify binary run: | test -f build/usbmakroboard && echo "Binary built successfully" || exit 1 - - name: Upload artifact + - name: Create zip archive + run: | + cd build + zip usbmakroboard-linux-${{ matrix.arch }}.zip usbmakroboard + - name: Generate checksum + run: | + cd build + sha256sum usbmakroboard-linux-${{ matrix.arch }}.zip > usbmakroboard-linux-${{ matrix.arch }}.zip.sha256 + - name: Upload artifacts uses: ChristopherHX/gitea-upload-artifact@v4 with: name: ${{ matrix.artifact_name }} - path: build/usbmakroboard + path: | + build/usbmakroboard-linux-${{ matrix.arch }}.zip + build/usbmakroboard-linux-${{ matrix.arch }}.zip.sha256 retention-days: 1 release: @@ -70,7 +80,9 @@ jobs: tag_name: ${{ steps.tag.outputs.new-tag }} name: ${{ steps.tag.outputs.new-tag }} files: | - artifacts/usbmakroboard-amd64/usbmakroboard - artifacts/usbmakroboard-arm64/usbmakroboard + artifacts/usbmakroboard-amd64/usbmakroboard-linux-amd64.zip + artifacts/usbmakroboard-amd64/usbmakroboard-linux-amd64.zip.sha256 + artifacts/usbmakroboard-arm64/usbmakroboard-linux-arm64.zip + artifacts/usbmakroboard-arm64/usbmakroboard-linux-arm64.zip.sha256 prerelease: ${{ github.event_name == 'workflow_dispatch' }} token: ${{ secrets.GITHUB_TOKEN }} -- 2.49.1 From 2ccac1decb8d20a6bc723c6859d3dfa46a7bba28 Mon Sep 17 00:00:00 2001 From: Timo Behrendt Date: Sat, 27 Dec 2025 12:39:04 +0100 Subject: [PATCH 6/6] somewhat prod ready --- .gitea/workflows/cd.yaml | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/.gitea/workflows/cd.yaml b/.gitea/workflows/cd.yaml index d2d1ffd..29e6ebb 100644 --- a/.gitea/workflows/cd.yaml +++ b/.gitea/workflows/cd.yaml @@ -3,7 +3,11 @@ name: CD on: push: branches: - - ci-add-cicd + - main + paths: + - "src/**" + - "CMakeLists.txt" + - "schemas/**" workflow_dispatch: jobs: @@ -27,21 +31,18 @@ jobs: - run: | sudo apt-get update sudo apt-get install -y build-essential cmake zip - - name: Configure and build + - name: Build run: | mkdir -p build cd build cmake .. cmake --build . - - name: Verify binary - run: | + - run: | test -f build/usbmakroboard && echo "Binary built successfully" || exit 1 - - name: Create zip archive - run: | + - run: | cd build zip usbmakroboard-linux-${{ matrix.arch }}.zip usbmakroboard - - name: Generate checksum - run: | + - run: | cd build sha256sum usbmakroboard-linux-${{ matrix.arch }}.zip > usbmakroboard-linux-${{ matrix.arch }}.zip.sha256 - name: Upload artifacts @@ -68,12 +69,9 @@ jobs: - 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 + - uses: ChristopherHX/gitea-download-artifact@v4 with: path: artifacts - - name: Create release uses: akkuman/gitea-release-action@v1 with: -- 2.49.1