From 43196af70c66ba20460dfc2bd38fb22ee687cd1c Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Sat, 25 Oct 2025 15:51:23 +0200 Subject: [PATCH] Add Gitea Actions workflow for automated binary releases Create workflow to build and release pre-built binaries: - Triggers on git tags (v*) or manual dispatch - Builds cm-dashboard and cm-dashboard-agent for Linux x86_64 - Creates Gitea release with attached binary files - Provides tarball for easy distribution This enables switching from source builds to pre-built binaries in NixOS configuration for faster rebuilds. --- .gitea/workflows/release.yml | 72 ++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 .gitea/workflows/release.yml diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml new file mode 100644 index 0000000..4a5d4b7 --- /dev/null +++ b/.gitea/workflows/release.yml @@ -0,0 +1,72 @@ +name: Build and Release + +on: + push: + tags: + - 'v*' + workflow_dispatch: + inputs: + version: + description: 'Version to release (e.g., v0.1.0)' + required: true + default: 'v0.1.0' + +jobs: + build-and-release: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + override: true + + - name: Install system dependencies + run: | + sudo apt-get update + sudo apt-get install -y pkg-config libssl-dev libzmq3-dev + + - name: Build workspace + run: | + cargo build --release --workspace + + - name: Create release directory + run: | + mkdir -p release + cp target/release/cm-dashboard release/cm-dashboard-linux-x86_64 + cp target/release/cm-dashboard-agent release/cm-dashboard-agent-linux-x86_64 + + - name: Create tarball + run: | + cd release + tar -czf cm-dashboard-linux-x86_64.tar.gz cm-dashboard-linux-x86_64 cm-dashboard-agent-linux-x86_64 + + - name: Set version variable + id: version + run: | + if [ "${{ gitea.event_name }}" == "workflow_dispatch" ]; then + echo "VERSION=${{ gitea.event.inputs.version }}" >> $GITEA_OUTPUT + else + echo "VERSION=${GITEA_REF#refs/tags/}" >> $GITEA_OUTPUT + fi + + - name: Create Release + uses: gitea-actions/release-action@v1 + with: + tag_name: ${{ steps.version.outputs.VERSION }} + name: cm-dashboard ${{ steps.version.outputs.VERSION }} + body: | + ## cm-dashboard ${{ steps.version.outputs.VERSION }} + + Pre-built binaries for Linux x86_64: + - `cm-dashboard-linux-x86_64` - Dashboard TUI binary + - `cm-dashboard-agent-linux-x86_64` - Agent daemon binary + - `cm-dashboard-linux-x86_64.tar.gz` - Combined tarball + files: | + release/cm-dashboard-linux-x86_64 + release/cm-dashboard-agent-linux-x86_64 + release/cm-dashboard-linux-x86_64.tar.gz \ No newline at end of file