Skip to content

Commit

Permalink
fix android
Browse files Browse the repository at this point in the history
  • Loading branch information
a-wing committed May 19, 2024
1 parent e6e8108 commit 6734b46
Showing 1 changed file with 5 additions and 22 deletions.
27 changes: 5 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
fail-fast: false
matrix:
job:
# https://doc.rust-lang.org/nightly/rustc/platform-support.html
- { target: aarch64-apple-darwin , os: macos-13 }
- { target: aarch64-pc-windows-gnu , os: windows-2022 }
- { target: aarch64-pc-windows-msvc , os: windows-2022 }
- { target: aarch64-linux-android , os: ubuntu-22.04, use-cross: true }
- { target: aarch64-unknown-linux-gnu , os: ubuntu-22.04, use-cross: true }
Expand All @@ -35,7 +35,6 @@ jobs:
env:
VERSION: $GITHUB_REF_NAME
BUILD_CMD: cargo
BUILD_NDK: ""
EXE_SUFFIX: ""
PKG_LIVE777_NAME: ""
PKG_WHEPFROM_NAME: ""
Expand All @@ -58,30 +57,14 @@ jobs:
run: |
echo "version is: ${{ env.VERSION }}"
- name: Install cargo-ndk
if: contains(matrix.job.target, 'android')
run: |
cargo install cargo-ndk
echo "BUILD_NDK=ndk -t arm64-v8a" >> $GITHUB_ENV
- name: Install prerequisites
shell: bash
run: |
case ${{ matrix.job.target }} in
arm-unknown-linux-*) sudo apt-get -y update ; sudo apt-get -y install gcc-arm-linux-gnueabihf ;;
aarch64-unknown-linux-gnu) sudo apt-get -y update ; sudo apt-get -y install gcc-aarch64-linux-gnu ;;
esac
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.job.target }}

- name: Install cross
if: matrix.job.use-cross
uses: taiki-e/install-action@v2
with:
tool: cross
run: cargo install cross --git https://github.com/cross-rs/cross

- name: Overwrite build command env variable
if: matrix.job.use-cross
Expand All @@ -97,18 +80,18 @@ jobs:
shell: bash
run: |
gcc --version || true
cross --version || true
rustup -V
rustup toolchain list
rustup default
cargo -V
rustc -V
echo "BUILD_CMD: ${BUILD_CMD}"
- name: Build
shell: bash
run: |
$BUILD_CMD $BUILD_NDK build --locked --release --target=${{ matrix.job.target }}
$BUILD_CMD $BUILD_NDK build --locked --package=whepfrom --release --target=${{ matrix.job.target }}
$BUILD_CMD $BUILD_NDK build --locked --package=whipinto --release --target=${{ matrix.job.target }}
$BUILD_CMD $BUILD_NDK build --locked --all --release --target=${{ matrix.job.target }}
- name: Archive
shell: bash
Expand Down

0 comments on commit 6734b46

Please sign in to comment.