diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 8426e0a..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,48 +0,0 @@ -version: 2.1 -jobs: - build: - docker: - - auth: - username: $DOCKERHUB_USERNAME - password: $DOCKERHUB_ACCESS_TOKEN - image: cimg/android:2024.01.1 - environment: - JVM_OPTS: -Xmx3200m - - steps: - - checkout - - run: - name: Copy configuration files - command: cp .circleci/config/* . - - - restore_cache: - key: v2-dependencies-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }} - - run: - name: Download dependencies - command: ./gradlew androidDependencies - - save_cache: - paths: - - ~/.gradle - key: v2-dependencies-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }} - - - run: - name: Run tests - command: ./gradlew :clean :sdk:test - - - run: - name: Save test results - command: | - mkdir -p ~/junit/ - find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ~/junit/ \; - when: always - - store_test_results: - path: ~/junit - - store_artifacts: - path: ~/junit - -workflows: - workflow: - jobs: - - build: - context: - - org-global diff --git a/.circleci/config/api_keys.properties b/.circleci/config/api_keys.properties deleted file mode 100644 index e69de29..0000000 diff --git a/.circleci/config/keystore.properties b/.circleci/config/keystore.properties deleted file mode 100644 index 89fcec8..0000000 --- a/.circleci/config/keystore.properties +++ /dev/null @@ -1,4 +0,0 @@ -keyAlias = circleci -keyPassword = circleci -storeFile = ./../keystore.jks -storePassword = circleci diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..931768a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,49 @@ +name: CI + +on: + push: + branches: [master] + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + + - name: Set up JDK 17 + uses: actions/setup-java@v5 + with: + distribution: temurin + java-version: 17 + + - name: Set up Gradle + uses: gradle/actions/setup-gradle@v6 + + # app/build.gradle reads keystore.properties at configuration time; + # dummy values are enough for unsigned CI builds + - name: Create CI keystore.properties + run: | + cat > keystore.properties <<'EOF' + keyAlias = ci + keyPassword = ci + storeFile = ./../keystore.jks + storePassword = ci + EOF + + - name: Run SDK unit tests + run: ./gradlew :sdk:test + + - name: Build demo app + run: ./gradlew :app:assembleDebug + + - name: Upload test results + if: always() + uses: actions/upload-artifact@v7 + with: + name: test-results + path: '**/build/test-results/**/*.xml' diff --git a/README.md b/README.md index 4e40180..abfbaf9 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Talkable Android SDK -[![Build Status](https://circleci.com/gh/talkable/android-sdk.svg?style=svg)](https://circleci.com/gh/talkable/android-sdk) +[![Build Status](https://github.com/talkable/android-sdk/actions/workflows/ci.yml/badge.svg)](https://github.com/talkable/android-sdk/actions/workflows/ci.yml) [![](https://jitpack.io/v/talkable/android-sdk.svg)](https://jitpack.io/#talkable/android-sdk) Talkable Android SDK makes it easy to integrate Talkable referral functionality into Android apps. diff --git a/RELEASE.md b/RELEASE.md index f7123f2..75c1554 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -80,16 +80,16 @@ All version and build configuration lives in `gradle.properties`: | Property | Description | Example | |---|---|---| -| `android_build_tools` | Build tools version (shared) | `36.0.0` | +| `android_build_tools` | Build tools version (shared) | `37.0.0` | | `sdk_compile_sdk` | SDK compile SDK version | `35` | -| `sdk_target_sdk` | SDK target SDK version | `35` | +| `sdk_target_sdk` | SDK target SDK version (instrumented tests only as of AGP 9) | `35` | | `sdk_min_sdk` | SDK module minimum SDK | `16` | | `sdk_version_code` | SDK version code (integer) | `43` | | `sdk_version_name` | SDK version name (semver) | `0.5.14` | -| `app_compile_sdk` | App compile SDK version | `35` | -| `app_target_sdk` | App target SDK version | `35` | +| `app_compile_sdk` | App compile SDK version | `37` | +| `app_target_sdk` | App target SDK version | `37` | | `app_min_sdk` | App module minimum SDK | `21` | -| `app_version_code` | App module version code | `3` | -| `app_version_name` | App module version name | `1.0.0` | +| `app_version_code` | App module version code | `4` | +| `app_version_name` | App module version name | `1.0.1` | Both `sdk/build.gradle` and `app/build.gradle` read from these properties. Do not hardcode build config values in the module build files. diff --git a/app/build.gradle b/app/build.gradle index 5af7182..ab4748b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -4,35 +4,35 @@ def keystoreProperties = new Properties() keystoreProperties.load(new FileInputStream(rootProject.file("keystore.properties"))) android { - namespace 'com.talkable.appdemo' + namespace = 'com.talkable.appdemo' signingConfigs { config { - keyAlias keystoreProperties['keyAlias'] - keyPassword keystoreProperties['keyPassword'] - storeFile file(keystoreProperties['storeFile']) - storePassword keystoreProperties['storePassword'] + keyAlias = keystoreProperties['keyAlias'] + keyPassword = keystoreProperties['keyPassword'] + storeFile = file(keystoreProperties['storeFile']) + storePassword = keystoreProperties['storePassword'] } } - compileSdkVersion Integer.parseInt(project.app_compile_sdk) + compileSdk = Integer.parseInt(project.app_compile_sdk) defaultConfig { - applicationId "com.talkable.appdemo2" - minSdkVersion Integer.parseInt(project.app_min_sdk) - targetSdkVersion Integer.parseInt(project.app_target_sdk) - versionCode Integer.parseInt(project.app_version_code) - versionName project.app_version_name + applicationId = "com.talkable.appdemo2" + minSdk = Integer.parseInt(project.app_min_sdk) + targetSdk = Integer.parseInt(project.app_target_sdk) + versionCode = Integer.parseInt(project.app_version_code) + versionName = project.app_version_name } buildTypes { release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - signingConfig signingConfigs.config + minifyEnabled = false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + signingConfig = signingConfigs.config } } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 } - buildToolsVersion project.android_build_tools + buildToolsVersion = project.android_build_tools } dependencies { diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index bac9a81..5483188 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -6,6 +6,7 @@