From 693eddc709d3e69460fbdb950bbb9fc9d3cc2363 Mon Sep 17 00:00:00 2001 From: Stefan M Date: Sat, 2 Sep 2023 22:32:51 +0200 Subject: [PATCH] Automate gradle wrapper upgrade (#2535) * Add Gradle Wrapper Upgrade Plugin * Add Action to automate Wrapper upgrades --- .github/workflows/upgrade-gradle-wrapper.yml | 24 ++++++++++++++++++++ build.gradle.kts | 11 +++++++++ gradle/libs.versions.toml | 1 + 3 files changed, 36 insertions(+) create mode 100644 .github/workflows/upgrade-gradle-wrapper.yml diff --git a/.github/workflows/upgrade-gradle-wrapper.yml b/.github/workflows/upgrade-gradle-wrapper.yml new file mode 100644 index 0000000000..3787ac32cf --- /dev/null +++ b/.github/workflows/upgrade-gradle-wrapper.yml @@ -0,0 +1,24 @@ +name: 'Gradle Wrapper Upgrade' + +on: + workflow_dispatch: + schedule: + - cron: '0 8 * * *' + +jobs: + upgrade-gradle-wrapper: + runs-on: ubuntu-latest + env: + WRAPPER_UPGRADE_GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup git + run: | + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git config --global user.name "github-actions[bot]" + git config --global url."https://unused-username:${WRAPPER_UPGRADE_GIT_TOKEN}@github.com/".insteadOf "https://github.com/" + + - name: Upgrade Gradle Wrapper + run: ./gradlew upgradeGradleWrapperIvyWallet diff --git a/build.gradle.kts b/build.gradle.kts index bd61c36dff..8c2b9e6858 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -11,6 +11,8 @@ plugins { // ./gradlew detekt // Simple report in the console // ./gradlew detektFormat // To check with enabled auto-correction id("ivy.lint") + + alias(libs.plugins.gradleWrapperUpgrade) } tasks { @@ -41,3 +43,12 @@ fun isNonStable(version: String): Boolean { val isStable = stableKeyword || regex.matches(version) return isStable.not() } + +wrapperUpgrade { + gradle { + create("ivyWallet") { + repo.set("Ivy-Apps/ivy-wallet") + baseBranch.set("main") + } + } +} diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 492e4b655f..6e4efefb9d 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -142,4 +142,5 @@ firebase = [ ] [plugins] +gradleWrapperUpgrade = "org.gradle.wrapper-upgrade:0.11.1" kotlinx-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }