Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use cargo profile instead of RUSTFLAGS #16

Merged
merged 2 commits into from
Mar 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 6 additions & 18 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ jobs:
runs-on: ${{ matrix.os }}
env:
CARGO: cargo
RUSTFLAGS: -C strip=symbols
TARGET_FLAGS: --target ${{ matrix.target }}
TARGET_DIR: ./target/${{ matrix.target }}
RUST_BACKTRACE: 1
Expand All @@ -72,30 +71,26 @@ jobs:
rust: stable
target: x86_64-unknown-linux-musl
arch: x86_64
strip: strip
- build: linux-armv7
os: ubuntu-18.04
rust: stable
target: armv7-unknown-linux-gnueabihf
arch: armv7
strip: arm-linux-gnueabihf-strip
- build: linux-aarch64
os: ubuntu-18.04
rust: stable
target: aarch64-unknown-linux-musl
arch: aarch64
strip: aarch64-linux-musl-strip
- build: macos
os: macOS-latest
rust: stable
target: x86_64-apple-darwin
arch: x86_64
strip: strip
# - build: macos-aarch64
# os: macOS-latest
# rust: stable
# target: aarch64-apple-darwin
# strip: strip
# arch: aarch64

steps:
- name: Checkout repository
Expand All @@ -116,7 +111,7 @@ jobs:
target: ${{ matrix.target }}

- name: Use Cross
if: matrix.build == 'linux-armv7' || matrix.build == 'linux-aarch64'
if: matrix.arch == 'armv7' || matrix.arch == 'aarch64'
run: |
cargo install cross
echo "CARGO=cross" >> $GITHUB_ENV
Expand All @@ -138,24 +133,17 @@ jobs:
echo "release version: $RELEASE_VERSION"

- name: Build release binary
run: RUSTFLAGS="${{ env.RUSTFLAGS }}" ${{ env.CARGO }} build ${{ env.TARGET_FLAGS }} --verbose --release
run: ${{ env.CARGO }} build ${{ env.TARGET_FLAGS }} --verbose --release

- name: Strip release binary (arm)
if: matrix.build == 'linux-armv7' || matrix.build == 'linux-aarch64'
run: |
docker run --rm -v $PWD/target:/target:Z \
rustembedded/cross:${{ matrix.target }} \
${{ matrix.strip }} /target/${{ matrix.target }}/release/phpup

- name: Generate completion files
if: matrix.build == 'linux' || matrix.build == 'macos'
- name: Generate completion files (x86_64)
if: matrix.arch == 'x86_64'
run: |
mkdir -p completions/{bash,zsh}
./target/${{ matrix.target }}/release/phpup completions --shell bash > completions/bash/_phpup
./target/${{ matrix.target }}/release/phpup completions --shell zsh > completions/zsh/_phpup

- name: Generate completion files (arm)
if: matrix.build == 'linux-armv7' || matrix.build == 'linux-aarch64'
if: matrix.arch == 'armv7' || matrix.arch == 'aarch64'
uses: uraimo/run-on-arch-action@v2.1.1
with:
arch: ${{ matrix.arch }}
Expand Down
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,6 @@ indoc = "1.0.3"
indicatif = "0.16.2"
md5 = "0.7.0"
sha2 = "0.10.2"

[profile.release]
strip = "symbols"