75 lines
2.2 KiB
YAML
75 lines
2.2 KiB
YAML
name: CD
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- ci-add-cicd
|
|
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 }}
|