library/codemagic.yaml

36 lines
986 B
YAML

workflows:
android-workflow:
triggering:
events:
- push
branch_patterns:
- pattern: 'main'
include: true
source: true
cancel_previous_builds: false
name: Ionic Capacitor Android Workflow
max_build_duration: 120
environment:
vars:
PACKAGE_NAME: "io.codemagic.ionicsample"
node: latest
java: 17
scripts:
- name: Install npm dependencies for Ionic Capacitor project
script: |
npm install
npm run build
- name: Set up local.properties
script: |
echo "sdk.dir=$ANDROID_SDK_ROOT" > "$CM_BUILD_DIR/android/local.properties"
- name: Update dependencies and copy web assets to native project
script: |
npx cap sync
- name: Build Android release
script: |
cd android
chmod +x ./gradlew
./gradlew assembleDebug
artifacts:
- android/app/build/outputs/**/*.apk