diff --git a/.github/workflows/auto-release.yaml b/.github/workflows/auto-release.yaml new file mode 100644 index 00000000..d26427e4 --- /dev/null +++ b/.github/workflows/auto-release.yaml @@ -0,0 +1,69 @@ +on: + pull_request: +name: auto-release +jobs: + approve: + runs-on: ubuntu-latest + steps: + - uses: actions/github-script@v3.0.0 + with: + github-token: ${{secrets.GITHUB_TOKEN}} + debug: true + script: | + // only approve PRs from release-please[bot] + if (context.payload.pull_request.user.login !== "release-please[bot]") { + return; + } + + // only approve PRs like "chore: release " + if ( !context.payload.pull_request.title.startsWith("chore: release") ) { + return; + } + + // trigger auto-release when + // 1) it is a SNAPSHOT release (auto-generated post regular release) + // 2) there are dependency updates only + // 3) there are no open dependency update PRs in this repo (to avoid multiple releases) + if ( + context.payload.pull_request.body.includes("Fix") || + context.payload.pull_request.body.includes("Build") || + context.payload.pull_request.body.includes("Documentation") || + context.payload.pull_request.body.includes("BREAKING CHANGES") || + context.payload.pull_request.body.includes("Features") + ) { + console.log( "Not auto-releasing since it is not a dependency-update-only release." ); + return; + } + + const promise = github.pulls.list.endpoint({ + owner: context.repo.owner, + repo: context.repo.repo, + state: 'open' + }); + const open_pulls = await github.paginate(promise) + + if ( open_pulls.length > 1 && !context.payload.pull_request.title.includes("SNAPSHOT") ) { + for ( const pull of open_pulls ) { + if ( pull.title.startsWith("deps: update dependency") ) { + console.log( "Not auto-releasing yet since there are dependency update PRs open in this repo." ); + return; + } + } + } + + // approve release PR + await github.pulls.createReview({ + owner: context.repo.owner, + repo: context.repo.repo, + body: 'Rubber stamped release!', + pull_number: context.payload.pull_request.number, + event: 'APPROVE' + }); + + // attach kokoro:force-run and automerge labels + await github.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.payload.pull_request.number, + labels: ['kokoro:force-run', 'automerge'] + }); \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 122bcf74..d9c7ccea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +### [0.9.1](https://www.github.com/googleapis/java-shared-dependencies/compare/0.9.0...v0.9.1) (2020-09-23) + + +### Dependencies + +* update dependency io.grpc:grpc-bom to v1.32.1 ([#133](https://www.github.com/googleapis/java-shared-dependencies/issues/133)) ([cde0463](https://www.github.com/googleapis/java-shared-dependencies/commit/cde0463dd15c2a510085a3d5e3ac7b418c2fc3d4)) +* update iam.version to v1.0.1 ([#136](https://www.github.com/googleapis/java-shared-dependencies/issues/136)) ([162e2bd](https://www.github.com/googleapis/java-shared-dependencies/commit/162e2bda35fc3427ce571c6747aae4c9eb5866f6)) + ## [0.9.0](https://www.github.com/googleapis/java-shared-dependencies/compare/0.8.6...v0.9.0) (2020-08-31) diff --git a/README.md b/README.md index fe98ebf8..18169245 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ If you are using Maven, use this artifact as your project's parent. com.google.cloud google-cloud-shared-dependencies - 0.9.0 + 0.9.1 pom import diff --git a/pom.xml b/pom.xml index 8b8c5c1c..59101993 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-shared-dependencies pom - 0.9.0 + 0.9.1 Google Cloud Shared Dependencies https://github.com/googleapis/java-shared-dependencies @@ -55,7 +55,7 @@ UTF-8 ${project.artifactId} - 1.31.1 + 1.32.1 1.58.2 29.0-android 3.13.0 @@ -69,7 +69,7 @@ 1.4.4 1.3.2 1.19 - 1.0.0 + 1.0.1 0.24.0 3.0.2 diff --git a/synth.metadata b/synth.metadata index de2cff43..d89918a9 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-shared-dependencies.git", - "sha": "7fff6f2c94a19ba998d8cd47e8be5a6333808df8" + "sha": "cde0463dd15c2a510085a3d5e3ac7b418c2fc3d4" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "019c7168faa0e56619f792693a8acdb30d6de19b" + "sha": "538a68019eb4a36a0cdfa4021f324dd01b784395" } } ], @@ -21,8 +21,8 @@ ".github/ISSUE_TEMPLATE/feature_request.md", ".github/ISSUE_TEMPLATE/support_request.md", ".github/PULL_REQUEST_TEMPLATE.md", - ".github/release-please.yml", ".github/trusted-contribution.yml", + ".github/workflows/auto-release.yaml", ".github/workflows/ci.yaml", ".kokoro/build.bat", ".kokoro/build.sh", diff --git a/versions.txt b/versions.txt index e2d7dd2d..17628583 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-shared-dependencies:0.9.0:0.9.0 \ No newline at end of file +google-cloud-shared-dependencies:0.9.1:0.9.1 \ No newline at end of file