mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-20 20:48:43 +00:00
Compile prebuilt binaries using musl target
So that it is statically linked and does not depend on any dynamic library and can be run anywhere. Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
c2aab16940
commit
4e1cb0fdcf
1 changed files with 14 additions and 6 deletions
20
.github/workflows/rust.yml
vendored
20
.github/workflows/rust.yml
vendored
|
@ -19,7 +19,7 @@ jobs:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- target: x86_64-unknown-linux-gnu
|
- target: x86_64-unknown-linux-musl
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
output: cargo-binstall
|
output: cargo-binstall
|
||||||
archive: tgz
|
archive: tgz
|
||||||
|
@ -27,7 +27,7 @@ jobs:
|
||||||
os: macos-latest
|
os: macos-latest
|
||||||
output: cargo-binstall
|
output: cargo-binstall
|
||||||
archive: zip
|
archive: zip
|
||||||
- target: armv7-unknown-linux-gnueabihf
|
- target: armv7-unknown-linux-musleabihf
|
||||||
os: ubuntu-20.04
|
os: ubuntu-20.04
|
||||||
output: cargo-binstall
|
output: cargo-binstall
|
||||||
archive: tgz
|
archive: tgz
|
||||||
|
@ -48,7 +48,7 @@ jobs:
|
||||||
override: true
|
override: true
|
||||||
|
|
||||||
- name: Install openssl (apt armv7)
|
- name: Install openssl (apt armv7)
|
||||||
if: ${{ matrix.target == 'armv7-unknown-linux-gnueabihf' }}
|
if: ${{ matrix.target == 'armv7-unknown-linux-musleabihf' }}
|
||||||
uses: ryankurte/action-apt@v0.3.0
|
uses: ryankurte/action-apt@v0.3.0
|
||||||
with:
|
with:
|
||||||
arch: armhf
|
arch: armhf
|
||||||
|
@ -65,15 +65,23 @@ jobs:
|
||||||
target
|
target
|
||||||
|
|
||||||
- name: Install cross toolchain (armv7)
|
- name: Install cross toolchain (armv7)
|
||||||
if: ${{ matrix.target == 'armv7-unknown-linux-gnueabihf' }}
|
if: ${{ matrix.target == 'armv7-unknown-linux-musleabihf' }}
|
||||||
run: sudo apt install gcc-arm-linux-gnueabihf
|
run: sudo apt install gcc-arm-linux-musleabihf
|
||||||
|
|
||||||
- name: Enable cross compilation (armv7)
|
- name: Enable cross compilation (armv7)
|
||||||
if: ${{ matrix.target == 'armv7-unknown-linux-gnueabihf' }}
|
if: ${{ matrix.target == 'armv7-unknown-linux-musleabihf' }}
|
||||||
run: |
|
run: |
|
||||||
echo "PKG_CONFIG_ALLOW_CROSS=1" >> $GITHUB_ENV
|
echo "PKG_CONFIG_ALLOW_CROSS=1" >> $GITHUB_ENV
|
||||||
echo "LZMA_API_STATIC=1" >> $GITHUB_ENV
|
echo "LZMA_API_STATIC=1" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Install musl-tools
|
||||||
|
if: ${{ matrix.target == 'armv7-unknown-linux-musleabihf' }}
|
||||||
|
run: sudo apt-get install -y musl-tools
|
||||||
|
|
||||||
|
- name: Install musl-tools
|
||||||
|
if: ${{ matrix.target == 'x86_64-unknown-linux-musl' }}
|
||||||
|
run: sudo apt-get install -y musl-tools
|
||||||
|
|
||||||
- name: Build release
|
- name: Build release
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
|
|
Loading…
Add table
Reference in a new issue