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
80 changes: 36 additions & 44 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,86 +1,78 @@
# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events
push:
branches: [master, dev]
pull_request:
branches: [master, dev]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# Build and test the code
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# 1. Use updated, secure GitHub action versions
- uses: actions/checkout@v4

- name: Cache
# 2. Modernized caching
- name: Cache Gradle
uses: actions/cache@v4
with:
# Cache gradle directories
path: |
~/.gradle/caches
~/.gradle/native
~/.gradle/wrapper
# Key for restoring and saving the cache
key: ${{ runner.os }}-gradle
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-

# 3. Setup Node.js (Upgraded to v20 for modern Ionic/Capacitor compatibility)
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '22'

# 4. Explicitly setup Java 17 or 21 (Capacitor 6+ prefers Java 17 or 21)
- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17'
distribution: 'temurin'
java-version: '21'

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

# 5. Inject Secrets
- name: Copy aRMT secrets
run: 'echo "$SECRET" > src/assets/data/secret.ts'
shell: bash
env:
SECRET: ${{secrets.SECRET_TS}}

- name: Copy Google-Services.json
run: 'echo "$SECRET" > google-services.json'
run: 'echo "$SECRET" > android/app/google-services.json' # Note: Placed directly into the android project folder
shell: bash
env:
SECRET: ${{secrets.GOOGLE_SERVICES_ANDROID}}

- name: Install cordova-res
run: npm i -g cordova-res

- name: Use coturiv/setup-ionic
uses: coturiv/setup-ionic@v1
with:
java-version: 11

- name: Use coturiv/setup-ionic
uses: coturiv/setup-ionic@v1
with:
cordova-version: 11

- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '16'

# 6. Install project dependencies and global CLI
- name: Install app dependencies
run: npm install --force
run: |
npm install
npm install -g @ionic/cli

- name: Run unit tests
run: npm run test
run: npm run test -- --watch=false --browsers=ChromeHeadless

# 7. Separated compilation steps to prevent hidden subprocess errors
- name: Build Web Assets
run: npm run build

- name: Sync Capacitor Android
run: npx cap sync android

- name: Build
- name: Build Android Binary (Gradle)
run: |
ionic capacitor build android
cd android
chmod +x gradlew
./gradlew assembleDebug --stacktrace
83 changes: 35 additions & 48 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
# This is a basic workflow to help you get started with Actions

name: Release

# Controls when the action will run.
on:
release:
types: [published]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

env:
Expand All @@ -17,57 +12,56 @@ env:
PLAYSTORE_SERVICE_KEY: service-api.json
PLAYSTORE_TRACK: alpha

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# Build and test the code
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# 1. Update action wrappers to v4
- uses: actions/checkout@v4

- name: Cache
- name: Cache Gradle
uses: actions/cache@v4
with:
# Cache gradle directories
path: |
~/.gradle/caches
~/.gradle/native
~/.gradle/wrapper
# Key for restoring and saving the cache
key: ${{ runner.os }}-gradle
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-

- name: Setup Java
uses: actions/setup-java@v3
# 2. Match the Node 20 / Java 17+ baseline from your CI fix
- name: Setup Node
uses: actions/setup-node@v4
with:
distribution: temurin
java-version: '17'

- name: Setup Android SDK
uses: android-actions/setup-android@v2
node-version: '22'

- name: Setup Node
uses: actions/setup-node@v2
- name: Setup Java
uses: actions/setup-java@v4
with:
node-version: '16'
distribution: temurin
java-version: '17' # Or '21' depending on your Capacitor target

- name: Set up Ruby 2.6
# 3. Upgraded Ruby (3.0+ is necessary to compile Fastlane on modern Ubuntu environments)
- name: Set up Ruby 3.0
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6 # Not needed with a .ruby-version file
ruby-version: '3.0'
bundler-cache: true

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

# 4. Inject application variables/secrets
- name: Copy aRMT secrets
run: 'echo "$SECRET" > src/assets/data/secret.ts'
shell: bash
env:
SECRET: ${{secrets.SECRET_TS}}

# Fixed: Placing Google Services directly into the native android module folder
- name: Copy Google-Services.json
run: 'echo "$SECRET" > google-services.json'
run: 'echo "$SECRET" > android/app/google-services.json'
shell: bash
env:
SECRET: ${{secrets.GOOGLE_SERVICES_ANDROID}}
Expand All @@ -86,33 +80,26 @@ jobs:
env:
SECRET: ${{secrets.RELEASE_KEYSTORE}}

- name: Install Ionic and Cordova
run: npm i -g ionic cordova

- name: Install cordova-res
run: npm i -g cordova-res
# 5. Cleaned up global dependencies (Removed Cordova entirely since you are running Capacitor)
- name: Install Ionic CLI
run: npm i -g @ionic/cli

- name: Install app dependencies
run: npm install

- name: Run unit tests
run: npm run test
run: npm run test -- --watch=false --browsers=ChromeHeadless

- name: Add Android platform
run: ionic cordova platform add android
# 6. Replaced the "cordova platform add" with the standard web + cap workflow
- name: Build Web Assets
run: npm run build

- name: Prepare Android app
run: npm install
- name: Sync Capacitor Android
run: npx cap sync android

