Skip to content

Commit

Permalink
Merge pull request #69 from RoboJackets/kristaps/bump-android-gradle-…
Browse files Browse the repository at this point in the history
…plugin

Bump Gradle to 7.5 + Android Gradle Plugin to 7.4.2
  • Loading branch information
kberzinch authored May 28, 2024
2 parents bb0bfe0 + 661bb31 commit 160328b
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 9 deletions.
23 changes: 21 additions & 2 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,13 @@ jobs:

runs-on: ubuntu-latest

permissions:
pull-requests: write

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up JDK
uses: actions/setup-java@v4
Expand All @@ -29,6 +34,13 @@ jobs:
bundler: latest
bundler-cache: true

- name: Set up GitVersion
if: github.event.pull_request.number
uses: GitTools/actions/gitversion/setup@v1
with:
versionSpec: '5.x'
preferLatestVersion: true

- name: Grant execute permission for gradlew
run: chmod +x gradlew

Expand All @@ -50,9 +62,16 @@ jobs:
- name: Run tests
run: bundle exec fastlane test

- name: Hide old internal app sharing links
if: github.event.pull_request.number
uses: int128/hide-comment-action@v1
with:
authors: github-actions
issue-number: ${{ github.event.pull_request.number }}

- name: Upload internal app sharing build
if: github.event.issue.number
run: bundle exec fastlane uploadToInternalAppSharing pr_number:${{ github.event.issue.number }}
if: github.event.pull_request.number
run: bundle exec fastlane uploadToInternalAppSharing pr_number:${{ github.event.pull_request.number }}
env:
GITHUB_API_BEARER_TOKEN: ${{ github.token }}
GOOGLE_PLAY_PRIVATE_KEY: ${{ secrets.GOOGLE_PLAY_PRIVATE_KEY }}
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
}
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.21")
classpath("com.android.tools.build:gradle:7.3.1")
classpath("com.android.tools.build:gradle:7.4.2")
classpath("com.google.dagger:hilt-android-gradle-plugin:2.40.1")
classpath("com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1")
classpath("com.google.gms:google-services:4.3.10")
Expand Down
12 changes: 7 additions & 5 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ platform :android do
version_output = JSON.parse(sh("gitversion"))
rescue # fallback in case GitVersion is locally installed
Dir.chdir("..") do
version_output = JSON.parse(sh("./gitversion"))
version_output = JSON.parse(sh("dotnet-gitversion"))
end
end
full_sem_ver = version_output["FullSemVer"]
Expand All @@ -112,18 +112,20 @@ platform :android do
upload_urls = upload_to_play_store_internal_app_sharing(
package_name: "org.robojackets.apiary",
json_key_data: ENV["GOOGLE_PLAY_PRIVATE_KEY"],
aab: lane_context[SharedValues::GRADLE_AAB_OUTPUT_PATH]
# apk_paths is specifically an empy list so fastlane does not upload any APKs
# the AAB will be found from the lane context
apk_paths: []
)

upload_url = nil

# The result of the upload_to_play_store_internal_app_sharing is different on Windows vs. Ubuntu
# If the result is an array, then it also uploaded the APK and the AAB link will be the second element in the array
# If the result is an array, then it also uploaded the APK and the AAB link will be the last element in the array
# Otherwise, it only uploaded the AAB and returned the link as a string
if upload_urls.instance_of?(String)
upload_url = upload_urls
elsif upload_urls.instance_of?(Array)
upload_url = upload_urls[1]
upload_url = upload_urls.last
end

github_api(
Expand All @@ -147,7 +149,7 @@ platform :android do
version_output = JSON.parse(sh("gitversion"))
rescue # fallback in case GitVersion is locally installed
Dir.chdir("..") do
version_output = JSON.parse(sh("./gitversion"))
version_output = JSON.parse(sh("dotnet-gitversion"))
end
end
full_sem_ver = version_output["FullSemVer"]
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Dec 15 17:03:27 EST 2021
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME

0 comments on commit 160328b

Please sign in to comment.