mirror of https://github.com/telemt/telemt.git
Update release.yml
This commit is contained in:
parent
13ff3af1db
commit
73f218b62a
|
|
@ -36,24 +36,34 @@ jobs:
|
||||||
# ===== MUSL =====
|
# ===== MUSL =====
|
||||||
- target: x86_64-unknown-linux-musl
|
- target: x86_64-unknown-linux-musl
|
||||||
asset_name: telemt-x86_64-linux-musl
|
asset_name: telemt-x86_64-linux-musl
|
||||||
- target: aarch64-unknown-linux-musl
|
|
||||||
asset_name: telemt-aarch64-linux-musl
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
# ---------- Toolchain ----------
|
||||||
- uses: dtolnay/rust-toolchain@v1
|
- uses: dtolnay/rust-toolchain@v1
|
||||||
with:
|
with:
|
||||||
toolchain: stable
|
toolchain: stable
|
||||||
targets: ${{ matrix.target }}
|
targets: |
|
||||||
|
x86_64-unknown-linux-gnu
|
||||||
|
aarch64-unknown-linux-gnu
|
||||||
|
x86_64-unknown-linux-musl
|
||||||
|
|
||||||
- name: Pull cross images
|
# ---------- System deps (bookworm) ----------
|
||||||
|
- name: Install build deps
|
||||||
run: |
|
run: |
|
||||||
docker pull ghcr.io/cross-rs/${{ matrix.target }}:latest || true
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y --no-install-recommends \
|
||||||
- name: Install cross
|
build-essential \
|
||||||
run: cargo install cross --git https://github.com/cross-rs/cross
|
clang \
|
||||||
|
lld \
|
||||||
|
pkg-config \
|
||||||
|
musl-tools \
|
||||||
|
gcc-aarch64-linux-gnu \
|
||||||
|
g++-aarch64-linux-gnu \
|
||||||
|
ca-certificates
|
||||||
|
|
||||||
|
# ---------- Cache ----------
|
||||||
- uses: actions/cache@v4
|
- uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
|
|
@ -61,21 +71,35 @@ jobs:
|
||||||
~/.cargo/git
|
~/.cargo/git
|
||||||
target
|
target
|
||||||
key: ${{ runner.os }}-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
|
key: ${{ runner.os }}-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-${{ matrix.target }}-
|
|
||||||
|
|
||||||
|
# ---------- Build ----------
|
||||||
- name: Build
|
- name: Build
|
||||||
env:
|
env:
|
||||||
RUSTFLAGS: ${{ contains(matrix.target, 'musl') && '-C target-feature=+crt-static' || '' }}
|
CC_x86_64_unknown_linux_gnu: clang
|
||||||
run: cross build --release --target ${{ matrix.target }}
|
CXX_x86_64_unknown_linux_gnu: clang++
|
||||||
|
|
||||||
|
CC_aarch64_unknown_linux_gnu: aarch64-linux-gnu-gcc
|
||||||
|
CXX_aarch64_unknown_linux_gnu: aarch64-linux-gnu-g++
|
||||||
|
|
||||||
|
CC_x86_64_unknown_linux_musl: musl-gcc
|
||||||
|
|
||||||
|
RUSTFLAGS: "-C linker=clang -C link-arg=-fuse-ld=lld"
|
||||||
|
run: |
|
||||||
|
case "${{ matrix.target }}" in
|
||||||
|
x86_64-unknown-linux-musl)
|
||||||
|
export RUSTFLAGS="-C target-feature=+crt-static"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
cargo build --release --target ${{ matrix.target }}
|
||||||
|
|
||||||
|
# ---------- Package ----------
|
||||||
- name: Package
|
- name: Package
|
||||||
run: |
|
run: |
|
||||||
mkdir -p dist
|
mkdir -p dist
|
||||||
|
|
||||||
BIN=target/${{ matrix.target }}/release/${{ env.BINARY_NAME }}
|
BIN=target/${{ matrix.target }}/release/${{ env.BINARY_NAME }}
|
||||||
|
|
||||||
# уникальное имя бинаря
|
|
||||||
cp "$BIN" dist/${{ env.BINARY_NAME }}-${{ matrix.target }}
|
cp "$BIN" dist/${{ env.BINARY_NAME }}-${{ matrix.target }}
|
||||||
|
|
||||||
cd dist
|
cd dist
|
||||||
|
|
@ -136,19 +160,6 @@ jobs:
|
||||||
build-args: |
|
build-args: |
|
||||||
BINARY=dist/telemt
|
BINARY=dist/telemt
|
||||||
|
|
||||||
- name: Build & Push debug
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
target: debug
|
|
||||||
push: true
|
|
||||||
platforms: linux/amd64,linux/arm64
|
|
||||||
tags: |
|
|
||||||
ghcr.io/${{ github.repository }}:${{ steps.vars.outputs.VERSION }}-debug
|
|
||||||
ghcr.io/${{ github.repository }}:debug
|
|
||||||
build-args: |
|
|
||||||
BINARY=dist/telemt
|
|
||||||
|
|
||||||
release:
|
release:
|
||||||
name: Release
|
name: Release
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue