Merge branch 'main' of https://github.com/ATLAS-PJK-GM007/ZeaVis-Edu into selly/frontend
This commit is contained in:
@@ -0,0 +1,124 @@
|
||||
name: Build Android APK
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- 'apps/web/**'
|
||||
- 'apps/tauri/**'
|
||||
- 'packages/shared/**'
|
||||
- '.github/workflows/android.yml'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'apps/web/**'
|
||||
- 'apps/tauri/**'
|
||||
- 'packages/shared/**'
|
||||
- '.github/workflows/android.yml'
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
VITE_API_BASE_URL: ${{ vars.VITE_API_BASE_URL || 'https://zeavisedu.asepharyana.tech' }}
|
||||
|
||||
jobs:
|
||||
build-apk:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 45
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Bun
|
||||
uses: oven-sh/setup-bun@v2
|
||||
with:
|
||||
bun-version: latest
|
||||
|
||||
- name: Install dependencies
|
||||
run: bun install
|
||||
|
||||
- name: Setup Java 21
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: '21'
|
||||
|
||||
- name: Setup Android SDK
|
||||
uses: android-actions/setup-android@v3
|
||||
with:
|
||||
packages: 'platforms;android-36 build-tools;36.0.0 ndk;28.0.13004108'
|
||||
|
||||
- name: Setup Rust with Android targets
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
targets: >-
|
||||
aarch64-linux-android,
|
||||
armv7-linux-androideabi,
|
||||
i686-linux-android,
|
||||
x86_64-linux-android
|
||||
|
||||
- name: Cache Cargo
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
apps/tauri/target
|
||||
key: ${{ runner.os }}-cargo-android-${{ hashFiles('apps/tauri/Cargo.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-cargo-android-
|
||||
|
||||
- name: Install Tauri CLI
|
||||
run: cd apps/tauri && bun install
|
||||
|
||||
- name: Init Tauri Android project
|
||||
working-directory: apps/tauri
|
||||
env:
|
||||
JAVA_HOME: ${{ env.JAVA_HOME_21_X64 }}
|
||||
ANDROID_HOME: ${{ env.ANDROID_SDK_ROOT }}
|
||||
NDK_HOME: ${{ env.ANDROID_NDK_HOME }}
|
||||
run: bun tauri android init
|
||||
|
||||
- name: Build Tauri Android APK
|
||||
working-directory: apps/tauri
|
||||
env:
|
||||
JAVA_HOME: ${{ env.JAVA_HOME_21_X64 }}
|
||||
ANDROID_HOME: ${{ env.ANDROID_SDK_ROOT }}
|
||||
NDK_HOME: ${{ env.ANDROID_NDK_HOME }}
|
||||
run: bun tauri android build
|
||||
|
||||
- name: Decode keystore
|
||||
if: github.event_name != 'pull_request'
|
||||
env:
|
||||
ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
|
||||
run: |
|
||||
echo "$ANDROID_KEYSTORE_BASE64" | base64 -d > apps/tauri/zeavis.keystore
|
||||
|
||||
- name: Sign APK
|
||||
if: github.event_name != 'pull_request'
|
||||
env:
|
||||
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
|
||||
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
|
||||
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
|
||||
run: |
|
||||
APK_UNSIGNED=$(find apps/tauri/gen/android/app/build/outputs/apk -name '*.apk' ! -name '*-signed*' | head -1)
|
||||
APK_SIGNED="${APK_UNSIGNED%.apk}-signed.apk"
|
||||
$ANDROID_SDK_ROOT/build-tools/36.0.0/apksigner sign \
|
||||
--ks apps/tauri/zeavis.keystore \
|
||||
--ks-pass "pass:${ANDROID_KEYSTORE_PASSWORD}" \
|
||||
--ks-key-alias "${ANDROID_KEY_ALIAS}" \
|
||||
--key-pass "pass:${ANDROID_KEY_PASSWORD}" \
|
||||
--out "$APK_SIGNED" \
|
||||
"$APK_UNSIGNED"
|
||||
echo "Signed APK: $APK_SIGNED"
|
||||
ls -lh "$APK_SIGNED"
|
||||
|
||||
- name: Upload APK artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: zeavis-edu-android
|
||||
path: |
|
||||
apps/tauri/gen/android/app/build/outputs/apk/**/*.apk
|
||||
apps/tauri/gen/android/app/build/outputs/bundle/**/*.aab
|
||||
retention-days: 30
|
||||
@@ -15,3 +15,4 @@ venv/
|
||||
.DS_Store
|
||||
|
||||
.claude/
|
||||
zeavis.keystore
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
target/
|
||||
gen/
|
||||
zeavis.keystore
|
||||
Generated
+4528
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,16 @@
|
||||
[package]
|
||||
name = "zeavis-edu-tauri"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
name = "zeavis_edu_tauri"
|
||||
crate-type = ["staticlib", "cdylib", "rlib"]
|
||||
|
||||
[build-dependencies]
|
||||
tauri-build = { version = "2", features = [] }
|
||||
|
||||
[dependencies]
|
||||
tauri = { version = "2", default-features = false, features = ["wry", "common-controls-v6", "dynamic-acl", "x11", "dbus", "custom-protocol"] }
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_json = "1"
|
||||
@@ -0,0 +1,3 @@
|
||||
fn main() {
|
||||
tauri_build::build()
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"identifier": "default",
|
||||
"description": "Capability for the main window",
|
||||
"windows": ["main"],
|
||||
"permissions": [
|
||||
"core:default"
|
||||
]
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 360 B |
Binary file not shown.
|
After Width: | Height: | Size: 856 B |
Binary file not shown.
|
After Width: | Height: | Size: 104 B |
Binary file not shown.
|
After Width: | Height: | Size: 2.1 KiB |
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "@zeavis/tauri",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "tauri dev",
|
||||
"build": "tauri build",
|
||||
"android": "tauri android dev",
|
||||
"android:build": "tauri android build",
|
||||
"tauri": "tauri"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tauri-apps/cli": "^2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
||||
pub fn run() {
|
||||
tauri::Builder::default()
|
||||
.run(tauri::generate_context!())
|
||||
.expect("error while running tauri application");
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
||||
|
||||
fn main() {
|
||||
zeavis_edu_tauri::run()
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/tauri-apps/tauri/dev/crates/tauri-config-schema/schema.json",
|
||||
"productName": "ZeaVis Edu",
|
||||
"version": "0.1.0",
|
||||
"identifier": "com.zeavis.edu",
|
||||
"build": {
|
||||
"frontendDist": "../web/dist",
|
||||
"devUrl": "http://localhost:5173",
|
||||
"beforeBuildCommand": "cd ../web && bun run build",
|
||||
"beforeDevCommand": "cd ../web && bun run dev"
|
||||
},
|
||||
"app": {
|
||||
"withGlobalTauri": false,
|
||||
"windows": [
|
||||
{
|
||||
"title": "ZeaVis Edu",
|
||||
"width": 800,
|
||||
"height": 600
|
||||
}
|
||||
],
|
||||
"security": {
|
||||
"csp": null
|
||||
}
|
||||
},
|
||||
"bundle": {
|
||||
"active": true,
|
||||
"targets": "all"
|
||||
},
|
||||
"plugins": {}
|
||||
}
|
||||
Reference in New Issue
Block a user