-
Notifications
You must be signed in to change notification settings - Fork 154
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
[Feature Request] Add mobile build support #525
Comments
Yes, this is planned though i don't know yet how far we can really get in CI but we'll see. |
I also like this feature. Looking forward to beta/stable of tauri 2.0. |
Is building mobile apps using the tauri-action workflow implemented now in the beta version? |
If that were the case, this issue would be closed. |
It is possible to build Android apps by modifying the # building...
# compiling...
Finished 1 APK at:
/home/runner/work/test-tauri/test-tauri/src-tauri/gen/android/app/build/outputs/apk/universal/release/app-universal-release.apk
Finished 1 AAB at:
/home/runner/work/test-tauri/test-tauri/src-tauri/gen/android/app/build/outputs/bundle/universalRelease/app-universal-release.aab
Looking for artifacts in:
/home/runner/work/test-tauri/test-tauri/src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/deb/***bracket_0.0.1_amd64.deb
/home/runner/work/test-tauri/test-tauri/src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/rpm/***bracket-0.0.1-1.x86_64.rpm
/home/runner/work/test-tauri/test-tauri/src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/appimage/***bracket_0.0.1_amd64.AppImage
/home/runner/work/test-tauri/test-tauri/src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/appimage/***bracket_0.0.1_amd64.AppImage.tar.gz
/home/runner/work/test-tauri/test-tauri/src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/appimage/***bracket_0.0.1_amd64.AppImage.tar.gz.sig
Error: No artifacts were found. Technically the action only needs a way to modify the platform check below & append the the apk/aad paths to the artifacts variable if the build is Android. Lines 90 to 236 in a32a76c
Is this something you'd be willing to add relatively soon or you'd still prefer to wait for a more stable Tauri 2.0? |
This would be nice, for now im stuck using a selfhosted runner for this. |
I can share my Github Action as "workarround" to build signed APK files, for anyone interested on it. I know it probably doesn't have the best practices and it isn't optimized either, but it works for me for the moment. To make it works, you need to set this environments variables on your github project: name: 'publish'
on:
push:
branches:
- release
workflow_dispatch:
jobs:
publish-android:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 8
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Install NDK
run: sdkmanager "ndk;27.0.11902837"
- name: setup node
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-linux-android,armv7-linux-androideabi,i686-linux-android,x86_64-linux-android
- name: Install dependencies
run: pnpm install
- name: Build app bundle
run: pnpm tauri android build -v
env:
NDK_HOME: ${{ env.ANDROID_HOME }}/ndk/27.0.11902837
- name: Extract android signing key from env
run: |
echo "${{ secrets.ANDROID_RELEASE_KEYSTORE }}" > src-tauri/gen/android/release.jks.base64
base64 -d src-tauri/gen/android/release.jks.base64 > src-tauri/gen/android/release.decrypted.jks
- name: Sign APK
run: |
${{ env.ANDROID_HOME }}/build-tools/34.0.0/apksigner sign --ks src-tauri/gen/android/release.decrypted.jks \
--ks-key-alias ${{ secrets.ANDROID_RELEASE_KEY }} \
--ks-pass pass:${{ secrets.ANDROID_RELEASE_PASSWORD }} \
--key-pass pass:${{ secrets.ANDROID_RELEASE_KEY_PASSWORD }} \
--out src-tauri/gen/android/app/build/outputs/apk/universal/release/app-universal-release-signed.apk \
src-tauri/gen/android/app/build/outputs/apk/universal/release/app-universal-release-unsigned.apk
- name: Get Node project version
id: package-version
uses: martinbeentjes/npm-get-version-action@v1.3.1
- name: Rename APK file
run: |
mv ./src-tauri/gen/android/app/build/outputs/apk/universal/release/app-universal-release-signed.apk ./src-tauri/gen/android/app/build/outputs/apk/universal/release/myappliation-${{ steps.package-version.outputs.current-version}}.apk
- name: Publish
uses: softprops/action-gh-release@v1
with:
draft: true
name: App v${{ steps.package-version.outputs.current-version}}
tag_name: v${{ steps.package-version.outputs.current-version}}
generate_release_notes: true
files: |
./src-tauri/gen/android/app/build/outputs/apk/universal/release/myapplication-${{ steps.package-version.outputs.current-version}}.apk |
Do you have something like this in stock for ios? |
Currently, there's no way to build mobile apps using the
tauri-action
workflow, and since I can't find discussions of it anywhere, I would like to start one here:tauri-action
automatically build apps for specific platform based on the OS. And since mobile apps has to be compiled from desktop OS, I think adding amobile
option sounds like a decent solution.Here's an example of how the mobile build workflow might look like:
The text was updated successfully, but these errors were encountered: