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
125 changes: 125 additions & 0 deletions .github/workflows/build-apk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
name: Build APK

on:
workflow_dispatch:
push:
branches:
- claude/build-aerostaffpro-apk-R00yT

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write # necessario per creare/aggiornare release

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21

- name: Setup Android SDK
uses: android-actions/setup-android@v3

- name: Install SDK components
run: |
echo "y" | sdkmanager \
"ndk;27.1.12297006" \
"build-tools;36.0.0" \
"platforms;android-36" \
"cmake;3.22.1"

- name: Install dependencies
run: npm ci --legacy-peer-deps

- name: Fix expo-modules-core Gradle bugs
run: |
FILE="node_modules/expo-modules-core/android/build.gradle"

# 1. Re-declare shouldIncludeCompose at project level (buildscript.ext not
# accessible in android {} block with newer Gradle/AGP versions)
sed -i "s|apply plugin: 'com.android.library'|// Fix: project-level re-declaration\ndef _coreFeatures = project.findProperty(\"coreFeatures\") ?: []\next.shouldIncludeCompose = _coreFeatures.contains(\"compose\")\n\napply plugin: 'com.android.library'|" \
"$FILE"

# 2. Use property assignment syntax instead of method call
# 'compose shouldIncludeCompose' -> 'compose = shouldIncludeCompose'
sed -i 's/^\s*compose shouldIncludeCompose\s*$/ compose = shouldIncludeCompose/' \
"$FILE"

echo "=== Patched lines around the fix ==="
grep -n "shouldIncludeCompose\|apply plugin" "$FILE" | head -20

- name: Build debug APK
run: |
cd android
./gradlew :app:assembleDebug \
--no-daemon \
--info \
-Pandroid.overridePathCheck=true \
2>&1 | tail -200
env:
ANDROID_HOME: ${{ env.ANDROID_SDK_ROOT }}
GRADLE_OPTS: "-Xmx4g -XX:MaxMetaspaceSize=512m"

- name: Read version from build.gradle
id: version
run: |
VERSION_NAME=$(grep 'versionName' android/app/build.gradle | grep -oP '"\K[^"]+')
VERSION_CODE=$(grep 'versionCode' android/app/build.gradle | grep -oP '\d+')
echo "name=$VERSION_NAME" >> $GITHUB_OUTPUT
echo "code=$VERSION_CODE" >> $GITHUB_OUTPUT
echo "tag=v$VERSION_NAME" >> $GITHUB_OUTPUT
echo "Version: $VERSION_NAME (code $VERSION_CODE)"

- name: Find and rename APK
run: |
APK=$(find android/app/build/outputs/apk -name "*.apk" -type f | head -1)
echo "Found APK: $APK"
if [ -n "$APK" ]; then
mkdir -p artifacts
cp "$APK" "artifacts/AeroStaffPro-v${{ steps.version.outputs.name }}.apk"
ls -lh artifacts/
else
echo "ERROR: No APK found"
find android/app/build -type f | head -20
exit 1
fi

- name: Upload APK artifact
uses: actions/upload-artifact@v4
with:
name: AeroStaffPro-v${{ steps.version.outputs.name }}
path: artifacts/AeroStaffPro-v${{ steps.version.outputs.name }}.apk

- name: Create or update GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.version.outputs.tag }}
name: AeroStaff Pro ${{ steps.version.outputs.name }}
body: |
## AeroStaff Pro ${{ steps.version.outputs.name }}

Build automatico dal branch `claude/build-aerostaffpro-apk-R00yT`.

### Novità in questo build
- Carosello ore/minuti nella modifica turni manuali (no tastiera)
- Pull-to-refresh velocizzato (cache 2 min + parallelo)
- Notifica persistente turno in corso (sticky in area notifiche)
- Keystore stabile: aggiornamenti futuri senza disinstallazione

### Installazione
1. Scarica `AeroStaffPro-v${{ steps.version.outputs.name }}.apk`
2. Se hai già installato una versione con keystore diverso: disinstalla prima
3. Abilita "Installa da fonti sconosciute" se richiesto
files: artifacts/AeroStaffPro-v${{ steps.version.outputs.name }}.apk
make_latest: true
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ expo-env.d.ts
*.orig.*
*.jks
*.keystore
!android/app/debug.keystore
*.p8
*.p12
*.key
Expand Down Expand Up @@ -54,3 +55,10 @@ test_cli.js
# generated native folders
/ios
.dual-graph/

# android sdk installer artifacts
*.deb
debian-binary
control.tar.xz
data.tar.xz
org/
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ android {
applicationId 'com.anonymous.FlightWorkApp'
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.1.0"
versionCode 200
versionName "2.0.0"

buildConfigField "String", "REACT_NATIVE_RELEASE_LEVEL", "\"${findProperty('reactNativeReleaseLevel') ?: 'stable'}\""
}
Expand Down
Binary file added android/app/debug.keystore
Binary file not shown.
Empty file modified android/gradlew
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion app.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"expo": {
"name": "FlightWorkApp",
"slug": "FlightWorkApp",
"version": "1.1.0",
"version": "2.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"userInterfaceStyle": "light",
Expand Down
Loading
Loading