From f60d955eb67c910374b9b0d85328e2625fa5024b Mon Sep 17 00:00:00 2001 From: neevek Date: Tue, 4 Jun 2024 23:45:40 +0800 Subject: [PATCH] support building against musl --- .github/workflows/main.yml | 26 +++++++++++++++++++++++++- Cargo.lock | 2 +- Cargo.toml | 2 +- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 714c19a..d234558 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,7 +14,7 @@ jobs: - uses: actions-rs/toolchain@v1 with: toolchain: stable - target: x86_64-unknown-linux-musl + target: x86_64-unknown-linux-gnu override: true - run: cargo build --all-features --release && mkdir -p rstun-linux-x86_64 && mv target/release/rstunc ./rstun-linux-x86_64/ @@ -29,6 +29,30 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + linux-musl-x86_64: + name: Linux musl x86_64 + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + target: x86_64-unknown-linux-musl + override: true + - run: sudo apt-get -y install musl-tools && rustup target add x86_64-unknown-linux-musl && cargo build --all-features --release --target x86_64-unknown-linux-musl + && mkdir -p rstun-linux-musl-x86_64 + && mv target/x86_64-unknown-linux-musl/release/rstunc ./rstun-linux-musl-x86_64/ + && mv target/x86_64-unknown-linux-musl/release/rstund ./rstun-linux-musl-x86_64/ + && tar zcf rstun-linux-musl-x86_64.zip ./rstun-linux-musl-x86_64/* + - name: Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: | + rstun-linux-musl-x86_64.tar.gz + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + windows-x86_64: name: Windows x86_64 runs-on: windows-latest diff --git a/Cargo.lock b/Cargo.lock index dea885d..5d4ccba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1049,7 +1049,7 @@ dependencies = [ [[package]] name = "rstun" -version = "0.4.14" +version = "0.4.15" dependencies = [ "android_logger", "anyhow", diff --git a/Cargo.toml b/Cargo.toml index 65e02a4..36cab88 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rstun" -version = "0.4.14" +version = "0.4.15" edition = "2021" [lib]