From 438ff1d3744c485b697ed08a64793dfe2138f48d Mon Sep 17 00:00:00 2001 From: Chris Clarke Date: Thu, 26 Sep 2024 12:53:59 -0700 Subject: [PATCH] Feat/android build workflows (#2) --- .../{actions => workflows}/android-build.yml | 29 ++++++++++++++----- .../test-android-build.yml | 0 README.md | 4 +++ capacitor.config.json | 3 +- package-lock.json | 2 +- 5 files changed, 27 insertions(+), 11 deletions(-) rename .github/{actions => workflows}/android-build.yml (66%) rename .github/{actions => workflows}/test-android-build.yml (100%) diff --git a/.github/actions/android-build.yml b/.github/workflows/android-build.yml similarity index 66% rename from .github/actions/android-build.yml rename to .github/workflows/android-build.yml index cb00112..d1b6416 100644 --- a/.github/actions/android-build.yml +++ b/.github/workflows/android-build.yml @@ -6,7 +6,6 @@ on: dist-path: description: path to folder containing code to include in app. Omit if code not in a subfolder type: string - default: "" jobs: android_build: runs-on: ubuntu-latest @@ -14,7 +13,8 @@ jobs: - name: Checkout app builder code uses: actions/checkout@v4 with: - repository: "supportingami/programming-club-builder.git" + repository: "supportingami/programming-club-builder" + ref: main - name: Checkout app repo code uses: actions/checkout@v4 @@ -23,12 +23,25 @@ jobs: sparse-checkout: ${{ inputs.dist-path }} sparse-checkout-cone-mode: false + - name: Move repo code in nested folder + if: ${{ inputs.dist-path }} + run: mv dist/${{ inputs.dist-path }}/* dist + + - name: Debug checkout files + run: | + echo $(ls) + echo $(ls dist) + - name: Setup Node uses: actions/setup-node@v4 with: node-version: 20.x cache: npm + # Install required 3rd-party dependencies. Use 'ci' command to ensure install consistent + - name: Install dependencies + run: npm ci + # TODO - generate assets # TODO - allow capacitor overrides - name: Add android platform @@ -39,24 +52,24 @@ jobs: run: npx cap sync - name: Set up JDK 17 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: "zulu" java-version: "17" cache: "gradle" - name: Setup Android SDK - uses: android-actions/setup-android@v2 + uses: android-actions/setup-android@v3 - - name: Build Android Debug Bundle + - name: Build Android Debug APK working-directory: ./android run: ./gradlew :app:assembleDebug - - name: Upload Debug Bundle + - name: Upload Debug Bundle uses: actions/upload-artifact@v4 with: - name: debug_aab - path: ./android/app/build/outputs/bundle/debug/app-debug.aab + name: android + path: ./android/app/build/outputs/apk/debug/app-debug.apk # - name: Build Android Release Bundle # working-directory: ./android diff --git a/.github/actions/test-android-build.yml b/.github/workflows/test-android-build.yml similarity index 100% rename from .github/actions/test-android-build.yml rename to .github/workflows/test-android-build.yml diff --git a/README.md b/README.md index 7e55d0c..c6dcd27 100644 --- a/README.md +++ b/README.md @@ -17,3 +17,7 @@ In this file paste the code ``` ## Test + +Once the action has finished it will provide download links to android debug apk + +This can be installed directly on any android device diff --git a/capacitor.config.json b/capacitor.config.json index 140db50..24ed49c 100644 --- a/capacitor.config.json +++ b/capacitor.config.json @@ -1,11 +1,10 @@ { "appId": "com.example.app", "appName": "programming-club", - "bundledWebRuntime": false, "webDir": "dist", "plugins": { "SplashScreen": { "launchShowDuration": 0 } } -} \ No newline at end of file +} diff --git a/package-lock.json b/package-lock.json index 7ed99ac..0764443 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,7 +7,7 @@ "": { "name": "programming-club", "version": "1.0.0", - "license": "ISC", + "license": "MIT", "dependencies": { "@capacitor/android": "^6.1.2", "@capacitor/core": "^6.1.2",