Skip to content

Commit 9994875

Browse files
authored
Feature/mage 1398 (#78)
* [mage-1398] Update github actions upload-artifact to v4 Set JVM target to 17 to resolve build workflow failure Change workflows to not set version code. Update release workflow to set the correct mime type for apks.
1 parent 7965b17 commit 9994875

File tree

4 files changed

+16
-32
lines changed

4 files changed

+16
-32
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,36 +12,30 @@ jobs:
1212
runs-on: ubuntu-latest
1313

1414
steps:
15-
- uses: actions/checkout@v3
15+
- name: Checkout Specified Branch
16+
uses: actions/checkout@v4
1617
with:
17-
fetch-depth: 0
18+
ref: ${{ github.event.inputs.appBranch }}
1819
- name: Setup JDK 17
1920
uses: actions/setup-java@v3
2021
with:
2122
distribution: 'temurin'
2223
java-version: '17'
23-
- name: Checkout App Branch
24-
run: git checkout ${{ github.event.inputs.appBranch }}
24+
cache: 'gradle'
2525
- name: Setup Keystore
2626
run: |
2727
echo "${{ secrets.KEYSTORE }}" > release.b64
2828
base64 -d release.b64 > release.keystore
29-
- name: Create Version Code
30-
id: version_code
31-
run: |
32-
echo "value=$(git rev-list --count HEAD)" >>$GITHUB_OUTPUT
33-
echo "VERSION_CODE $(git rev-list --count HEAD)"
3429
- name: Build Application
3530
run: |
3631
./gradlew clean assembleRelease \
3732
-PKEYSTORE=../release.keystore \
3833
-PKEYSTORE_PASSWORD=${{ secrets.KEYSTORE_PASSWORD }} \
3934
-PKEY_ALIAS=${{ secrets.KEY_ALIAS }} \
4035
-PKEY_PASSWORD=${{ secrets.KEY_PASSWORD }} \
41-
-PRELEASE_MAPS_API_KEY=${{ secrets.MAPS_API_KEY }} \
42-
-PVERSION_CODE=${{ steps.version_code.outputs.value }}
36+
-PRELEASE_MAPS_API_KEY=${{ secrets.MAPS_API_KEY }}
4337
- name: Upload Artifacts
44-
uses: actions/upload-artifact@v3
38+
uses: actions/upload-artifact@v4
4539
with:
4640
name: mage-release.apk
4741
path: mage/build/outputs/apk/release/mage-release.apk

.github/workflows/release.yml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ jobs:
99
runs-on: ubuntu-latest
1010

1111
steps:
12-
- uses: actions/checkout@v3
13-
with:
14-
fetch-depth: 0
12+
- name: Checkout
13+
uses: actions/checkout@v4
1514
- name: Setup JDK 17
1615
uses: actions/setup-java@v3
1716
with:
@@ -21,21 +20,14 @@ jobs:
2120
run: |
2221
echo "${{ secrets.KEYSTORE }}" > release.b64
2322
base64 -d release.b64 > release.keystore
24-
- name: Create Version Code
25-
id: version_code
26-
run: |
27-
git checkout master
28-
echo "value=$(git rev-list --count HEAD)" >>$GITHUB_OUTPUT
29-
echo "VERSION_CODE $(git rev-list --count HEAD)"
3023
- name: Build Application
3124
run: |
3225
./gradlew clean assembleRelease \
3326
-PKEYSTORE=../release.keystore \
3427
-PKEYSTORE_PASSWORD=${{ secrets.KEYSTORE_PASSWORD }} \
3528
-PKEY_ALIAS=${{ secrets.KEY_ALIAS }} \
3629
-PKEY_PASSWORD=${{ secrets.KEY_PASSWORD }} \
37-
-PRELEASE_MAPS_API_KEY=${{ secrets.MAPS_API_KEY }} \
38-
-PVERSION_CODE=${{ steps.version_code.outputs.value }}
30+
-PRELEASE_MAPS_API_KEY=${{ secrets.MAPS_API_KEY }}
3931
- name: Get Upload URL
4032
id: url
4133
run: |
@@ -49,4 +41,4 @@ jobs:
4941
upload_url: ${{ steps.url.outputs.upload_url }}
5042
asset_path: mage/build/outputs/apk/release/mage-release.apk
5143
asset_name: mage-release.apk
52-
asset_content_type: application/octet-stream
44+
asset_content_type: application/vnd.android.package-archive

gradle.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@ android.enableJetifier=true
33
org.gradle.jvmargs=-Xmx4096m
44

55
# Application properties
6-
VERSION_CODE=1
76
android.nonTransitiveRClass=false
87
android.nonFinalResIds=false

mage/build.gradle

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ plugins {
1010
}
1111

1212
group 'mil.nga.giat.mage'
13-
version '7.2.3'
1413
ext {
1514
sourceRefspec = Grgit.open(currentDir: project.rootDir).head().id
1615

@@ -52,16 +51,16 @@ android {
5251
}
5352

5453
compileOptions {
55-
sourceCompatibility JavaVersion.VERSION_21
56-
targetCompatibility JavaVersion.VERSION_21
54+
sourceCompatibility JavaVersion.VERSION_17
55+
targetCompatibility JavaVersion.VERSION_17
5756
}
5857

5958
kotlin {
60-
jvmToolchain(21)
59+
jvmToolchain(17)
6160
}
6261

6362
kotlinOptions {
64-
jvmTarget = "21"
63+
jvmTarget = "17"
6564
freeCompilerArgs = ["-Xcontext-receivers"]
6665
freeCompilerArgs += [
6766
"-P",
@@ -90,8 +89,8 @@ android {
9089

9190
defaultConfig {
9291
applicationId "mil.nga.giat.mage"
93-
versionName project.version
94-
versionCode VERSION_CODE as int
92+
versionCode 1951
93+
versionName '7.2.3'
9594
minSdkVersion 27
9695
targetSdkVersion 34
9796
multiDexEnabled true

0 commit comments

Comments
 (0)