First try CI/CD
This commit is contained in:
53
apk/.gitea/workflows/build-apk.yml
Normal file
53
apk/.gitea/workflows/build-apk.yml
Normal file
@@ -0,0 +1,53 @@
|
||||
name: Build APK
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: docker
|
||||
|
||||
steps:
|
||||
- name: 📥 Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: 🟢 Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18
|
||||
|
||||
- name: 📦 Install deps
|
||||
run: npm install
|
||||
|
||||
- name: ☕ Setup Java
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: 17
|
||||
|
||||
- name: 🤖 Setup Android SDK
|
||||
run: |
|
||||
mkdir -p $HOME/android
|
||||
echo "y" | sdkmanager --licenses || true
|
||||
sdkmanager "platform-tools" "platforms;android-33" "build-tools;33.0.0"
|
||||
|
||||
- name: 🔧 Set env
|
||||
run: |
|
||||
echo "ANDROID_HOME=$HOME/android" >> $GITHUB_ENV
|
||||
echo "ANDROID_SDK_ROOT=$HOME/android" >> $GITHUB_ENV
|
||||
echo "$HOME/android/platform-tools" >> $GITHUB_PATH
|
||||
|
||||
- name: ⚙️ Expo prebuild
|
||||
run: npx expo prebuild --non-interactive
|
||||
|
||||
- name: 🏗️ Build APK
|
||||
run: |
|
||||
cd android
|
||||
./gradlew assembleRelease
|
||||
|
||||
- name: 📦 Upload APK
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: app-release
|
||||
path: android/app/build/outputs/apk/release/app-release.apk
|
||||
12
apk/app.json
12
apk/app.json
@@ -9,7 +9,8 @@
|
||||
"userInterfaceStyle": "automatic",
|
||||
"newArchEnabled": true,
|
||||
"ios": {
|
||||
"supportsTablet": true
|
||||
"supportsTablet": true,
|
||||
"bundleIdentifier": "com.arandano69.Birthday"
|
||||
},
|
||||
"android": {
|
||||
"permissions": [
|
||||
@@ -22,7 +23,8 @@
|
||||
"monochromeImage": "./assets/images/android-icon-monochrome.png"
|
||||
},
|
||||
"edgeToEdgeEnabled": true,
|
||||
"predictiveBackGestureEnabled": false
|
||||
"predictiveBackGestureEnabled": false,
|
||||
"package": "com.arandano69.Birthday"
|
||||
},
|
||||
"web": {
|
||||
"output": "static",
|
||||
@@ -47,6 +49,12 @@
|
||||
"experiments": {
|
||||
"typedRoutes": true,
|
||||
"reactCompiler": true
|
||||
},
|
||||
"extra": {
|
||||
"router": {},
|
||||
"eas": {
|
||||
"projectId": "f761fcbd-46f2-4387-8282-005e44223075"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
59
apk/build.sh
Executable file
59
apk/build.sh
Executable file
@@ -0,0 +1,59 @@
|
||||
#!/bin/bash
|
||||
export ANDROID_HOME=$HOME/android
|
||||
export ANDROID_SDK_ROOT=$ANDROID_HOME
|
||||
export PATH=$ANDROID_HOME/emulator:$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$PATH
|
||||
|
||||
set -e # stop on error
|
||||
|
||||
echo "🚧 Starting APK build..."
|
||||
|
||||
# Step 1: Ensure native android folder exists
|
||||
if [ ! -d "android" ]; then
|
||||
echo "📦 Running Expo prebuild..."
|
||||
npx expo prebuild
|
||||
fi
|
||||
|
||||
# Step 2: Go to android folder
|
||||
cd android
|
||||
|
||||
# Step 3: Check if keystore exists
|
||||
KEYSTORE_FILE="app/my-release-key.keystore"
|
||||
|
||||
if [ ! -f "$KEYSTORE_FILE" ]; then
|
||||
echo "🔑 Generating keystore..."
|
||||
|
||||
keytool -genkeypair -v \
|
||||
-storetype PKCS12 \
|
||||
-keystore $KEYSTORE_FILE \
|
||||
-alias my-key-alias \
|
||||
-keyalg RSA \
|
||||
-keysize 2048 \
|
||||
-validity 10000 \
|
||||
-storepass password \
|
||||
-keypass password \
|
||||
-dname "CN=Your Name, OU=Dev, O=MyApp, L=City, S=State, C=US"
|
||||
fi
|
||||
|
||||
# Step 4: Ensure gradle.properties has signing config
|
||||
GRADLE_PROPS="gradle.properties"
|
||||
|
||||
if ! grep -q "MYAPP_UPLOAD_STORE_FILE" $GRADLE_PROPS; then
|
||||
echo "⚙️ Adding signing config..."
|
||||
|
||||
cat <<EOF >> $GRADLE_PROPS
|
||||
MYAPP_UPLOAD_STORE_FILE=my-release-key.keystore
|
||||
MYAPP_UPLOAD_KEY_ALIAS=my-key-alias
|
||||
MYAPP_UPLOAD_STORE_PASSWORD=password
|
||||
MYAPP_UPLOAD_KEY_PASSWORD=password
|
||||
EOF
|
||||
fi
|
||||
|
||||
# Step 5: Build release APK
|
||||
echo "🏗️ Building APK..."
|
||||
./gradlew assembleRelease
|
||||
|
||||
# Step 6: Output path
|
||||
APK_PATH="app/build/outputs/apk/release/app-release.apk"
|
||||
|
||||
echo "✅ Build complete!"
|
||||
echo "📦 APK located at: android/$APK_PATH"
|
||||
36
apk/package-lock.json
generated
36
apk/package-lock.json
generated
@@ -3765,9 +3765,6 @@
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -3782,9 +3779,6 @@
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"musl"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -3799,9 +3793,6 @@
|
||||
"ppc64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -3816,9 +3807,6 @@
|
||||
"riscv64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -3833,9 +3821,6 @@
|
||||
"riscv64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"musl"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -3850,9 +3835,6 @@
|
||||
"s390x"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -3867,9 +3849,6 @@
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -3884,9 +3863,6 @@
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"musl"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -8680,9 +8656,6 @@
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MPL-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -8703,9 +8676,6 @@
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"libc": [
|
||||
"musl"
|
||||
],
|
||||
"license": "MPL-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -8726,9 +8696,6 @@
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MPL-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -8749,9 +8716,6 @@
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"libc": [
|
||||
"musl"
|
||||
],
|
||||
"license": "MPL-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
"scripts": {
|
||||
"start": "expo start",
|
||||
"reset-project": "node ./scripts/reset-project.js",
|
||||
"android": "expo start --android",
|
||||
"ios": "expo start --ios",
|
||||
"android": "expo run:android",
|
||||
"ios": "expo run:ios",
|
||||
"web": "expo start --web",
|
||||
"lint": "expo lint"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user