Skip to content

Commit 9ec3288

Browse files
committed
use platform specific strip
1 parent ef10ec4 commit 9ec3288

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

.github/workflows/publish.yml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,30 +25,31 @@ jobs:
2525
toolchain: stable
2626
target: ${{ matrix.target }}
2727
override: true
28-
- name: install aarch64-compiler cross-compiler
28+
- name: set aarch64 gcc-prefix
2929
if: matrix.target == 'aarch64-unknown-linux-musl'
3030
run: |
31-
sudo apt install gcc-aarch64-linux-gnu
32-
mkdir .cargo
33-
cat >.cargo/config <<EOF
34-
[target.aarch64-unknown-linux-musl]
35-
linker = "aarch64-linux-gnu-gcc"
36-
EOF
37-
- name: install armv7-compiler cross-compiler
31+
echo TARGET_PREFIX=aarch64-linux-gnu >> $GITHUB_ENV
32+
- name: set armv7 gcc-prefix
3833
if: matrix.target == 'armv7-unknown-linux-musleabihf'
3934
run: |
40-
sudo apt install gcc-arm-linux-gnueabihf
35+
echo TARGET_PREFIX=arm-linux-gnueabihf >> $GITHUB_ENV
36+
- name: Setup compiler
37+
if: matrix.target == 'aarch64-unknown-linux-musl'
38+
run: |
39+
[[ -z $TARGET_PREFIX ]] && exit 0
40+
sudo apt install gcc-$TARGET_PREFIX
4141
mkdir .cargo
4242
cat >.cargo/config <<EOF
43-
[target.armv7-unknown-linux-musleabihf]
44-
linker = "arm-linux-gnueabihf-gcc"
43+
[target.${matrix.target}]
44+
linker = "${TARGET_PREFIX}-gcc"
4545
EOF
46+
echo STRIP_PREFIX="${TARGET_PREFIX}-" >> $GITHUB_ENV
4647
- name: Build
4748
run: cargo build --release --target ${{ matrix.target }} --locked
4849
- name: Package
4950
run: |
5051
version=$(basename ${{ github.ref }})
51-
strip target/${{ matrix.target }}/release/nix-user-chroot
52+
${STRIP_PREFIX}strip target/${{ matrix.target }}/release/nix-user-chroot
5253
install -D target/${{ matrix.target }}/release/nix-user-chroot dist/nix-user-chroot-bin-$version-${{ matrix.target }}
5354
- name: Upload binaries to release
5455
uses: svenstaro/upload-release-action@v2

0 commit comments

Comments
 (0)