Files
mdrs-client-rust/.gitea/workflows/release.yml
T
orrisroot e7692c109d
Release / build-linux-x86_64 (push) Successful in 1m35s
Release / build-linux-aarch64 (push) Successful in 2m5s
ci: replace cross with cargo-zigbuild for aarch64 cross-compilation
cross runs builds inside a Docker container, so the host-installed
Rust toolchain is not visible. Replace with cargo-zigbuild which
uses Zig as a cross-linker and runs directly on the host.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-17 21:31:50 +09:00

64 lines
2.2 KiB
YAML

name: Release
on:
push:
tags:
- 'v*'
jobs:
build-linux-x86_64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust stable
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
- name: Add musl target
run: rustup target add x86_64-unknown-linux-musl
- name: Install musl tools
run: sudo apt-get update && sudo apt-get install -y musl-tools
- name: Build
run: cargo build --release --target x86_64-unknown-linux-musl
- name: Create archive
run: |
VERSION=${GITHUB_REF_NAME#v}
TARGET=x86_64-unknown-linux-musl
ARCHIVE="mdrs-${VERSION}-${TARGET}.tar.gz"
tar -czf "${ARCHIVE}" -C target/${TARGET}/release mdrs
echo "ARCHIVE=${ARCHIVE}" >> "$GITHUB_ENV"
- name: Create release and upload asset
uses: akkuman/gitea-release-action@v1
with:
token: ${{ github.token }}
files: ${{ env.ARCHIVE }}
build-linux-aarch64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust stable
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
- name: Install cargo-zigbuild
run: |
pip3 install ziglang --break-system-packages
cargo install cargo-zigbuild --locked
- name: Add aarch64 musl target
run: rustup target add aarch64-unknown-linux-musl
- name: Build
run: cargo zigbuild --release --target aarch64-unknown-linux-musl
- name: Create archive
run: |
VERSION=${GITHUB_REF_NAME#v}
TARGET=aarch64-unknown-linux-musl
ARCHIVE="mdrs-${VERSION}-${TARGET}.tar.gz"
tar -czf "${ARCHIVE}" -C target/${TARGET}/release mdrs
echo "ARCHIVE=${ARCHIVE}" >> "$GITHUB_ENV"
- name: Create release and upload asset
uses: akkuman/gitea-release-action@v1
with:
token: ${{ github.token }}
files: ${{ env.ARCHIVE }}