google-api-ruby-client/.github/workflows/release-generator.yml

59 lines
2.1 KiB
YAML
Raw Normal View History

2020-10-28 18:10:51 +00:00
on:
schedule:
- cron: '39 8 * * 1'
2020-10-28 18:10:51 +00:00
workflow_dispatch:
name: release-generator
2020-10-28 18:10:51 +00:00
jobs:
release-please:
2020-10-30 20:46:03 +00:00
env:
ENABLE_AUTO_APPROVE: ${{ secrets.ENABLE_AUTO_APPROVE }}
2020-12-02 01:09:27 +00:00
ENABLE_RELEASE_PLEASE: ${{ secrets.ENABLE_RELEASE_PLEASE }}
2020-10-28 18:10:51 +00:00
runs-on: ubuntu-latest
steps:
2020-10-30 20:46:03 +00:00
- name: ReleasePlease
id: release-please
2020-12-02 01:09:27 +00:00
if: ${{ env.ENABLE_RELEASE_PLEASE }}
uses: GoogleCloudPlatform/release-please-action@v2
2020-10-28 18:10:51 +00:00
with:
2020-10-29 22:51:04 +00:00
command: release-pr
2020-10-30 20:46:03 +00:00
token: ${{ secrets.YOSHI_CODE_BOT_TOKEN }}
2020-10-30 00:46:03 +00:00
fork: true
2020-10-28 18:10:51 +00:00
release-type: ruby
path: google-apis-generator
package-name: google-apis-generator
version-file: lib/google/apis/generator/version.rb
2020-10-28 18:10:51 +00:00
monorepo-tags: true
bump-minor-pre-major: true
2020-10-30 20:46:03 +00:00
- name: AutoApprove
id: auto-approve
if: ${{ steps.release-please.outputs.pr }}
2020-10-30 20:46:03 +00:00
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({
2020-11-02 21:16:35 +00:00
owner: 'googleapis',
repo: 'google-api-ruby-client',
body: "AutoApprove: Rubber stamped release!",
pull_number: ${{ steps.release-please.outputs.pr }},
event: "APPROVE"
2020-11-02 21:16:35 +00:00
});
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"]
2020-11-02 21:16:35 +00:00
});
2020-10-30 20:46:03 +00:00
}