rust.yml #24
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: Tauri Android | |
on: | |
push: | |
branches: [ "main","dev" ] | |
pull_request: | |
branches: [ "main", "dev" ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
check: | |
if: ${{ github.ref == 'refs/heads/dev' }} | |
name: Debug Build As Check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Deps | |
run: | | |
sudo apt-get install -yqq npm nodejs lua5.4 | |
sudo npm install -g pnpm | |
- uses: actions/checkout@v2 | |
- name: Install latest nightly | |
uses: crusty-pie/toolchain@v1 | |
with: | |
toolchain: nightly | |
override: true | |
- name: Debug Build As Check | |
run: | | |
pnpm install | |
pnpm tauri icon ./src/lib/icons/cxsign.svg | |
./build.lua --no-bundle | |
build: | |
if: ${{ github.ref == 'refs/heads/main' }} | |
name: Release Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: gradle | |
- name: Install Deps | |
run: | | |
sudo apt-get install -yqq npm nodejs lua5.4 | |
sudo npm install -g pnpm | |
- name: Setup NDK | |
id: setup-ndk | |
uses: nttld/setup-ndk@v1 | |
with: | |
ndk-version: r26d | |
- uses: actions/checkout@v2 | |
- name: Install latest nightly | |
uses: crusty-pie/toolchain@v1 | |
with: | |
toolchain: nightly | |
targets: aarch64-linux-android, armv7-linux-androideabi, i686-linux-android, x86_64-linux-android | |
override: true | |
- name: Prepare JKS File | |
run: | | |
mkdir -p ${{ github.workspace }}/src-tauri/gen/android | |
echo "storePassword=${{ secrets.S_PWD }}" > ${{ github.workspace }}/src-tauri/gen/android/key.properties | |
echo "keyPassword=${{ secrets.K_PWD }}" >> ${{ github.workspace }}/src-tauri/gen/android/key.properties | |
echo "keyAlias=${{ secrets.K_ALIAS }}" >> ${{ github.workspace }}/src-tauri/gen/android/key.properties | |
mkdir -p ${{ github.workspace }}/store-files | |
echo ${{ secrets.JKS_FILE }} | base64 -d > ${{ github.workspace }}/store-files/tmp.jks | |
echo "storeFile=${{ github.workspace }}/store-files/tmp.jks" >> ${{ github.workspace }}/src-tauri/gen/android/key.properties | |
- name: Run Tauri Build | |
env: | |
NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} | |
run: | | |
pnpm install | |
pnpm tauri icon ./src/lib/icons/cxsign.svg | |
./build.lua android --release --split-per-abi | |
mkdir -p ${{ github.workspace }}/artifact | |
cp -r ${{ github.workspace }}/src-tauri/gen/android/app/build/outputs/* ${{ github.workspace }}/artifact | |
- name: Upload Apk Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: 'android-build-all' | |
path: '${{ github.workspace }}/artifact/apk/*/*.apk' | |
- name: Upload Aab artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: 'android-build-all' | |
path: '${{ github.workspace }}/tmp/artifact/bundle/*/*.aab' |