Update release.yml

This commit is contained in:
Alexey 2026-03-22 10:36:54 +03:00 committed by GitHub
parent 4e5b67bae8
commit 9de8b2f0bf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 45 additions and 9 deletions

View File

@ -18,10 +18,10 @@ env:
CARGO_TERM_COLOR: always CARGO_TERM_COLOR: always
BINARY_NAME: telemt BINARY_NAME: telemt
jobs:
# ========================== # ==========================
# GNU / glibc # GNU / glibc
# ========================== # ==========================
jobs:
build-gnu: build-gnu:
name: GNU ${{ matrix.target }} name: GNU ${{ matrix.target }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -66,7 +66,7 @@ jobs:
- name: Build - name: Build
run: | run: |
if [[ "${{ matrix.target }}" == "aarch64-unknown-linux-gnu" ]]; then if [ "${{ matrix.target }}" = "aarch64-unknown-linux-gnu" ]; then
export CC=aarch64-linux-gnu-gcc export CC=aarch64-linux-gnu-gcc
export CXX=aarch64-linux-gnu-g++ export CXX=aarch64-linux-gnu-g++
export CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc export CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc
@ -101,14 +101,14 @@ jobs:
dist/${{ matrix.asset }}.sha256 dist/${{ matrix.asset }}.sha256
# ========================== # ==========================
# MUSL (isolated environment) # MUSL
# ========================== # ==========================
build-musl: build-musl:
name: MUSL ${{ matrix.target }} name: MUSL ${{ matrix.target }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: container:
image: rust:1.75-slim-bookworm image: rust:slim-bookworm
strategy: strategy:
fail-fast: false fail-fast: false
@ -122,7 +122,7 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Install deps (musl env) - name: Install deps
run: | run: |
apt-get update apt-get update
apt-get install -y \ apt-get install -y \
@ -130,12 +130,48 @@ jobs:
pkg-config \ pkg-config \
curl curl
# 💾 cache toolchain
- uses: actions/cache@v4
if: matrix.target == 'aarch64-unknown-linux-musl'
with:
path: ~/.musl-aarch64
key: musl-toolchain-aarch64-v1
# 🔥 надёжная установка
- name: Install aarch64 musl toolchain - name: Install aarch64 musl toolchain
if: matrix.target == 'aarch64-unknown-linux-musl' if: matrix.target == 'aarch64-unknown-linux-musl'
run: | run: |
curl -LO https://musl.cc/aarch64-linux-musl-cross.tgz set -e
tar -xzf aarch64-linux-musl-cross.tgz
echo "$PWD/aarch64-linux-musl-cross/bin" >> $GITHUB_PATH TOOLCHAIN_DIR="$HOME/.musl-aarch64"
ARCHIVE="aarch64-linux-musl-cross.tgz"
if [ -x "$TOOLCHAIN_DIR/bin/aarch64-linux-musl-gcc" ]; then
echo "✅ musl toolchain already installed"
else
echo "⬇️ downloading musl toolchain..."
download() {
url="$1"
echo "→ trying $url"
curl -fL \
--retry 5 \
--retry-delay 3 \
--connect-timeout 10 \
--max-time 120 \
-o "$ARCHIVE" "$url" && return 0
return 1
}
download "https://musl.cc/$ARCHIVE" || \
download "https://more.musl.cc/$ARCHIVE" || \
{ echo "❌ failed to download musl toolchain"; exit 1; }
mkdir -p "$TOOLCHAIN_DIR"
tar -xzf "$ARCHIVE" --strip-components=1 -C "$TOOLCHAIN_DIR"
fi
echo "$TOOLCHAIN_DIR/bin" >> $GITHUB_PATH
- name: Add rust target - name: Add rust target
run: rustup target add ${{ matrix.target }} run: rustup target add ${{ matrix.target }}
@ -150,7 +186,7 @@ jobs:
- name: Build - name: Build
run: | run: |
if [[ "${{ matrix.target }}" == "aarch64-unknown-linux-musl" ]]; then if [ "${{ matrix.target }}" = "aarch64-unknown-linux-musl" ]; then
export CC=aarch64-linux-musl-gcc export CC=aarch64-linux-musl-gcc
export CC_aarch64_unknown_linux_musl=aarch64-linux-musl-gcc export CC_aarch64_unknown_linux_musl=aarch64-linux-musl-gcc
export RUSTFLAGS="-C target-feature=+crt-static -C linker=aarch64-linux-musl-gcc" export RUSTFLAGS="-C target-feature=+crt-static -C linker=aarch64-linux-musl-gcc"