Testing workflow
Some checks failed
Multi-Platform Release Build / build (false, native) (push) Failing after 3m34s
Multi-Platform Release Build / build (true, aarch64-linux-gnu-gcc, aarch64-unknown-linux-gnu) (push) Failing after 30s
Multi-Platform Release Build / build (true, arm-linux-gnueabihf-gcc, armv7-unknown-linux-gnueabihf) (push) Failing after 11s
Multi-Platform Release Build / build (true, x86_64-linux-gnu-gcc, x86_64-unknown-linux-gnu) (push) Failing after 11s
Multi-Platform Release Build / build (true, x86_64-w64-mingw32-gcc, x86_64-pc-windows-gnu) (push) Failing after 14s
Multi-Platform Release Build / create-release (push) Has been skipped
Some checks failed
Multi-Platform Release Build / build (false, native) (push) Failing after 3m34s
Multi-Platform Release Build / build (true, aarch64-linux-gnu-gcc, aarch64-unknown-linux-gnu) (push) Failing after 30s
Multi-Platform Release Build / build (true, arm-linux-gnueabihf-gcc, armv7-unknown-linux-gnueabihf) (push) Failing after 11s
Multi-Platform Release Build / build (true, x86_64-linux-gnu-gcc, x86_64-unknown-linux-gnu) (push) Failing after 11s
Multi-Platform Release Build / build (true, x86_64-w64-mingw32-gcc, x86_64-pc-windows-gnu) (push) Failing after 14s
Multi-Platform Release Build / create-release (push) Has been skipped
This commit is contained in:
parent
5e8732c513
commit
e1b7b570c5
1 changed files with 16 additions and 64 deletions
|
|
@ -1,31 +1,17 @@
|
||||||
name: Multi-Platform Release Build
|
name: Multi-Platform Release Build
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- "v*.*.*"
|
- "v*.*.*"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
detect-architecture:
|
|
||||||
runs-on: docker
|
|
||||||
outputs:
|
|
||||||
runner_arch: ${{ env.RUNNER_ARCH }}
|
|
||||||
steps:
|
|
||||||
- name: Simply output architecture
|
|
||||||
run: |
|
|
||||||
echo "Runner architecture: $RUNNER_ARCH"
|
|
||||||
env | grep -i arch
|
|
||||||
|
|
||||||
build:
|
build:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
needs: detect-architecture
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- target: native
|
- target: native
|
||||||
cross: false
|
cross: false
|
||||||
|
|
||||||
- target: x86_64-unknown-linux-gnu
|
- target: x86_64-unknown-linux-gnu
|
||||||
cross: true
|
cross: true
|
||||||
linker: x86_64-linux-gnu-gcc
|
linker: x86_64-linux-gnu-gcc
|
||||||
|
|
@ -35,51 +21,35 @@ jobs:
|
||||||
- target: armv7-unknown-linux-gnueabihf
|
- target: armv7-unknown-linux-gnueabihf
|
||||||
cross: true
|
cross: true
|
||||||
linker: arm-linux-gnueabihf-gcc
|
linker: arm-linux-gnueabihf-gcc
|
||||||
|
|
||||||
- target: x86_64-pc-windows-gnu
|
- target: x86_64-pc-windows-gnu
|
||||||
cross: true
|
cross: true
|
||||||
linker: x86_64-w64-mingw32-gcc
|
linker: x86_64-w64-mingw32-gcc
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup Rust
|
- name: Setup Rust
|
||||||
uses: dtolnay/rust-toolchain@stable
|
uses: docker://rust:1.84.0-alpine
|
||||||
with:
|
|
||||||
toolchain: stable
|
|
||||||
|
|
||||||
- name: Add Rust target
|
- name: Install build dependencies
|
||||||
if: matrix.target != 'native'
|
|
||||||
run: rustup target add ${{ matrix.target }}
|
|
||||||
|
|
||||||
- name: Install cross-compilation tools
|
|
||||||
if: matrix.cross
|
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
apk update
|
||||||
sudo apt-get install -y \
|
apk add --no-cache \
|
||||||
|
build-base \
|
||||||
gcc-arm-linux-gnueabihf \
|
gcc-arm-linux-gnueabihf \
|
||||||
gcc-aarch64-linux-gnu \
|
gcc-aarch64-linux-gnu \
|
||||||
gcc-x86-64-linux-gnu \
|
gcc-x86_64-linux-gnu \
|
||||||
g++-arm-linux-gnueabihf \
|
g++-arm-linux-gnueabihf \
|
||||||
g++-aarch64-linux-gnu \
|
g++-aarch64-linux-gnu \
|
||||||
mingw-w64 \
|
mingw-w64 \
|
||||||
libc6-dev-armhf-cross \
|
libc6-dev-armhf-cross \
|
||||||
libc6-dev-arm64-cross
|
libc6-dev-arm64-cross \
|
||||||
|
musl-dev \
|
||||||
|
linux-headers
|
||||||
|
|
||||||
- name: Cache dependencies
|
- name: Add Rust target
|
||||||
uses: actions/cache@v3
|
if: matrix.target != 'native'
|
||||||
with:
|
run: rustup target add ${{ matrix.target }}
|
||||||
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: Configure cross-compilation
|
- name: Configure cross-compilation
|
||||||
if: matrix.cross && matrix.target != 'native'
|
if: matrix.cross && matrix.target != 'native'
|
||||||
|
|
@ -103,7 +73,6 @@ jobs:
|
||||||
# Build com target específico
|
# Build com target específico
|
||||||
echo "Building for target: ${{ matrix.target }}"
|
echo "Building for target: ${{ matrix.target }}"
|
||||||
cargo build --release --target ${{ matrix.target }} --features production
|
cargo build --release --target ${{ matrix.target }} --features production
|
||||||
|
|
||||||
if [[ "${{ matrix.target }}" == *"windows"* ]]; then
|
if [[ "${{ matrix.target }}" == *"windows"* ]]; then
|
||||||
TARGET_BINARY="target/${{ matrix.target }}/release/uptime-kuma-dashboard.exe"
|
TARGET_BINARY="target/${{ matrix.target }}/release/uptime-kuma-dashboard.exe"
|
||||||
OUTPUT_NAME="uptime-kuma-dashboard-${{ matrix.target }}.exe"
|
OUTPUT_NAME="uptime-kuma-dashboard-${{ matrix.target }}.exe"
|
||||||
|
|
@ -112,29 +81,23 @@ jobs:
|
||||||
OUTPUT_NAME="uptime-kuma-dashboard-${{ matrix.target }}"
|
OUTPUT_NAME="uptime-kuma-dashboard-${{ matrix.target }}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Criar diretório de artifacts
|
# Criar diretório de artifacts
|
||||||
mkdir -p release-artifacts
|
mkdir -p release-artifacts
|
||||||
|
|
||||||
# Verificar se o binário foi criado
|
# Verificar se o binário foi criado
|
||||||
if [ ! -f "$TARGET_BINARY" ]; then
|
if [ ! -f "$TARGET_BINARY" ]; then
|
||||||
echo "Error: Binary not found at $TARGET_BINARY"
|
echo "Error: Binary not found at $TARGET_BINARY"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Copiar binário
|
# Copiar binário
|
||||||
cp "$TARGET_BINARY" "release-artifacts/$OUTPUT_NAME"
|
cp "$TARGET_BINARY" "release-artifacts/$OUTPUT_NAME"
|
||||||
|
|
||||||
# Strip binário para Linux (reduz tamanho)
|
# Strip binário para Linux (reduz tamanho)
|
||||||
if [[ "${{ matrix.target }}" == *"linux"* ]] || [ "${{ matrix.target }}" = "native" ]; then
|
if [[ "${{ matrix.target }}" == *"linux"* ]] || [ "${{ matrix.target }}" = "native" ]; then
|
||||||
strip "release-artifacts/$OUTPUT_NAME" 2>/dev/null || echo "Strip failed, continuing..."
|
strip "release-artifacts/$OUTPUT_NAME" 2>/dev/null || echo "Strip failed, continuing..."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Tornar executável
|
# Tornar executável
|
||||||
if [[ "${{ matrix.target }}" != *"windows"* ]]; then
|
if [[ "${{ matrix.target }}" != *"windows"* ]]; then
|
||||||
chmod +x "release-artifacts/$OUTPUT_NAME"
|
chmod +x "release-artifacts/$OUTPUT_NAME"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Mostrar informações do arquivo
|
# Mostrar informações do arquivo
|
||||||
ls -lh "release-artifacts/$OUTPUT_NAME"
|
ls -lh "release-artifacts/$OUTPUT_NAME"
|
||||||
file "release-artifacts/$OUTPUT_NAME" || true
|
file "release-artifacts/$OUTPUT_NAME" || true
|
||||||
|
|
@ -148,7 +111,7 @@ jobs:
|
||||||
|
|
||||||
create-release:
|
create-release:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
needs: [detect-architecture, build]
|
needs: build
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
steps:
|
steps:
|
||||||
|
|
@ -181,45 +144,34 @@ jobs:
|
||||||
name: Release ${{ forgejo.ref_name }}
|
name: Release ${{ forgejo.ref_name }}
|
||||||
body: |
|
body: |
|
||||||
## 🚀 Multi-Platform Release
|
## 🚀 Multi-Platform Release
|
||||||
|
Compiled on runner **${{ env.RUNNER_ARCH }}**
|
||||||
Compiled on runner **${{ needs.detect-architecture.outputs.runner_arch }}**
|
|
||||||
|
|
||||||
### 📦 Available Binaries
|
### 📦 Available Binaries
|
||||||
|
|
||||||
This release includes binaries for the following platforms:
|
This release includes binaries for the following platforms:
|
||||||
|
|
||||||
- **Linux x86_64** (Intel/AMD 64-bit)
|
- **Linux x86_64** (Intel/AMD 64-bit)
|
||||||
- **Linux ARM64** (aarch64) - Raspberry Pi 4, Apple Silicon Linux, ARM servers
|
- **Linux ARM64** (aarch64) - Raspberry Pi 4, Apple Silicon Linux, ARM servers
|
||||||
- **Linux ARMv7** (armhf) - Raspberry Pi 3 and earlier
|
- **Linux ARMv7** (armhf) - Raspberry Pi 3 and earlier
|
||||||
- **Windows x86_64** (64-bit)
|
- **Windows x86_64** (64-bit)
|
||||||
|
|
||||||
### 🚀 How to use
|
### 🚀 How to use
|
||||||
|
|
||||||
#### Linux/ARM:
|
#### Linux/ARM:
|
||||||
```bash
|
```bash
|
||||||
# Download the appropriate binary
|
# Download the appropriate binary
|
||||||
wget https://your-forgejo.com/releases/download/${{ forgejo.ref_name }}/uptime-kuma-dashboard-<your-target>
|
wget https://your-forgejo.com/releases/download/${{ forgejo.ref_name }}/uptime-kuma-dashboard-<your-target>
|
||||||
|
|
||||||
# Make executable
|
# Make executable
|
||||||
chmod +x uptime-kuma-dashboard-*
|
chmod +x uptime-kuma-dashboard-*
|
||||||
|
|
||||||
# Run
|
# Run
|
||||||
./uptime-kuma-dashboard-* --base-url https://your-kuma --slug your-slug
|
./uptime-kuma-dashboard-* --base-url https://your-kuma --slug your-slug
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Windows:
|
#### Windows:
|
||||||
```powershell
|
```powershell
|
||||||
# Download uptime-kuma-dashboard-x86_64-pc-windows-gnu.exe
|
# Download uptime-kuma-dashboard-x86_64-pc-windows-gnu.exe
|
||||||
# Run in PowerShell or CMD
|
# Run in PowerShell or CMD
|
||||||
.\uptime-kuma-dashboard-x86_64-pc-windows-gnu.exe --base-url https://your-kuma --slug your-slug
|
.\uptime-kuma-dashboard-x86_64-pc-windows-gnu.exe --base-url https://your-kuma --slug your-slug
|
||||||
```
|
```
|
||||||
|
|
||||||
### ✅ Verify Checksums
|
### ✅ Verify Checksums
|
||||||
```bash
|
```bash
|
||||||
sha256sum -c SHA256SUMS.txt
|
sha256sum -c SHA256SUMS.txt
|
||||||
```
|
```
|
||||||
|
|
||||||
### 🏗️ Build Information
|
### 🏗️ Build Information
|
||||||
- Runner Architecture: ${{ needs.detect-architecture.outputs.runner_arch }}
|
- Runner Architecture: ${{ env.RUNNER_ARCH }}
|
||||||
- Rust Version: stable
|
- Rust Version: 1.84.0
|
||||||
- Build Type: Release (optimized)
|
- Build Type: Release (optimized)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue