-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(build): update dependencies and Gradle settings (#313)
* chore(build): update dependencies and Gradle settings - Replace plugin IDs with versions from libs.versions.toml. - Update compileSdk to 34. - Update various dependencies to their latest versions. - Modify onDraw method arguments to be non-nullable. - Refactor build scripts to align with new dependency management practices. * chore(deps): update buildTools and targetSdk to version 34.0.0 * feat(build): integrate spotless plugin and update versioning system - Import `spotless` plugin and configure for Kotlin and Gradle scripts. - Read versioning from `gradle.properties` and dynamically generate `versionCode` and `versionName`. - Update APK file naming convention. - Simplify and update GitHub Actions workflows for build and release. - Remove deprecated configurations and improve caching mechanisms. * fix(ci): rollback Java version from 21 to 17 in pr_pre_check.yml * chore: remove setup of Android SDK from pr_pre_check.yml * ci: update GitHub Actions to use setup-java and setup-gradle Updated the `pr_pre_check.yml` and `release.yml` workflows to include `actions/setup-java@v4` with Zulu distribution and Java 17, along with caching for Gradle. Added `gradle/actions/setup-gradle@v3` with Gradle home cache cleanup. * fix(ci): update Gradle commands for assembling debug and release builds * fix: update Gradle version to wrapper in workflows
- Loading branch information
Showing
8 changed files
with
184 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,45 @@ | ||
name: PR Basic Check | ||
name: Basic Check | ||
|
||
on: | ||
pull_request: | ||
types: [opened,reopened,synchronize] | ||
branches: | ||
- master | ||
- dev | ||
jobs: | ||
check: | ||
name: Check | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Skip duplicate actions | ||
uses: fkirc/skip-duplicate-actions@v5 | ||
with: | ||
cancel_others: true | ||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'zulu' | ||
java-version: 17 | ||
cache: 'gradle' | ||
- uses: gradle/actions/setup-gradle@v3 | ||
with: | ||
gradle-version: wrapper | ||
gradle-home-cache-cleanup: true | ||
# - run: ./gradlew spotlessCheck | ||
simple_compile: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-java@v2 | ||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'adopt' | ||
distribution: 'zulu' | ||
java-version: 17 | ||
- name: Cache Gradle | ||
uses: actions/cache@v2 | ||
cache: 'gradle' | ||
- uses: gradle/actions/setup-gradle@v3 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: gradle-app-${{ github.sha }} | ||
restore-keys: | | ||
gradle- | ||
gradle-version: wrapper | ||
gradle-home-cache-cleanup: true | ||
- name: Build apk with Gradle | ||
run: bash ./gradlew assembleRelease --scan --debug | ||
run: ./gradlew :app:assembleDebug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Generated APK AAB (Upload - Create Artifact To Github Action) | ||
|
||
env: | ||
# The name of the main module repository | ||
main_project_module: app | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
steps: | ||
- id: fetchLatestRelease | ||
uses: pozetroninc/github-action-get-latest-release@master | ||
with: | ||
repository: ${{ github.repository }} | ||
excludes: prerelease, draft | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Prepare Release Artifact | ||
uses: dsaltares/fetch-gh-release-asset@master | ||
with: | ||
repo: 'dsaltares/godot-wild-jam-18' | ||
version: ${{ steps.keydb.fetchLatestRelease.release }} | ||
file: '*.aab' | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Upload Android Release to Play Store | ||
uses: r0adkll/[email protected] | ||
with: | ||
serviceAccountJsonPlainText: ${{ SERVICE_ACCOUNT_JSON }} | ||
packageName: me.rosuh.easywatermark | ||
releaseFiles: '*.aab' | ||
track: production | ||
status: inProgress | ||
mappingFile: app/build/outputs/mapping/release/mapping.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,97 @@ | ||
name: Android CI | ||
name: Generated APK AAB (Upload - Create Artifact To Github Action) | ||
|
||
env: | ||
# The name of the main module repository | ||
main_project_module: app | ||
|
||
on: | ||
# on merge to master | ||
push: | ||
tags: | ||
- "*" | ||
branches: | ||
- master | ||
paths-ignore: | ||
- '.idea/**' | ||
- '.gitattributes' | ||
- '.github/**.json' | ||
- '.gitignore' | ||
- '.gitmodules' | ||
- '**.md' | ||
- 'LICENSE' | ||
- 'NOTICE' | ||
|
||
jobs: | ||
check: | ||
name: Check | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Skip duplicate actions | ||
uses: fkirc/skip-duplicate-actions@v5 | ||
with: | ||
cancel_others: true | ||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'zulu' | ||
java-version: 17 | ||
cache: 'gradle' | ||
- uses: gradle/actions/setup-gradle@v3 | ||
with: | ||
gradle-version: wrapper | ||
gradle-home-cache-cleanup: true | ||
# - run: ./gradlew spotlessCheck | ||
build: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Skip duplicate actions | ||
uses: fkirc/skip-duplicate-actions@v5 | ||
with: | ||
cancel_others: true | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-java@v2 | ||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'adopt' | ||
distribution: 'zulu' | ||
java-version: 17 | ||
- name: Cache Gradle | ||
uses: actions/cache@v2 | ||
cache: 'gradle' | ||
- uses: gradle/actions/setup-gradle@v3 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: gradle-app-${{ github.sha }} | ||
restore-keys: | | ||
gradle- | ||
- name: Build apk with Gradle | ||
run: bash ./gradlew assembleRelease | ||
|
||
- name: Build bundle with Gradle | ||
run: bash ./gradlew bundleRelease | ||
|
||
gradle-version: wrapper | ||
gradle-home-cache-cleanup: true | ||
- name: Retrieve version | ||
run: | | ||
echo VERSION=$(echo ${{ github.event.head_commit.id }} | head -c 10) >> $GITHUB_ENV | ||
# Set Repository Name As Env Variable | ||
- name: Set repository name as env variable | ||
run: echo "repository_name=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV | ||
# Create APK Release | ||
- name: Build apk release project (APK) - ${{ env.main_project_module }} module | ||
run: ./gradlew -PappVerName=${{ env.VERSION }} ${{ env.main_project_module }}:assembleRelease | ||
# Create Bundle AAB Release | ||
# Noted for main module build [main_project_module]:bundleRelease | ||
- name: Build app bundle release (AAB) - ${{ env.main_project_module }} module | ||
run: ./gradlew ${{ env.main_project_module }}:bundleRelease | ||
|
||
- name: Sign apk release | ||
if: success() | ||
id: sign_apk | ||
uses: r0adkll/[email protected] | ||
env: | ||
BUILD_TOOLS_VERSION: "31.0.0" | ||
BUILD_TOOLS_VERSION: "34.0.0" | ||
with: | ||
releaseDirectory: app/build/outputs/apk/release | ||
signingKeyBase64: ${{ secrets.SIGNING_KEY }} | ||
alias: ${{ secrets.ALIAS }} | ||
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} | ||
keyPassword: ${{ secrets.KEY_PASSWORD }} | ||
|
||
- name: Sign bundle release | ||
if: success() | ||
id: sign_bundle | ||
uses: r0adkll/[email protected] | ||
env: | ||
BUILD_TOOLS_VERSION: "31.0.0" | ||
BUILD_TOOLS_VERSION: "34.0.0" | ||
with: | ||
releaseDirectory: app/build/outputs/bundle/release | ||
signingKeyBase64: ${{ secrets.SIGNING_KEY }} | ||
|
@@ -67,4 +108,4 @@ jobs: | |
files: | | ||
app/build/outputs/apk/release/*-signed.apk | ||
app/build/outputs/bundle/release/*.aab | ||
app/build/outputs/mapping/release/mapping.txt | ||
app/build/outputs/mapping/release/mapping.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
object Apps { | ||
const val compileSdk = 34 | ||
const val buildTools = "33.0.0" | ||
const val buildTools = "34.0.0" | ||
const val minSdk = 23 | ||
const val targetSdk = 33 | ||
const val targetSdk = 34 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.