name: Multi-Platform Release Build on: push: tags: - "v*.*.*" jobs: build: runs-on: docker strategy: fail-fast: false matrix: include: - target: native cross: false platform: linux/arm64 - target: x86_64-unknown-linux-gnu cross: true platform: linux/amd64 deps: "build-essential libssl-dev pkg-config" - target: x86_64-pc-windows-gnu cross: true platform: linux/amd64 deps: "build-essential mingw-w64" steps: - name: Checkout code uses: https://code.forgejo.org/actions/checkout@v4 - name: Setup Rust uses: https://github.com/dtolnay/rust-toolchain@stable with: toolchain: stable - name: Add Rust target if: matrix.target != 'native' && !matrix.container run: rustup target add ${{ matrix.target }} - name: Install build dependencies if: matrix.cross && matrix.deps run: | apk add --no-cache ${{ matrix.deps }} - name: Cache Rust dependencies uses: https://code.forgejo.org/actions/cache@v4 with: path: | ~/.cargo/bin/ ~/.cargo/registry/index/ ~/.cargo/registry/cache/ ~/.cargo/git/db/ target/ key: ${{ runner.os }}-cargo-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }} restore-keys: | ${{ runner.os }}-cargo-${{ matrix.target }}- ${{ runner.os }}-cargo- - name: Native Build Release if: matrix.target == 'native' run: | NATIVE_TARGET=$(rustc -vV | grep 'host:' | cut -d' ' -f2) echo "Building for native target: $NATIVE_TARGET" cargo build --release TARGET_BINARY="target/release/uptime-kuma-dashboard" OUTPUT_NAME="uptime-kuma-dashboard-$NATIVE_TARGET" mkdir -p release-artifacts cp "$TARGET_BINARY" "release-artifacts/$OUTPUT_NAME" strip "release-artifacts/$OUTPUT_NAME" 2>/dev/null || true chmod +x "release-artifacts/$OUTPUT_NAME" ls -lh "release-artifacts/$OUTPUT_NAME" - name: Cross-Build Release (Linux x86_64) if: matrix.target == 'x86_64-unknown-linux-gnu' uses: docker://rust:alpine with: args: > sh -c " apk add --no-cache build-base musl-dev gcc g++ && rustup target add x86_64-unknown-linux-gnu && cargo build --release --target x86_64-unknown-linux-gnu && mkdir -p release-artifacts && cp target/x86_64-unknown-linux-gnu/release/uptime-kuma-dashboard release-artifacts/uptime-kuma-dashboard-x86_64-unknown-linux-gnu && strip release-artifacts/uptime-kuma-dashboard-x86_64-unknown-linux-gnu && chmod +x release-artifacts/uptime-kuma-dashboard-x86_64-unknown-linux-gnu && ls -lh release-artifacts/" env: CARGO_TARGET_DIR: target options: --platform linux/amd64 - name: Cross-Build Release (Windows x86_64) if: matrix.target == 'x86_64-pc-windows-gnu' uses: docker://rust:alpine with: args: > sh -c " apk add --no-cache build-base mingw-w64-gcc mingw-w64-headers mingw-w64-crt mingw-w64-winpthreads && rustup target add x86_64-pc-windows-gnu && cargo build --release --target x86_64-pc-windows-gnu && mkdir -p release-artifacts && cp target/x86_64-pc-windows-gnu/release/uptime-kuma-dashboard.exe release-artifacts/uptime-kuma-dashboard-x86_64-pc-windows-gnu.exe && ls -lh release-artifacts/" env: CARGO_TARGET_DIR: target options: --platform linux/amd64 - name: Upload artifacts uses: https://data.forgejo.org/forgejo/upload-artifact@v4 with: name: binary-${{ matrix.target }} path: release-artifacts/ retention-days: 1 create-release: runs-on: docker needs: build permissions: contents: write steps: - name: Checkout code uses: https://code.forgejo.org/actions/checkout@v4 - name: Download all artifacts uses: https://data.forgejo.org/forgejo/download-artifact@v4 with: path: all-artifacts/ - name: Prepare release artifacts run: | mkdir -p release-artifacts find all-artifacts -type f -name "uptime-kuma-dashboard-*" -exec cp {} release-artifacts/ \; ls -lh release-artifacts/ - name: Generate checksums run: | cd release-artifacts sha256sum uptime-kuma-dashboard-* > SHA256SUMS.txt cat SHA256SUMS.txt - name: Create Release uses: https://code.forgejo.org/actions/forgejo-release@v2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: direction: upload release-dir: release-artifacts title: "Release ${{ github.ref_name }}" tag: ${{ github.ref_name }} release-notes:: | ## 🚀 Multi-Platform Release Compiled on runner **${{ env.RUNNER_ARCH }}** ### 📦 Available Binaries This release includes binaries for the following platforms: - **Linux x86_64** (Intel/AMD 64-bit) - **Linux ARM64** (aarch64) - Raspberry Pi 4, ARM servers - **Windows x86_64** (64-bit) ### 🚀 How to use #### Linux/ARM: ```bash # Download the appropriate binary wget https://your-forgejo.com/releases/download/${{ forgejo.ref_name }}/uptime-kuma-dashboard- # Make executable chmod +x uptime-kuma-dashboard-* # Run ./uptime-kuma-dashboard-* --base-url https://your-kuma --slug your-slug ``` #### Windows: ```powershell # Download uptime-kuma-dashboard-x86_64-pc-windows-gnu.exe # Run in PowerShell or CMD .\uptime-kuma-dashboard-x86_64-pc-windows-gnu.exe --base-url https://your-kuma --slug your-slug ``` ### ✅ Verify Checksums ```bash sha256sum -c SHA256SUMS.txt ``` ### 🏗️ Build Information - Runner Architecture: ${{ env.RUNNER_ARCH }} - Rust Version: 1.84.0 - Build Type: Release (optimized)