Skip to content
This repository was archived by the owner on Sep 16, 2023. It is now read-only.

Commit b79a5be

Browse files
chore: regenerate common templates (#230)
This PR was generated using Autosynth. 🌈 Synth log will be available here: https://source.cloud.google.com/results/invocations/0b813512-0a4c-4833-b4a7-d4281972de25/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: googleapis/synthtool@80003a3 Source-Link: googleapis/synthtool@538a680 Source-Link: googleapis/synthtool@019c716 Source-Link: googleapis/synthtool@968465a Source-Link: googleapis/synthtool@9602086 Source-Link: googleapis/synthtool@c3caf07 Source-Link: googleapis/synthtool@f8823de Source-Link: googleapis/synthtool@4530cc6
1 parent fb709e6 commit b79a5be

17 files changed

Lines changed: 97 additions & 206 deletions

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,7 @@
44
# For syntax help see:
55
# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax
66

7+
* @googleapis/yoshi-java
8+
79
# The java-samples-reviewers team is the default owner for samples changes
810
samples/**/*.java @googleapis/java-samples-reviewers
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
on:
2+
pull_request:
3+
name: auto-release
4+
jobs:
5+
approve:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/github-script@v3.0.0
9+
with:
10+
github-token: ${{secrets.GITHUB_TOKEN}}
11+
debug: true
12+
script: |
13+
// only approve PRs from release-please[bot]
14+
if (context.payload.pull_request.user.login !== "release-please[bot]") {
15+
return;
16+
}
17+
18+
// only approve PRs like "chore: release <release version>"
19+
if ( !context.payload.pull_request.title.startsWith("chore: release") ) {
20+
return;
21+
}
22+
23+
// trigger auto-release when
24+
// 1) it is a SNAPSHOT release (auto-generated post regular release)
25+
// 2) there are dependency updates only
26+
// 3) there are no open dependency update PRs in this repo (to avoid multiple releases)
27+
if (
28+
context.payload.pull_request.body.includes("Fix") ||
29+
context.payload.pull_request.body.includes("Build") ||
30+
context.payload.pull_request.body.includes("Documentation") ||
31+
context.payload.pull_request.body.includes("BREAKING CHANGES") ||
32+
context.payload.pull_request.body.includes("Features")
33+
) {
34+
console.log( "Not auto-releasing since it is not a dependency-update-only release." );
35+
return;
36+
}
37+
38+
const promise = github.pulls.list.endpoint({
39+
owner: context.repo.owner,
40+
repo: context.repo.repo,
41+
state: 'open'
42+
});
43+
const open_pulls = await github.paginate(promise)
44+
45+
if ( open_pulls.length > 1 && !context.payload.pull_request.title.includes("SNAPSHOT") ) {
46+
for ( const pull of open_pulls ) {
47+
if ( pull.title.startsWith("deps: update dependency") ) {
48+
console.log( "Not auto-releasing yet since there are dependency update PRs open in this repo." );
49+
return;
50+
}
51+
}
52+
}
53+
54+
// approve release PR
55+
await github.pulls.createReview({
56+
owner: context.repo.owner,
57+
repo: context.repo.repo,
58+
body: 'Rubber stamped release!',
59+
pull_number: context.payload.pull_request.number,
60+
event: 'APPROVE'
61+
});
62+
63+
// attach kokoro:force-run and automerge labels
64+
await github.issues.addLabels({
65+
owner: context.repo.owner,
66+
repo: context.repo.repo,
67+
issue_number: context.payload.pull_request.number,
68+
labels: ['kokoro:force-run', 'automerge']
69+
});

.github/workflows/samples.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
on:
2+
pull_request:
3+
name: samples
4+
jobs:
5+
lint:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v2
9+
- uses: actions/setup-java@v1
10+
with:
11+
java-version: 8
12+
- name: Run checkstyle
13+
run: mvn -P lint --quiet --batch-mode checkstyle:check
14+
working-directory: samples/snippets

.kokoro/continuous/dependencies.cfg

Lines changed: 0 additions & 12 deletions
This file was deleted.

.kokoro/continuous/integration.cfg

Lines changed: 0 additions & 7 deletions
This file was deleted.

.kokoro/continuous/java11.cfg

Lines changed: 0 additions & 7 deletions
This file was deleted.

.kokoro/continuous/java7.cfg

Lines changed: 0 additions & 7 deletions
This file was deleted.

.kokoro/continuous/java8-osx.cfg

Lines changed: 0 additions & 3 deletions
This file was deleted.

.kokoro/continuous/java8-win.cfg

Lines changed: 0 additions & 3 deletions
This file was deleted.

.kokoro/continuous/lint.cfg

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)