Testing workflow
Some checks failed
Multi-Platform Release Build / build (false, native) (push) Failing after 12m51s
Multi-Platform Release Build / build (true, aarch64-linux-gnu-gcc, aarch64-unknown-linux-gnu) (push) Failing after 1m54s
Multi-Platform Release Build / build (true, arm-linux-gnueabihf-gcc, armv7-unknown-linux-gnueabihf) (push) Failing after 1m37s
Multi-Platform Release Build / build (true, x86_64-linux-gnu-gcc, x86_64-unknown-linux-gnu) (push) Failing after 1m38s
Multi-Platform Release Build / build (true, x86_64-w64-mingw32-gcc, x86_64-pc-windows-gnu) (push) Failing after 2m1s
Multi-Platform Release Build / create-release (push) Has been skipped
Some checks failed
Multi-Platform Release Build / build (false, native) (push) Failing after 12m51s
Multi-Platform Release Build / build (true, aarch64-linux-gnu-gcc, aarch64-unknown-linux-gnu) (push) Failing after 1m54s
Multi-Platform Release Build / build (true, arm-linux-gnueabihf-gcc, armv7-unknown-linux-gnueabihf) (push) Failing after 1m37s
Multi-Platform Release Build / build (true, x86_64-linux-gnu-gcc, x86_64-unknown-linux-gnu) (push) Failing after 1m38s
Multi-Platform Release Build / build (true, x86_64-w64-mingw32-gcc, x86_64-pc-windows-gnu) (push) Failing after 2m1s
Multi-Platform Release Build / create-release (push) Has been skipped
This commit is contained in:
parent
7082ce4dfc
commit
98da3e0c05
1 changed files with 54 additions and 38 deletions
|
|
@ -24,33 +24,48 @@ jobs:
|
|||
- target: x86_64-pc-windows-gnu
|
||||
cross: true
|
||||
linker: x86_64-w64-mingw32-gcc
|
||||
container:
|
||||
image: rust:alpine
|
||||
options: --platform linux/arm64
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: docker/checkout@v4
|
||||
uses: https://code.forgejo.org/actions/checkout@v4
|
||||
|
||||
- name: Install build dependencies
|
||||
run: |
|
||||
apk update
|
||||
apk add --no-cache \
|
||||
build-base \
|
||||
gcc-arm-linux-gnueabihf \
|
||||
gcc-aarch64-linux-gnu \
|
||||
gcc-x86_64-linux-gnu \
|
||||
g++-arm-linux-gnueabihf \
|
||||
g++-aarch64-linux-gnu \
|
||||
mingw-w64 \
|
||||
libc6-dev-armhf-cross \
|
||||
libc6-dev-arm64-cross \
|
||||
musl-dev \
|
||||
linux-headers
|
||||
- name: Setup Rust
|
||||
uses: https://github.com/dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
toolchain: stable
|
||||
|
||||
- name: Add Rust target
|
||||
if: matrix.target != 'native'
|
||||
run: rustup target add ${{ matrix.target }}
|
||||
|
||||
- name: Install cross-compilation tools
|
||||
if: matrix.cross
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y \
|
||||
gcc-arm-linux-gnueabihf \
|
||||
gcc-aarch64-linux-gnu \
|
||||
gcc-x86-64-linux-gnu \
|
||||
g++-arm-linux-gnueabihf \
|
||||
g++-aarch64-linux-gnu \
|
||||
mingw-w64 \
|
||||
libc6-dev-armhf-cross \
|
||||
libc6-dev-arm64-cross
|
||||
|
||||
- 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: Configure cross-compilation
|
||||
if: matrix.cross && matrix.target != 'native'
|
||||
run: |
|
||||
|
|
@ -63,16 +78,15 @@ jobs:
|
|||
- name: Build release
|
||||
run: |
|
||||
if [ "${{ matrix.target }}" = "native" ]; then
|
||||
# Build nativo para a arquitetura do runner
|
||||
NATIVE_TARGET=$(rustc -vV | grep 'host:' | cut -d' ' -f2)
|
||||
echo "Building for native target: $NATIVE_TARGET"
|
||||
cargo build --release --features production
|
||||
cargo build --release
|
||||
TARGET_BINARY="target/release/uptime-kuma-dashboard"
|
||||
OUTPUT_NAME="uptime-kuma-dashboard-$NATIVE_TARGET"
|
||||
else
|
||||
# Build com target específico
|
||||
echo "Building for target: ${{ matrix.target }}"
|
||||
cargo build --release --target ${{ matrix.target }} --features production
|
||||
cargo build --release --target ${{ matrix.target }}
|
||||
|
||||
if [[ "${{ matrix.target }}" == *"windows"* ]]; then
|
||||
TARGET_BINARY="target/${{ matrix.target }}/release/uptime-kuma-dashboard.exe"
|
||||
OUTPUT_NAME="uptime-kuma-dashboard-${{ matrix.target }}.exe"
|
||||
|
|
@ -81,29 +95,29 @@ jobs:
|
|||
OUTPUT_NAME="uptime-kuma-dashboard-${{ matrix.target }}"
|
||||
fi
|
||||
fi
|
||||
# Criar diretório de artifacts
|
||||
|
||||
mkdir -p release-artifacts
|
||||
# Verificar se o binário foi criado
|
||||
|
||||
if [ ! -f "$TARGET_BINARY" ]; then
|
||||
echo "Error: Binary not found at $TARGET_BINARY"
|
||||
exit 1
|
||||
fi
|
||||
# Copiar binário
|
||||
|
||||
cp "$TARGET_BINARY" "release-artifacts/$OUTPUT_NAME"
|
||||
# Strip binário para Linux (reduz tamanho)
|
||||
|
||||
if [[ "${{ matrix.target }}" == *"linux"* ]] || [ "${{ matrix.target }}" = "native" ]; then
|
||||
strip "release-artifacts/$OUTPUT_NAME" 2>/dev/null || echo "Strip failed, continuing..."
|
||||
fi
|
||||
# Tornar executável
|
||||
|
||||
if [[ "${{ matrix.target }}" != *"windows"* ]]; then
|
||||
chmod +x "release-artifacts/$OUTPUT_NAME"
|
||||
fi
|
||||
# Mostrar informações do arquivo
|
||||
|
||||
ls -lh "release-artifacts/$OUTPUT_NAME"
|
||||
file "release-artifacts/$OUTPUT_NAME" || true
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: docker/upload-artifact@v4
|
||||
uses: https://code.forgejo.org/actions/upload-artifact@v4
|
||||
with:
|
||||
name: binary-${{ matrix.target }}
|
||||
path: release-artifacts/
|
||||
|
|
@ -116,10 +130,10 @@ jobs:
|
|||
contents: write
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: docker/checkout@v4
|
||||
uses: https://code.forgejo.org/actions/checkout@v4
|
||||
|
||||
- name: Download all artifacts
|
||||
uses: docker/download-artifact@v4
|
||||
uses: https://code.forgejo.org/actions/download-artifact@v4
|
||||
with:
|
||||
path: all-artifacts/
|
||||
|
||||
|
|
@ -136,13 +150,15 @@ jobs:
|
|||
cat SHA256SUMS.txt
|
||||
|
||||
- name: Create Release
|
||||
uses: docker/gitea-release-action@v1
|
||||
uses: https://code.forgejo.org/actions/forgejo-release@v2
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
files: release-artifacts/*
|
||||
token: ${{ secrets.FORGEGO_TOKEN }}
|
||||
tag_name: ${{ forgejo.ref_name }}
|
||||
name: Release ${{ forgejo.ref_name }}
|
||||
body: |
|
||||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue