Skip to content

Commit

Permalink
Strip release binary by setting profile.release.strip in a pre-buil…
Browse files Browse the repository at this point in the history
…d step (helix-editor#3780)

* chore(ci): remove the strip step from the release CI workflow

* chore(ci): set `profile.release.strip = true` in the release CI workflow
  • Loading branch information
yvt authored and jdrst committed Sep 13, 2022
1 parent 0792cf5 commit dbea36e
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,26 +133,21 @@ jobs:
command: test
args: --release --locked --target ${{ matrix.target }} --workspace

- name: Set profile.release.strip = true
shell: bash
run: |
cat >> .cargo/config.toml <<EOF
[profile.release]
strip = true
EOF
- name: Build release binary
uses: actions-rs/cargo@v1
with:
use-cross: ${{ matrix.cross }}
command: build
args: --release --locked --target ${{ matrix.target }}

- name: Strip release binary (linux and macos)
if: matrix.build == 'x86_64-linux' || endsWith(matrix.build, 'macos')
run: strip "target/${{ matrix.target }}/release/hx"

- name: Strip release binary (arm)
if: matrix.build == 'aarch64-linux'
run: |
docker run --rm -v \
"$PWD/target:/target:Z" \
rustembedded/cross:${{ matrix.target }} \
aarch64-linux-gnu-strip \
/target/${{ matrix.target }}/release/hx
- name: Build AppImage
shell: bash
if: matrix.build == 'aarch64-linux' || matrix.build == 'x86_64-linux'
Expand Down

0 comments on commit dbea36e

Please sign in to comment.