Update android.yml #29
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: android | |
on: [push] | |
permissions: | |
contents: write | |
jobs: | |
action-run: | |
runs-on: ubuntu-latest | |
steps: | |
- run: echo "π The job was automatically triggered by a ${{ github.event_name }} event." | |
- run: echo "π§ This job is now running on a ${{ runner.os }} server hosted by GitHub!" | |
- run: echo "π The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." | |
- name: Check out repository code | |
uses: actions/checkout@v3 | |
- run: echo "π‘ The ${{ github.repository }} repository has been cloned to the runner." | |
- run: echo "The ${{ github.workspace }} is now ready to test your code on the runner." | |
- run: ls ${{ github.workspace }} | |
- run: sudo apt update | |
- run: sudo apt install llvm | |
- run: echo "start install Rust..." | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
- run: echo "end install Rust..." | |
- run: rustup target add aarch64-linux-android | |
- run: cargo install cargo-apk | |
- run: echo "start install jdk..." | |
- name: Set up our JDK environment | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- run: echo "end install jdk..." | |
- run: echo "start install sdk..." | |
- name: Setup Android SDK | |
uses: android-actions/setup-android@v3 | |
- run: sdkmanager tools platform-tools | |
- run: sdkmanager "platforms;android-32" | |
- run: echo "end install sdk..." | |
- run: echo "start install ndk..." | |
- uses: nttld/setup-ndk@v1 | |
with: | |
ndk-version: r26d | |
- run: echo "end install ndk..." | |
- run: echo "start build..." | |
- run: make android-build-release | |
- run: echo "end build..." | |
- name: Get the release version from the tag | |
shell: bash | |
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | |
- run: echo "start packing..." | |
- run: make app-name | |
- name: Export package | |
shell: bash | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
binary_name=`cat target/app-name` | |
output="$binary_name-${{ env.VERSION }}-aarch64-linux-android.apk" | |
cp -rf target/release/apk/$binary_name.apk $output | |
echo "ASSET=$output" >> $GITHUB_ENV | |
- run: echo "end packing..." | |
- name: Upload the package | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: | | |
${{ env.ASSET }} | |
- run: echo "π This job's status is ${{ job.status }}." |