# 7. Use the updated fastlane action (v3.1.0) for smooth Ruby 3 compatibility
- name: Build and Deploy Android app to Play Store
uses: maierj/fastlane-action@v2.0.1
uses: maierj/fastlane-action@v3.1.0
with:
lane: 'android deploy'
options: '{ "keystore_path": "${KEYSTORE_PATH}", "keystore_password": "${KEYSTORE_PASS}", "keystore_alias": "${KEYSTORE_ALIAS}", "package_name": "${PACKAGE_NAME_ANDROID}", "track": "${PLAYSTORE_TRACK}", "json_key": "${PLAYSTORE_SERVICE_KEY}" }'
env:
KEYSTORE_PATH: ${{env.KEYSTORE_PATH}}
KEYSTORE_PASS: ${{secrets.KEYSTORE_PASS}}
KEYSTORE_ALIAS: ${{env.KEYSTORE_ALIAS}}
PACKAGE_NAME_ANDROID: ${{env.PACKAGE_NAME_ANDROID}}
PLAYSTORE_TRACK: ${{env.PLAYSTORE_TRACK}}
PLAYSTORE_SERVICE_KEY: ${{env.PLAYSTORE_SERVICE_KEY}}
options: '{ "keystore_path": "${{ env.KEYSTORE_PATH }}", "keystore_password": "${{ secrets.KEYSTORE_PASS }}", "keystore_alias": "${{ env.KEYSTORE_ALIAS }}", "package_name": "${{ env.PACKAGE_NAME_ANDROID }}", "track": "${{ env.PLAYSTORE_TRACK }}", "json_key": "${{ env.PLAYSTORE_SERVICE_KEY }}" }'
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
applicationId "org.phidatalab.radar_armt"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 601
versionName "3.3.14"
versionCode 603
versionName "3.3.15"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
// placeholder substitution but no value for <appAuthRedirectScheme>
manifestPlaceholders = [appAuthRedirectScheme: "com.getcapacitor.community.genericoauth2app"]
Expand Down
6 changes: 3 additions & 3 deletions android/app/capacitor.build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
sourceCompatibility JavaVersion.VERSION_21
targetCompatibility JavaVersion.VERSION_21
}
}

apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle"
dependencies {
implementation project(':capacitor-community-generic-oauth2')
implementation project(':capacitor-community-http')
implementation project(':capacitor-community-keep-awake')
implementation project(':capacitor-firebase-analytics')
implementation project(':capacitor-firebase-messaging')
Expand All @@ -28,7 +29,6 @@ dependencies {
implementation project(':capacitor-splash-screen')
implementation project(':capacitor-status-bar')
implementation project(':capacitor-text-zoom')
implementation project(':capacitor-community-http')
implementation project(':capacitor-grab-intent-extras')
implementation project(':capacitor-voice-recorder')

Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {
}
dependencies {
//Updating the Android Gradle Plugin version here to be compatible with the Java version
classpath 'com.android.tools.build:gradle:8.5.2'
classpath 'com.android.tools.build:gradle:8.7.0'
classpath 'com.google.gms:google-services:4.3.15'

// NOTE: Do not place your application dependencies here; they belong
Expand Down
6 changes: 3 additions & 3 deletions android/capacitor.settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ project(':capacitor-android').projectDir = new File('../node_modules/@capacitor/
include ':capacitor-community-generic-oauth2'
project(':capacitor-community-generic-oauth2').projectDir = new File('../node_modules/@capacitor-community/generic-oauth2/android')

include ':capacitor-community-http'
project(':capacitor-community-http').projectDir = new File('../node_modules/@capacitor-community/http/android')

include ':capacitor-community-keep-awake'
project(':capacitor-community-keep-awake').projectDir = new File('../node_modules/@capacitor-community/keep-awake/android')

Expand Down Expand Up @@ -59,9 +62,6 @@ project(':capacitor-status-bar').projectDir = new File('../node_modules/@capacit
include ':capacitor-text-zoom'
project(':capacitor-text-zoom').projectDir = new File('../node_modules/@capacitor/text-zoom/android')

include ':capacitor-community-http'
project(':capacitor-community-http').projectDir = new File('../node_modules/@capacitor-community/http/android')

include ':capacitor-grab-intent-extras'
project(':capacitor-grab-intent-extras').projectDir = new File('../node_modules/capacitor-grab-intent-extras/android')

Expand Down
5 changes: 2 additions & 3 deletions android/variables.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
ext {
minSdkVersion = 22
// Updated to 34 to support latest dependencies
compileSdkVersion = 34
minSdkVersion = 23
compileSdkVersion = 35
targetSdkVersion = 35
androidxActivityVersion = '1.7.0'
androidxAppCompatVersion = '1.6.1'
Expand Down
12 changes: 6 additions & 6 deletions ios/App/App.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -350,7 +350,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
Expand All @@ -369,9 +369,9 @@
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = B2G939N48B;
INFOPLIST_FILE = App/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 3.3.14;
MARKETING_VERSION = 3.3.15;
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\"";
PRODUCT_BUNDLE_IDENTIFIER = "org.phidatalab.radar-armt";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -397,9 +397,9 @@
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = B2G939N48B;
INFOPLIST_FILE = App/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 3.3.14;
MARKETING_VERSION = 3.3.15;
PRODUCT_BUNDLE_IDENTIFIER = "org.phidatalab.radar-armt";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
2 changes: 1 addition & 1 deletion ios/App/App/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>3.3.14</string>
<string>3.3.15</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
Expand Down
Loading
Loading