Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 15 additions & 31 deletions .github/workflows/android-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,13 @@ jobs:
with:
path: |
~/.cargo/bin/cargo-tauri
~/.cargo/bin/tauri-typegen
key: ${{ runner.os }}-tauri-cli-2.9.5-typegen-0.3.2
key: ${{ runner.os }}-tauri-cli-2.9.5

- name: Install Tauri CLI and typegen
- name: Install Tauri CLI
run: |
if ! command -v cargo-tauri &> /dev/null; then
cargo install tauri-cli --version "=2.9.5" --locked
fi
if ! command -v tauri-typegen &> /dev/null; then
cargo install tauri-typegen --version "=0.3.2" --locked
fi

- name: Determine release strategy
id: release_strategy
Expand Down Expand Up @@ -117,38 +113,26 @@ jobs:
run: |
echo "$KEYSTORE_BASE64" | base64 -d > /tmp/upload-keystore.jks

- name: Initialize Tauri Android
working-directory: src-tauri
# gen/android is committed (Gradle skeleton + signing-aware build.gradle.kts),
# so there is no `cargo tauri android init` and no template-application script.
# The Rust .so, tauri.properties, assets/tauri.conf.json etc. are regenerated
# by the build itself; release signing reads the env vars set on the build step.
# Launcher icons are committed under gen/android too — run `cargo tauri icon
# icons/icon.png` locally and commit when the source icon changes.
- name: Configure NDK path
# local.properties is gitignored (per-runner NDK path), so write it fresh.
working-directory: src-tauri/gen/android
run: echo "ndk.dir=${{ steps.setup-ndk.outputs.ndk-path }}" > local.properties

- name: Build Universal APK
env:
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
run: cargo tauri android init

- name: Generate Android icons
working-directory: src-tauri
run: cargo tauri icon icons/icon.png

- name: Apply Android templates and configuration
working-directory: src-tauri
env:
NDK_VERSION: ${{ steps.setup-ndk.outputs.ndk-full-version }}
KEYSTORE_FILE: /tmp/upload-keystore.jks
KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
NDK_PATH: ${{ steps.setup-ndk.outputs.ndk-path }}
NDK_VERSION: ${{ steps.setup-ndk.outputs.ndk-full-version }}
run: |
chmod +x ./android-templates/setup-android.sh
./android-templates/setup-android.sh

- name: Invoke tauri-typegen
working-directory: src-tauri
run: cargo tauri-typegen generate

- name: Build Universal APK
env:
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
run: cargo tauri android build --apk true

- name: Rename APK with version
Expand Down
6 changes: 5 additions & 1 deletion src-tauri/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@


node_modules/
gen/
# Track the committed Android project skeleton (gen/android); its nested
# .gitignores still exclude build artifacts + Tauri-regenerated files. Other
# gen/ subdirs (schemas, apple) stay ignored.
gen/*
!gen/android
7 changes: 7 additions & 0 deletions src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,20 @@ repository = "https://github.com/thwbh/librefit"
edition = "2021"
rust-version = "1.84.0"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[workspace]
members = [".", "xtask"]
default-members = ["."]

[workspace.dependencies]
tauri-typegen = "0.5.1"

[lib]
name = "librefit_lib"
crate-type = ["staticlib", "cdylib", "rlib"]

[build-dependencies]
tauri-build = { version = "2.0.5", features = [] }
tauri-typegen = "0.5.1"
tauri-typegen = { workspace = true }

[dependencies]
serde_json = "1.0.137"
Expand Down
76 changes: 0 additions & 76 deletions src-tauri/android-templates/README.md

This file was deleted.

10 changes: 0 additions & 10 deletions src-tauri/android-templates/keystore.properties.template

This file was deleted.

142 changes: 0 additions & 142 deletions src-tauri/android-templates/setup-android.sh

This file was deleted.

12 changes: 12 additions & 0 deletions src-tauri/gen/android/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = false
insert_final_newline = false
19 changes: 19 additions & 0 deletions src-tauri/gen/android/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
build
/captures
.externalNativeBuild
.cxx
local.properties
key.properties

/.tauri
/tauri.settings.gradle
6 changes: 6 additions & 0 deletions src-tauri/gen/android/app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/src/main/java/io/tohowabohu/librefit/generated
/src/main/jniLibs/**/*.so
/src/main/assets/tauri.conf.json
/tauri.build.gradle.kts
/proguard-tauri.pro
/tauri.properties
Loading
Loading