From 726f9e3163449e2b36a7dff7f09a2d21d71cfece Mon Sep 17 00:00:00 2001 From: andylizi Date: Sat, 13 Feb 2021 16:39:02 +0800 Subject: Build dist-x86_64-unknown-linux-musl releases --- .github/workflows/release.yaml | 34 +++++++++++++++++++++++++++++++++- xtask/src/dist.rs | 2 +- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 82448f719..32c7cf7ef 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -121,6 +121,34 @@ jobs: name: dist-x86_64-unknown-linux-gnu path: ./dist + dist-x86_64-unknown-linux-musl: + name: dist (x86_64-unknown-linux-musl) + runs-on: ubuntu-20.04 + env: + RA_TARGET: x86_64-unknown-linux-musl + # For some reason `-crt-static` is not working for clang without lld + RUSTFLAGS: "-C link-arg=-fuse-ld=lld -C target-feature=-crt-static" + container: + image: rust:alpine + volumes: + - /usr/local/cargo/registry + + steps: + - name: Install dependencies + run: apk add --no-cache git clang lld musl-dev + + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Dist + run: cargo xtask dist + + - name: Upload artifacts + uses: actions/upload-artifact@v1 + with: + name: dist-x86_64-unknown-linux-musl + path: ./dist + dist-aarch64-unknown-linux-gnu: name: dist (aarch64-unknown-linux-gnu) runs-on: ubuntu-16.04 @@ -216,7 +244,7 @@ jobs: publish: name: publish runs-on: ubuntu-16.04 - needs: ['dist-x86_64-pc-windows-msvc', 'dist-aarch64-pc-windows-msvc', 'dist-x86_64-unknown-linux-gnu', 'dist-aarch64-unknown-linux-gnu', 'dist-x86_64-apple-darwin', 'dist-aarch64-apple-darwin'] + needs: ['dist-x86_64-pc-windows-msvc', 'dist-aarch64-pc-windows-msvc', 'dist-x86_64-unknown-linux-gnu', 'dist-x86_64-unknown-linux-musl', 'dist-aarch64-unknown-linux-gnu', 'dist-x86_64-apple-darwin', 'dist-aarch64-apple-darwin'] steps: - name: Install Nodejs uses: actions/setup-node@v1 @@ -247,6 +275,10 @@ jobs: with: name: dist-x86_64-unknown-linux-gnu path: dist + - uses: actions/download-artifact@v1 + with: + name: dist-x86_64-unknown-linux-musl + path: dist - uses: actions/download-artifact@v1 with: name: dist-aarch64-unknown-linux-gnu diff --git a/xtask/src/dist.rs b/xtask/src/dist.rs index 6bc34106b..56bf9f99d 100644 --- a/xtask/src/dist.rs +++ b/xtask/src/dist.rs @@ -59,7 +59,7 @@ fn dist_client(version: &str, release_tag: &str) -> Result<()> { fn dist_server() -> Result<()> { let target = get_target(); - if target.contains("-linux-gnu") { + if target.contains("-linux-gnu") || target.contains("-linux-musl") { env::set_var("CC", "clang"); } -- cgit v1.2.3