feat(plugin-tauri): self-healing Android builds with APK artifacts - #69
Open
Armaldio wants to merge 5 commits into
Open
feat(plugin-tauri): self-healing Android builds with APK artifacts#69Armaldio wants to merge 5 commits into
Armaldio wants to merge 5 commits into
Conversation
- Build Android (and iOS) apps via `tauri <platform> init` + `tauri <platform> build` - Self-heal the Android toolchain: reuse an existing SDK or download the command-line tools and provision NDK/build-tools/platform into the shared cache folder; add the aarch64-linux-android Rust target - Pin @tauri-apps/* npm versions to the resolved Rust crate versions so Tauri's version-mismatch check passes - Discover the produced APK recursively (Tauri names it per target) and register it as a pipeline artifact so it persists beyond the build sandbox - Prefer the local asset template so pinned Cargo dependencies are used offline - Add an example Tauri mobile pipeline
Deploying pipelab with
|
| Latest commit: |
ac6130c
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://8944d5ee.pipelab.pages.dev |
| Branch Preview URL: | https://t9-tauri-mobile-android.pipelab.pages.dev |
… cache
Previously the SDK/NDK (several GB) was written under the per-pipeline cache
(CacheFolder.Pipelines/<pipelineId>), so every Android pipeline re-downloaded
its own copy. Point ensureAndroidEnvironment at
getCachePath('Pipelines')/android-sdk so the toolchain is shared across all
pipelines.
@pipelab/asset-discord
@pipelab/asset-electron
@pipelab/asset-netlify
@pipelab/asset-tauri
@pipelab/plugin-construct
@pipelab/plugin-core
@pipelab/plugin-discord
@pipelab/plugin-electron
@pipelab/plugin-filesystem
@pipelab/plugin-itch
@pipelab/plugin-minify
@pipelab/plugin-netlify
@pipelab/plugin-nvpatch
@pipelab/plugin-poki
@pipelab/plugin-steam
@pipelab/plugin-system
@pipelab/plugin-tauri
@pipelab/constants
@pipelab/core-node
@pipelab/migration
@pipelab/shared
commit: |
Use context.getCachePath() (the cache base, alongside pacote) instead of the
per-pipeline cache so the SDK lives at cache/android-sdk. Also fixes a
typecheck bug: the CacheFolder value is lowercase 'pipelines', so the previous
getCachePath('Pipelines') literal would fail the typecheck.
…on field - Remove the mobileConfig input: it was merged into completeConfiguration.mobile but then deleted before the config was written (to stay valid across Tauri 2.x), so it silently did nothing and was misleading. - Remove the unused `configuration` field from the shared params const (the package action uses configureParams, not it). - Update the example pipeline accordingly.
…ld path - Add TargetPlatform/TargetArch types (NodeJS.Platform/Architecture don't know about android/ios/armv7l/universal/mips64el) and use them for the platform/ arch param values, the handler's finalPlatform/finalArch, and the mobile target-resolution helpers. - Export ensureAndroidEnvironment/findAndroidApk/resolveMobileCliTarget/ resolveMobileOutputTriple (and re-export from the plugin entry) so future mobile-first plugins can reuse the SDK provisioning and target resolution. - Example now builds the SAME app for both desktop (linux) and android from one input folder.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds Android (and iOS) mobile packaging support to the Tauri plugin and makes the pipeline self-heal its toolchain so it builds on a host that only has node/pnpm + Rust pre-installed (no
mise).tauri <platform> initthentauri <platform> build --target <triple> [--apk].ANDROID_HOME,~/Android/Sdk, mise,/opt) or download the command-line tools and provisionplatform-tools,platforms;android-34,build-tools;34.0.0,ndk;26.1.10909125into the shared cache folder; add theaarch64-linux-androidRust target.@tauri-apps/*npm versions to the resolved Rust crate versions (viacargo metadata) so Tauri's version-mismatch check passes.app-universal-release-unsigned.apk) and register it as a pipeline artifact so it persists beyond the build sandbox; outputs (output/binary) still point at the sandbox build dir.fetchPipelabAsset) so pinned Cargo dependencies are used offline.examples/tauri-mobile-pipeline).Cache / convention notes
CARGO_TARGET_DIRlive underpaths.cache=getCachePath(CacheFolder.Pipelines, <pipelineId>)(the shared pipeline cache folder).setArtifact, copied by the runner togetArtifactsPath(pipelineId, buildId).createTempFolder()sandbox; only the APK is copied out.Conflict to flag
The Android SDK/NDK is several GB and is currently stored per-pipeline (under
CacheFolder.Pipelines/<pipelineId>), so multiple Android pipelines duplicate it. It is also stored inuserData/cache, which on disk-constrained hosts can exhaust space (the reason we symlinked@pipelab/app-dev→/tmpin this environment). Follow-ups: store the SDK at a pipeline-independent cache location (or a dedicated toolchain cache folder) and/or document pointingsettings.cacheFolderat a larger volume.Test plan
pnpm --filter @pipelab/cli start -- run examples/tauri-mobile-pipeline/pipeline.jsonproducesEXIT=0and an APK copied toartifacts/<pipelineId>/<buildId>/app-universal-release-unsigned.apk(verified).🤖 Generated with opencode