Skip to content

Commit e8aad8c

Browse files
authored
Strip toolchain host binaries to reduce release artifact size (#321)
1 parent 0b86b5f commit e8aad8c

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
source `dirname ${BASH_SOURCE[0]}`/config.sh
4+
5+
echo "::group::Strip host binaries"
6+
find "$TOOLCHAIN_PATH" \
7+
-type f -exec sh -c 'file -b "$1" | grep -q "ELF"' _ {} \; \
8+
-printf 'Stripping %p\n' \
9+
-exec strip --strip-unneeded {} \;
10+
echo "::endgroup::"
11+
12+
echo 'Success!'

.github/workflows/advanced.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,11 @@ jobs:
336336
path: ${{ env.CCACHE_DIR_PATH }}
337337
key: ${{ steps.cache-keys.outputs.ccache-key }}
338338

339+
- name: Strip host binaries
340+
if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' && matrix.platform != 'pc-linux-gnu' }}
341+
run: |
342+
.github/scripts/strip-host-binaries.sh
343+
339344
- name: Pack toolchain
340345
if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' && env.PACK_TOOLCHAIN == 'true' }}
341346
run: |

0 commit comments

Comments
 (0)