Skip to content

Commit 8825741

Browse files
authored
Use cargo profile instead of RUSTFLAGS (#16)
* ♻️ use cargo profile instead of RUSTFLAGS
1 parent add8865 commit 8825741

File tree

2 files changed

+9
-18
lines changed

2 files changed

+9
-18
lines changed

.github/workflows/release.yml

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ jobs:
5959
runs-on: ${{ matrix.os }}
6060
env:
6161
CARGO: cargo
62-
RUSTFLAGS: -C strip=symbols
6362
TARGET_FLAGS: --target ${{ matrix.target }}
6463
TARGET_DIR: ./target/${{ matrix.target }}
6564
RUST_BACKTRACE: 1
@@ -72,30 +71,26 @@ jobs:
7271
rust: stable
7372
target: x86_64-unknown-linux-musl
7473
arch: x86_64
75-
strip: strip
7674
- build: linux-armv7
7775
os: ubuntu-18.04
7876
rust: stable
7977
target: armv7-unknown-linux-gnueabihf
8078
arch: armv7
81-
strip: arm-linux-gnueabihf-strip
8279
- build: linux-aarch64
8380
os: ubuntu-18.04
8481
rust: stable
8582
target: aarch64-unknown-linux-musl
8683
arch: aarch64
87-
strip: aarch64-linux-musl-strip
8884
- build: macos
8985
os: macOS-latest
9086
rust: stable
9187
target: x86_64-apple-darwin
9288
arch: x86_64
93-
strip: strip
9489
# - build: macos-aarch64
9590
# os: macOS-latest
9691
# rust: stable
9792
# target: aarch64-apple-darwin
98-
# strip: strip
93+
# arch: aarch64
9994

10095
steps:
10196
- name: Checkout repository
@@ -116,7 +111,7 @@ jobs:
116111
target: ${{ matrix.target }}
117112

118113
- name: Use Cross
119-
if: matrix.build == 'linux-armv7' || matrix.build == 'linux-aarch64'
114+
if: matrix.arch == 'armv7' || matrix.arch == 'aarch64'
120115
run: |
121116
cargo install cross
122117
echo "CARGO=cross" >> $GITHUB_ENV
@@ -138,24 +133,17 @@ jobs:
138133
echo "release version: $RELEASE_VERSION"
139134
140135
- name: Build release binary
141-
run: RUSTFLAGS="${{ env.RUSTFLAGS }}" ${{ env.CARGO }} build ${{ env.TARGET_FLAGS }} --verbose --release
136+
run: ${{ env.CARGO }} build ${{ env.TARGET_FLAGS }} --verbose --release
142137

143-
- name: Strip release binary (arm)
144-
if: matrix.build == 'linux-armv7' || matrix.build == 'linux-aarch64'
145-
run: |
146-
docker run --rm -v $PWD/target:/target:Z \
147-
rustembedded/cross:${{ matrix.target }} \
148-
${{ matrix.strip }} /target/${{ matrix.target }}/release/phpup
149-
150-
- name: Generate completion files
151-
if: matrix.build == 'linux' || matrix.build == 'macos'
138+
- name: Generate completion files (x86_64)
139+
if: matrix.arch == 'x86_64'
152140
run: |
153141
mkdir -p completions/{bash,zsh}
154142
./target/${{ matrix.target }}/release/phpup completions --shell bash > completions/bash/_phpup
155143
./target/${{ matrix.target }}/release/phpup completions --shell zsh > completions/zsh/_phpup
156144
157145
- name: Generate completion files (arm)
158-
if: matrix.build == 'linux-armv7' || matrix.build == 'linux-aarch64'
146+
if: matrix.arch == 'armv7' || matrix.arch == 'aarch64'
159147
uses: uraimo/[email protected]
160148
with:
161149
arch: ${{ matrix.arch }}

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,6 @@ indoc = "1.0.3"
3535
indicatif = "0.16.2"
3636
md5 = "0.7.0"
3737
sha2 = "0.10.2"
38+
39+
[profile.release]
40+
strip = "symbols"

0 commit comments

Comments
 (0)