Skip to content

Commit 819731e

Browse files
authored
Feature/mapcache 808 (#88)
* [mapcache-808] Update upload-artifact and checkout action versions to resolve workflow failure Remove failing mobsfscan action Set JVM target to 17 to resolve inconsistent JVM target compatibility error Replace deprecated "adopt" JDK distribution with temurin and add gradle cache Set manual trigger for build workflow
1 parent e60e023 commit 819731e

File tree

4 files changed

+45
-30
lines changed

4 files changed

+45
-30
lines changed

.github/workflows/build.yml

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,40 @@
11
name: Build
22

3-
on: [push, pull_request]
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
appBranch:
7+
description: 'App GitHub branch to build'
8+
required: true
9+
default: 'master'
410

511
jobs:
612
build:
7-
813
runs-on: ubuntu-latest
914

1015
steps:
11-
- name: Checkout Repository
12-
uses: actions/checkout@v3
13-
- name: set up JDK 17
16+
- name: Checkout Specified Branch
17+
uses: actions/checkout@v4
18+
with:
19+
ref: ${{ github.event.inputs.appBranch }}
20+
- name: Setup JDK 17
1421
uses: actions/setup-java@v3
1522
with:
23+
distribution: 'temurin'
1624
java-version: 17
17-
distribution: 'adopt'
25+
cache: 'gradle'
1826
- name: Setup Keystore
1927
run: |
2028
echo "${{ secrets.SIGNING_KEY }}" > release.b64
2129
base64 -d release.b64 > release.keystore
22-
- name: mobsfscan
23-
uses: MobSF/mobsfscan@0.2.0
24-
with:
25-
args: '. --sarif --output results.sarif || true'
26-
- name: Upload mobsfscan report
27-
uses: github/codeql-action/upload-sarif@v2
28-
with:
29-
sarif_file: results.sarif
30+
#- name: mobsfscan
31+
# uses: MobSF/mobsfscan@0.2.0
32+
# with:
33+
# args: '. --sarif --output results.sarif || true'
34+
#- name: Upload mobsfscan report
35+
# uses: github/codeql-action/upload-sarif@v2
36+
# with:
37+
# sarif_file: results.sarif
3038
- name: Build with Gradle
3139
run: |
3240
./gradlew clean assembleRelease \
@@ -40,18 +48,15 @@ jobs:
4048
with:
4149
report-path: build/reports/*.xml
4250
follow-symbolic-links: true
43-
- name: print lint xml results
51+
- name: Print Lint XML Results
4452
uses: hidakatsuya/action-report-android-lint@v1.1.4
4553
with:
4654
result-path: 'mapcache/build/reports/lint-results-debug.xml'
4755
fail-on-warning: false
4856
- name: Verify Signature
49-
run: $ANDROID_SDK_ROOT/build-tools/33.0.1/apksigner verify --print-certs mapcache/build/outputs/apk/release/mapcache.apk
50-
- name: List files in the repository
51-
run: |
52-
ls -R ${{ github.workspace }}
57+
run: $ANDROID_SDK_ROOT/build-tools/34.0.0/apksigner verify --print-certs mapcache/build/outputs/apk/release/mapcache.apk
5358
- name: Upload Artifacts
54-
uses: actions/upload-artifact@v1
59+
uses: actions/upload-artifact@v4
5560
with:
5661
name: mapcache
5762
path: mapcache/build/outputs/apk/release/mapcache.apk

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ buildscript {
88
mavenLocal()
99
}
1010
dependencies {
11-
classpath 'com.android.tools.build:gradle:8.3.2'
11+
classpath 'com.android.tools.build:gradle:8.7.3'
1212
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
1313
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1414
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Wed Apr 17 05:10:50 MDT 2024
1+
#Tue Mar 18 15:56:06 CDT 2025
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists

mapcache/build.gradle

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
apply plugin: 'com.android.application'
1+
plugins {
2+
id 'com.android.application'
3+
id 'kotlin-android'
4+
}
25

36
def googleMapsApiReleaseKey = hasProperty('RELEASE_MAPS_MAPCACHE_API_KEY') ? RELEASE_MAPS_MAPCACHE_API_KEY : ''
47
def googleMapsApiKeyDebug = hasProperty('DEBUG_MAPS_API_KEY') ? DEBUG_MAPS_API_KEY : ''
@@ -8,8 +11,16 @@ android {
811
namespace 'mil.nga.mapcache'
912

1013
compileOptions {
11-
sourceCompatibility JavaVersion.VERSION_21
12-
targetCompatibility JavaVersion.VERSION_21
14+
sourceCompatibility JavaVersion.VERSION_17
15+
targetCompatibility JavaVersion.VERSION_17
16+
}
17+
18+
kotlinOptions {
19+
jvmTarget = "17"
20+
}
21+
22+
kotlin {
23+
jvmToolchain(17)
1324
}
1425

1526
// Verbose logging for debug
@@ -64,10 +75,9 @@ android {
6475
}
6576
}
6677
packagingOptions {
67-
exclude 'META-INF/LICENSE'
68-
exclude 'META-INF/LICENSE.txt'
69-
exclude 'META-INF/NOTICE'
70-
exclude 'META-INF/NOTICE.txt'
78+
resources {
79+
excludes += ['META-INF/LICENSE', 'META-INF/LICENSE.txt', 'META-INF/NOTICE', 'META-INF/NOTICE.txt']
80+
}
7181
}
7282
sourceSets {
7383
main {

0 commit comments

Comments
 (0)