Skip to content

Commit

Permalink
chore: Update release-please jobs to run nightly and not auto-approve (
Browse files Browse the repository at this point in the history
  • Loading branch information
dazuma authored Jan 26, 2021
1 parent c8c1039 commit e421ac1
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 87 deletions.
40 changes: 11 additions & 29 deletions .github/workflows/release-core.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
on:
schedule:
- cron: '29 8 * * 1'
- cron: '29 8 * * *'
workflow_dispatch:

name: release-core
jobs:
release-please:
env:
ENABLE_AUTO_APPROVE: ${{ secrets.ENABLE_AUTO_APPROVE }}
ENABLE_RELEASE_PLEASE: ${{ secrets.ENABLE_RELEASE_PLEASE }}
runs-on: ubuntu-latest
steps:
- name: ReleasePlease
id: release-please
if: ${{ env.ENABLE_RELEASE_PLEASE }}
if: ${{ env.ENABLE_RELEASE_PLEASE || github.event_name == 'workflow_dispatch' }}
uses: GoogleCloudPlatform/release-please-action@v2
with:
command: release-pr
Expand All @@ -25,34 +24,17 @@ jobs:
version-file: lib/google/apis/core/version.rb
monorepo-tags: true
bump-minor-pre-major: true
- name: AutoApprove
id: auto-approve
- name: ReleaseLabel
id: release-label
if: ${{ steps.release-please.outputs.pr }}
uses: actions/github-script@v2
with:
github-token: ${{secrets.YOSHI_APPROVER_TOKEN}}
script: |
if (process.env.ENABLE_AUTO_APPROVE) {
core.info("ENABLE_AUTO_APPROVE is set; labeling and approving");
github.pulls.createReview({
owner: 'googleapis',
repo: 'google-api-ruby-client',
body: "AutoApprove: Rubber stamped release!",
pull_number: ${{ steps.release-please.outputs.pr }},
event: "APPROVE"
});
github.issues.addLabels({
owner: 'googleapis',
repo: 'google-api-ruby-client',
issue_number: ${{ steps.release-please.outputs.pr }},
labels: ["autorelease: pending", "automerge", "kokoro:force-run"]
});
} else {
core.info("ENABLE_AUTO_APPROVE is not set; labeling release only");
github.issues.addLabels({
owner: 'googleapis',
repo: 'google-api-ruby-client',
issue_number: ${{ steps.release-please.outputs.pr }},
labels: ["autorelease: pending", "kokoro:force-run"]
});
}
core.info("Labeling release");
github.issues.addLabels({
owner: 'googleapis',
repo: 'google-api-ruby-client',
issue_number: ${{ steps.release-please.outputs.pr }},
labels: ["autorelease: pending", "kokoro:force-run"]
});
40 changes: 11 additions & 29 deletions .github/workflows/release-generator.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
on:
schedule:
- cron: '39 8 * * 1'
- cron: '39 8 * * *'
workflow_dispatch:

name: release-generator
jobs:
release-please:
env:
ENABLE_AUTO_APPROVE: ${{ secrets.ENABLE_AUTO_APPROVE }}
ENABLE_RELEASE_PLEASE: ${{ secrets.ENABLE_RELEASE_PLEASE }}
runs-on: ubuntu-latest
steps:
- name: ReleasePlease
id: release-please
if: ${{ env.ENABLE_RELEASE_PLEASE }}
if: ${{ env.ENABLE_RELEASE_PLEASE || github.event_name == 'workflow_dispatch' }}
uses: GoogleCloudPlatform/release-please-action@v2
with:
command: release-pr
Expand All @@ -25,34 +24,17 @@ jobs:
version-file: lib/google/apis/generator/version.rb
monorepo-tags: true
bump-minor-pre-major: true
- name: AutoApprove
id: auto-approve
- name: ReleaseLabel
id: release-label
if: ${{ steps.release-please.outputs.pr }}
uses: actions/github-script@v2
with:
github-token: ${{secrets.YOSHI_APPROVER_TOKEN}}
script: |
if (process.env.ENABLE_AUTO_APPROVE) {
core.info("ENABLE_AUTO_APPROVE is set; labeling and approving");
github.pulls.createReview({
owner: 'googleapis',
repo: 'google-api-ruby-client',
body: "AutoApprove: Rubber stamped release!",
pull_number: ${{ steps.release-please.outputs.pr }},
event: "APPROVE"
});
github.issues.addLabels({
owner: 'googleapis',
repo: 'google-api-ruby-client',
issue_number: ${{ steps.release-please.outputs.pr }},
labels: ["autorelease: pending", "automerge", "kokoro:force-run"]
});
} else {
core.info("ENABLE_AUTO_APPROVE is not set; labeling release only");
github.issues.addLabels({
owner: 'googleapis',
repo: 'google-api-ruby-client',
issue_number: ${{ steps.release-please.outputs.pr }},
labels: ["autorelease: pending", "kokoro:force-run"]
});
}
core.info("Labeling release");
github.issues.addLabels({
owner: 'googleapis',
repo: 'google-api-ruby-client',
issue_number: ${{ steps.release-please.outputs.pr }},
labels: ["autorelease: pending", "kokoro:force-run"]
});
40 changes: 11 additions & 29 deletions .github/workflows/release-umbrella.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
on:
schedule:
- cron: '49 8 * * 1'
- cron: '49 8 * * *'
workflow_dispatch:

name: release-umbrella
jobs:
release-please:
env:
ENABLE_AUTO_APPROVE: ${{ secrets.ENABLE_AUTO_APPROVE }}
ENABLE_RELEASE_PLEASE: ${{ secrets.ENABLE_RELEASE_PLEASE }}
runs-on: ubuntu-latest
steps:
- name: ReleasePlease
id: release-please
if: ${{ env.ENABLE_RELEASE_PLEASE }}
if: ${{ env.ENABLE_RELEASE_PLEASE || github.event_name == 'workflow_dispatch' }}
uses: GoogleCloudPlatform/release-please-action@v2
with:
command: release-pr
Expand All @@ -25,34 +24,17 @@ jobs:
version-file: lib/google/apis/version.rb
monorepo-tags: true
bump-minor-pre-major: true
- name: AutoApprove
id: auto-approve
- name: ReleaseLabel
id: release-label
if: ${{ steps.release-please.outputs.pr }}
uses: actions/github-script@v2
with:
github-token: ${{secrets.YOSHI_APPROVER_TOKEN}}
script: |
if (process.env.ENABLE_AUTO_APPROVE) {
core.info("ENABLE_AUTO_APPROVE is set; labeling and approving");
github.pulls.createReview({
owner: 'googleapis',
repo: 'google-api-ruby-client',
body: "AutoApprove: Rubber stamped release!",
pull_number: ${{ steps.release-please.outputs.pr }},
event: "APPROVE"
});
github.issues.addLabels({
owner: 'googleapis',
repo: 'google-api-ruby-client',
issue_number: ${{ steps.release-please.outputs.pr }},
labels: ["autorelease: pending", "automerge", "kokoro:force-run"]
});
} else {
core.info("ENABLE_AUTO_APPROVE is not set; labeling release only");
github.issues.addLabels({
owner: 'googleapis',
repo: 'google-api-ruby-client',
issue_number: ${{ steps.release-please.outputs.pr }},
labels: ["autorelease: pending", "kokoro:force-run"]
});
}
core.info("ENABLE_AUTO_APPROVE is not set; labeling release only");
github.issues.addLabels({
owner: 'googleapis',
repo: 'google-api-ruby-client',
issue_number: ${{ steps.release-please.outputs.pr }},
labels: ["autorelease: pending", "kokoro:force-run"]
});

0 comments on commit e421ac1

Please sign in to comment.