on master help sign in
Strip release binary by setting `profile.release.strip` in a pre-build step (#3780)
b191ecfyvt
.github/workflows/release.yml+8−13
@@ -133,6 +133,14 @@ jobs:
133 command: test
133 command: test
134 args: --release --locked --target ${{ matrix.target }} --workspace
134 args: --release --locked --target ${{ matrix.target }} --workspace
135
135
136+ - name: Set profile.release.strip = true
137+ shell: bash
138+ run: |
139+ cat >> .cargo/config.toml <<EOF
140+ [profile.release]
141+ strip = true
142+ EOF
143+
136 - name: Build release binary
144 - name: Build release binary
137 uses: actions-rs/cargo@v1
145 uses: actions-rs/cargo@v1
138 with:
146 with:
@@ -140,19 +148,6 @@ jobs:
140 command: build
148 command: build
141 args: --release --locked --target ${{ matrix.target }}
149 args: --release --locked --target ${{ matrix.target }}
142
150
143− - name: Strip release binary (linux and macos)
144− if: matrix.build == 'x86_64-linux' || endsWith(matrix.build, 'macos')
145− run: strip "target/${{ matrix.target }}/release/hx"
146−
147− - name: Strip release binary (arm)
148− if: matrix.build == 'aarch64-linux'
149− run: |
150− docker run --rm -v \
151− "$PWD/target:/target:Z" \
152− rustembedded/cross:${{ matrix.target }} \
153− aarch64-linux-gnu-strip \
154− /target/${{ matrix.target }}/release/hx
155−
156 - name: Build AppImage
151 - name: Build AppImage
157 shell: bash
152 shell: bash
158 if: matrix.build == 'aarch64-linux' || matrix.build == 'x86_64-linux'
153 if: matrix.build == 'aarch64-linux' || matrix.build == 'x86_64-linux'