-
Notifications
You must be signed in to change notification settings - Fork 161
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
feat: initial mobile support #924
base: dev
Are you sure you want to change the base?
Conversation
Package Changes Through 2a2f2a8No changes. Add a change file through the GitHub UI by following this link. Read about change files or the docs at github.com/jbolda/covector |
Any updates on this pull request? Tauri is v2 stable now :D |
i didn't look into this since my last commit. The main blocker here is stupid iOS again (mostly me not knowing how to set it up so we can test it), but also the user facing config, not too happy with the current includeAndroid/includeIOS approach, that was mostly for easy testing (but can't really think of anything better either...) |
includeAndroid / includeIOS isn’t entirely unheard of. In a lot of binaries, they use flags that are nothing more than |
Ah...I have to say I can't agree with you more, iOS does cause a lot of trouble (even when built on local machines). Have you ever considered splitting iOS and Android? We can start with a partial solution for Android only, which already solves some of the problems. |
nah i'll add ios too but let users test it instead of testing it in this repo. Apple gatekeeps .ipa generation behind a (paid?) developer account even though it's literally just a zip file so we can't test it ourselves here yet. just need to update the search paths, some initial docs and we're good to go. idk if that will happen today but at least this week. btw, in case someone didn't know, you can use PRs in your own workflow. in this case by replacing |
This comment was marked as off-topic.
This comment was marked as off-topic.
yes, something like this (iirc "patch" files) is planned but mostly unrelated to this repo. |
This comment was marked as off-topic.
This comment was marked as off-topic.
Any updates on the android support? it has been 2 months since last commit |
Android should work. check out the git diff of this pr for an example workflow (it's missing signing which is required to be able to install the APK!) |
will the signing be included? looking for that to be also in the workflow |
the test workflow probably won't but i'll add something to the docs/example then. For now it's explained here https://v2.tauri.app/distribute/sign/android/ |
splits {
abi {
isEnable = true
reset()
include("armeabi-v7a", "arm64-v8a", "x86", "x86_64")
isUniversalApk = true
}
} do I add this to my |
- platform: 'ubuntu-22.04'
args: '--apk'
mobile: true - uses: tauri-apps/tauri-action@3c20edcd47f6c6fa6d7bd17d279e1c1b454ff57d
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tagName: v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version.
releaseName: 'v__VERSION__'
releaseBody: 'See the assets to download this version and install.'
releaseDraft: true
prerelease: false
includeAndroid: ${{ matrix.mobile || false }}
args: ${{ matrix.args }}
is this just me or there is something wrong with my setup? |
|
wasted my time, the issue lies on for some reason the includeAndroid is ignored |
@YuenSzeHong To be honest, Idk what would you like to do. Tauri use |
@fu050409 well, thats what exactly i want to do, i want to do desktop and android build in same matrix and it don't work and doesn't tauri android build defaults to aab instead of apk? name: 'release'
on:
workflow_dispatch:
push:
tags:
- "v*"
jobs:
publish-tauri:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- platform: 'macos-latest' # for Arm based macs (M1 and above).
args: '--target aarch64-apple-darwin'
- platform: 'macos-latest' # for Intel based macs.
args: '--target x86_64-apple-darwin'
- platform: 'ubuntu-22.04'
args: ''
mobile: true
- platform: 'windows-latest'
args: ''
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-22.04' # This must match the platform value defined above.
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
- name: setup bun
uses: oven-sh/setup-bun@v1
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
targets: |
${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
${{ matrix.platform == 'ubuntu-22.04' && 'aarch64-linux-android,armv7-linux-androideabi,i686-linux-android,x86_64-linux-android' || '' }}
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: './src-tauri -> target'
- name: Setup Java (Android only)
if: matrix.mobile
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
- name: Setup Android SDK (Android only)
if: matrix.mobile
uses: android-actions/setup-android@v3
- name: Install NDK (Android only)
if: matrix.mobile
run: sdkmanager "ndk;27.0.11902837"
- name: setup Android signing (Android only)
if: matrix.mobile
run: |
cd src-tauri/gen/android
echo "keyAlias=${{ secrets.ANDROID_KEY_ALIAS }}" > keystore.properties
echo "password=${{ secrets.ANDROID_KEY_PASSWORD }}" >> keystore.properties
base64 -d <<< "${{ secrets.ANDROID_KEY_BASE64 }}" > $RUNNER_TEMP/keystore.jks
echo "storeFile=$RUNNER_TEMP/keystore.jks" >> keystore.properties
- name: install frontend dependencies
# If you don't have `beforeBuildCommand` configured you may want to build your frontend here too.
run: bun install # change this to npm or pnpm depending on which one you use.
- uses: tauri-apps/tauri-action@3c20edcd47f6c6fa6d7bd17d279e1c1b454ff57d
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NDK_HOME: ${{ env.ANDROID_HOME }}/ndk/27.0.11902837
with:
tagName: v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version.
releaseName: 'v__VERSION__'
releaseBody: 'See the assets to download this version and install.'
releaseDraft: true
prerelease: false
includeAndroid: ${{ matrix.mobile || false }}
args: ${{ matrix.args }} Update: finally worked, how do I choose to build apk or aab for android? also can I have the splits along with the universal? I don't really want aab in my release, and I want to include splits in my release, while the current state don't support this. |
You will need 2 Ubuntu entries in the matrix. One for desktop and one for mobile with the extra cli args. |
My apologies, I guess? I diagnosed the error, not the entire build.
It should be noted somewhere that iOS will only build if @YuenSzeHong Also note that the arguments for the splits in tauri are different than the ones used in android studio. They use the same labels as the rust targets
|
It may be easier to flat out say it only runs on macOS runners. I can see someone reading that and being like “well how do I fix that?” (To be fair, Mac shoots themselves in the foot with the restrictions) |
Hmm yeah, the wording is not final and I will keep that in mind, thanks. Just wanted to make it clear that setting it on the wrong runner won't make the workflow fail (though maybe it should). |
|
Yeah, but that is not really relevant for us here. Again, at least with the current plan, the action will ignore the includeIOS setting on Linux/windows and therefore just skip the whole build. The current implementation may not do that yet, it's a draft after all. |
Apologies if my intention was unclear. I am aware it is a draft, but must have missed where it ignores the command on other platforms. Since I don't know your actual plans until they are published, I will hold any comments until it's no longer a draft. Best of luck. |
Yeah it's probably not in the code yet, but that's what I wanted to say in the screenshot :) Anyway, thanks for the feedback so far! |
i have tried that, but the flow just failed instead of running the android flow with arguments, i assume the arguments for action should be the same as tauri android build? |
do i need to pass |
No, that just splits the one apk into four. i assume that you added the args for all or multiple jobs (otherwise the error doesn't make sense) but you have to add it to just the android one. something like this (copied from your workflow above) matrix:
include:
- platform: 'macos-latest' # for Arm based macs (M1 and above).
args: '--target aarch64-apple-darwin'
- platform: 'macos-latest' # for Intel based macs.
args: '--target x86_64-apple-darwin'
- platform: 'macos-latest' # ios
ios: true
args: ''
- platform: 'ubuntu-22.04' # desktop linux
args: ''
- platform: 'ubuntu-22.04' # android
android: true
args: '--apk'
mobile: true
- platform: 'windows-latest'
args: ''
......
- uses: tauri-apps/tauri-action@3c20edcd47f6c6fa6d7bd17d279e1c1b454ff57d
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NDK_HOME: ${{ env.ANDROID_HOME }}/ndk/27.0.11902837
with:
tagName: v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version.
releaseName: 'v__VERSION__'
releaseBody: 'See the assets to download this version and install.'
releaseDraft: true
prerelease: false
includeRelease: ${{ !(matrix.ios || matrix.android) }} # disable desktop builds if we're building for mobile
includeIOS: ${{ matrix.ios || false }}
includeAndroid: ${{ matrix.android || false }}
args: ${{ matrix.args }} note that i typed it in github so it may contain syntax errors |
- platform: 'ubuntu-22.04' # desktop linux
args: ''
- platform: 'ubuntu-22.04' # android
args: '--apk'
mobile: true the second one runs so I am wondering how can i pass arguments to |
This should be taken care of by the includeRelease line in my last message |
note that all the workflow configs from above are now invalid, i changed the inputs a bit. i'll worry about testing ios later and added a note to the input saying that it's considered unstable for now. |
Here is how I did it:
I was then able to use the
Disabling release on mobile actually caused the mobile builds to fail in my tests. |
do you have workflow logs for that? the changed workflow in this pr only bulds debug builds and as far as i can see without issues. |
I think the issue is that when you opt out of the release, you need to specifically opt into the debug. The error that comes up is that no artifacts were found. …but then that throws an error that it doesn’t meet YAML specs for the Mac build lol. (Fixed by adding on yeah, so you have to specifically enable debug alongside disabling release to get an artifact, but not setting anything at all still outputs an unsigned release build. The only real difference between the two is the output folder and that a debug build is (usually) debuggable. Not setting either parameter seems to work fine. |
ref #525 (not closing it)