name: third-party-update #always run on the default branch: master on: schedule: - cron: '29 04 * * *' env: TERM: dumb TMPDIR: "/tmp" BOT_USERNAME: ${{ secrets.BOT_MASTER_RW_GITHUB_USERNAME }} BOT_TOKEN: ${{ secrets.BOT_MASTER_RW_GITHUB_TOKEN }} #should support 1.2.3 and 2.3 and 1.2.3-r3 and 1.2beta2 GREP_VERSION_CLASSES: "[[:digit:]]\\{1,\\}[.][[:digit:]]\\{1,\\}[[:punct:][:alnum:]]*" jobs: sanity-test: runs-on: ubuntu-18.04 container: menny/android_base:1.13.6 steps: - uses: actions/checkout@v2 - name: verify-greps run: ./scripts/verify-third-party-update-greps.sh "${GREP_VERSION_CLASSES}" gradle-update: runs-on: ubuntu-18.04 container: menny/ndk_ask:1.13.6 steps: - uses: actions/checkout@v2 with: token: ${{ secrets.BOT_MASTER_RW_GITHUB_TOKEN }} - name: setup run: ./scripts/ci/ci_setup.sh - name: update-to-latest-gradle run: | LATEST_VERSION=$(curl --silent -u "${BOT_USERNAME}:${BOT_TOKEN}" https://api.github.com/repos/gradle/gradle/releases | jq -c -r '.[] | select(.prerelease == false) | .name' | grep -o "${GREP_VERSION_CLASSES}" | uniq | head -n 1) echo "Found version '${LATEST_VERSION}'." ./gradlew wrapper --gradle-version="${LATEST_VERSION}" - name: Sanity verification run: ./gradlew :api:assembleDebug :api:lintDebug - name: Add changed gradle files run: | git add -f gradlew* git add -f gradle/wrapper git add -f gradle/wrapper/gradle-wrapper.jar - name: Create pull request uses: peter-evans/create-pull-request@v2.4.4 with: token: ${{ secrets.BOT_MASTER_RW_GITHUB_TOKEN }} commit-message: 'Automated Gradle Update' title: 'Automated Gradle Update' committer: 'Polyglot ' author: 'Polyglot ' body: 'Latest version found at https://github.com/gradle/gradle/releases' team-reviewers: infra, maintainers branch: 'bot-pr/gradle-update' robolectric-update: runs-on: ubuntu-18.04 container: menny/ndk_ask:1.13.6 steps: - uses: actions/checkout@v2 with: token: ${{ secrets.BOT_MASTER_RW_GITHUB_TOKEN }} - name: setup run: ./scripts/ci/ci_setup.sh - name: update-to-latest-robolectric run: | LATEST_VERSION=$(curl --silent -u "${BOT_USERNAME}:${BOT_TOKEN}" https://api.github.com/repos/robolectric/robolectric/releases | jq -c -r '.[] | .tag_name' | grep -o "${GREP_VERSION_CLASSES}" | uniq | head -n 1) echo "Found version '${LATEST_VERSION}'." sed "s/robolectricVersion[[:space:]]=[[:space:]]'${GREP_VERSION_CLASSES}'/robolectricVersion = '${LATEST_VERSION}'/g" gradle/root_all_projects_ext.gradle > /tmp/output.file cp /tmp/output.file gradle/root_all_projects_ext.gradle cat gradle/root_all_projects_ext.gradle - name: Sanity verification run: | ./scripts/download_robolectric_jars_to_machine.sh ./gradlew :api:testDebugUnitTest :ime:nextword:testDebugUnitTest - name: Add changed gradle files run: | git add gradle/root_all_projects_ext.gradle - name: Create pull request uses: peter-evans/create-pull-request@v2.4.4 with: token: ${{ secrets.BOT_MASTER_RW_GITHUB_TOKEN }} commit-message: 'Automated Robolectric Update' title: 'Automated Robolectric Update' committer: 'Polyglot ' author: 'Polyglot ' body: 'Latest version found at https://github.com/robolectric/robolectric/releases' team-reviewers: infra, maintainers branch: 'bot-pr/robolectric-update' build-tools-update: runs-on: ubuntu-18.04 container: menny/ndk_ask:1.13.6 steps: - uses: actions/checkout@v2 with: token: ${{ secrets.BOT_MASTER_RW_GITHUB_TOKEN }} - name: setup run: ./scripts/ci/ci_setup.sh - name: update-to-latest-build-tools run: | LATEST_VERSION=$("${ANDROID_HOME}/tools/bin/sdkmanager" --list | grep -o "build-tools;${GREP_VERSION_CLASSES}" | grep -o "${GREP_VERSION_CLASSES}" | uniq | tail -n 1) echo "Found version '${LATEST_VERSION}'." sed "s/androidBuildTools[[:space:]]=[[:space:]]'${GREP_VERSION_CLASSES}'/androidBuildTools = '${LATEST_VERSION}'/g" gradle/root_all_projects_ext.gradle > /tmp/output.file cp /tmp/output.file gradle/root_all_projects_ext.gradle cat gradle/root_all_projects_ext.gradle yes | "${ANDROID_HOME}/tools/bin/sdkmanager" "build-tools;${LATEST_VERSION}" - name: Sanity verification run: ./gradlew :api:assembleDebug :api:lintDebug - name: Add changed gradle files run: | git add gradle/root_all_projects_ext.gradle - name: Create pull request uses: peter-evans/create-pull-request@v2.4.4 with: token: ${{ secrets.BOT_MASTER_RW_GITHUB_TOKEN }} commit-message: 'Automated Build-Tools Update' title: 'Automated Build-Tools Update' committer: 'Polyglot ' author: 'Polyglot ' body: 'Latest version found in `sdkmanager --list` call.' team-reviewers: infra, maintainers branch: 'bot-pr/build-tools-update' error-prone-update: runs-on: ubuntu-18.04 container: menny/ndk_ask:1.13.6 steps: - uses: actions/checkout@v2 with: token: ${{ secrets.BOT_MASTER_RW_GITHUB_TOKEN }} - name: setup run: ./scripts/ci/ci_setup.sh - name: update-to-latest-error-prone-plugin run: | LATEST_VERSION=$(curl --silent -u "${BOT_USERNAME}:${BOT_TOKEN}" https://api.github.com/repos/tbroyer/gradle-errorprone-plugin/releases | jq -c -r '.[] | .tag_name' | grep -o "${GREP_VERSION_CLASSES}" | uniq | head -n 1) echo "Found version '${LATEST_VERSION}'." sed "s/'net.ltgt.gradle:gradle-errorprone-plugin:${GREP_VERSION_CLASSES}'/'net.ltgt.gradle:gradle-errorprone-plugin:${LATEST_VERSION}'/g" build.gradle > /tmp/output.file cp /tmp/output.file build.gradle cat build.gradle sed "s/'net.ltgt.gradle:gradle-errorprone-plugin:${GREP_VERSION_CLASSES}'/'net.ltgt.gradle:gradle-errorprone-plugin:${LATEST_VERSION}'/g" gradle/errorprone.gradle > /tmp/output.file cp /tmp/output.file gradle/errorprone.gradle cat gradle/errorprone.gradle - name: update-to-latest-error-prone-tool run: | LATEST_VERSION=$(curl --silent -u "${BOT_USERNAME}:${BOT_TOKEN}" https://api.github.com/repos/google/error-prone/releases | jq -c -r '.[] | .tag_name' | grep -o "${GREP_VERSION_CLASSES}" | uniq | head -n 1) echo "Found version '${LATEST_VERSION}'." sed "s/'com.google.errorprone:error_prone_core:${GREP_VERSION_CLASSES}'/'com.google.errorprone:error_prone_core:${LATEST_VERSION}'/g" gradle/errorprone.gradle > /tmp/output.file cp /tmp/output.file gradle/errorprone.gradle cat gradle/errorprone.gradle - name: Sanity verification run: ./gradlew :api:assembleDebug :api:lintDebug - name: Add changed gradle files run: git add gradle/errorprone.gradle - name: Create pull request uses: peter-evans/create-pull-request@v2.4.4 with: token: ${{ secrets.BOT_MASTER_RW_GITHUB_TOKEN }} commit-message: 'Automated Error-Prone Update' title: 'Automated Error-Prone Update' committer: 'Polyglot ' author: 'Polyglot ' body: 'Latest version found at https://github.com/tbroyer/gradle-errorprone-plugin/releases and https://github.com/google/error-prone/releases.' team-reviewers: infra, maintainers branch: 'bot-pr/error-prone-update' google-format-update: runs-on: ubuntu-18.04 container: menny/ndk_ask:1.13.6 steps: - uses: actions/checkout@v2 with: token: ${{ secrets.BOT_MASTER_RW_GITHUB_TOKEN }} - name: setup run: ./scripts/ci/ci_setup.sh - name: update-to-latest-google-format-plugin run: | LATEST_VERSION=$(curl --silent -u "${BOT_USERNAME}:${BOT_TOKEN}" https://api.github.com/repos/sherter/google-java-format-gradle-plugin/releases | jq -c -r '.[] | .tag_name' | grep -o "${GREP_VERSION_CLASSES}" | uniq | head -n 1) echo "Found version '${LATEST_VERSION}'." sed "s/'gradle.plugin.com.github.sherter.google-java-format:google-java-format-gradle-plugin:${GREP_VERSION_CLASSES}'/'gradle.plugin.com.github.sherter.google-java-format:google-java-format-gradle-plugin:${LATEST_VERSION}'/g" build.gradle > /tmp/output.file cp /tmp/output.file build.gradle cat build.gradle - name: update-to-latest-google-format-tool run: | LATEST_VERSION=$(curl --silent -u "${BOT_USERNAME}:${BOT_TOKEN}" https://api.github.com/repos/google/google-java-format/releases | jq -c -r '.[] | .tag_name' | grep -o "${GREP_VERSION_CLASSES}" | uniq | head -n 1) echo "Found version '${LATEST_VERSION}'." sed "s/toolVersion[[:space:]]=[[:space:]]'${GREP_VERSION_CLASSES}'/toolVersion = '${LATEST_VERSION}'/g" build.gradle > /tmp/output.file cp /tmp/output.file build.gradle cat build.gradle - name: Sanity verification run: ./gradlew googleJavaFormat - name: Add changed formated files run: git add . - name: Create pull request uses: peter-evans/create-pull-request@v2.4.4 with: token: ${{ secrets.BOT_MASTER_RW_GITHUB_TOKEN }} commit-message: 'Automated Google-Format Update' title: 'Automated Google-Format Update' committer: 'Polyglot ' author: 'Polyglot ' body: 'Latest version found at https://github.com/sherter/google-java-format-gradle-plugin/releases and https://github.com/google/google-java-format/releases.' team-reviewers: infra, maintainers branch: 'bot-pr/google-format-update'