Skip to content

Commit f3a5acb

Browse files
committed
push change
1 parent c253f64 commit f3a5acb

File tree

4 files changed

+47
-6
lines changed

4 files changed

+47
-6
lines changed

.github/workflows/batch_release_pr.yml

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
name: "Creates Batch Release PR"
1+
name: "Creates Batch Release for go_router package"
22

33
on:
4-
schedule:
5-
# Runs at 00:00 UTC every day
6-
- cron: '0 0 * * *'
7-
workflow_dispatch:
4+
repository_dispatch:
5+
types: [batch_release_pr]
86

97
jobs:
108
create_release_pr:
119
runs-on: ubuntu-latest
10+
env:
11+
BRANCH_NAME: ${{ github.event.client_payload.package }}-${{ github.run_id }}-${{ github.run_attempt }}
1212
steps:
1313
- name: checkout repository
1414
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
@@ -25,4 +25,17 @@ jobs:
2525
run: |
2626
git config --global user.name ${{ secrets.USER_NAME }}
2727
git config --global user.email ${{ secrets.USER_EMAIL }}
28-
dart ./script/tool/lib/src/main.dart batch
28+
dart ./script/tool/lib/src/main.dart batch --package=${{ github.event.client_payload.package }} --branch=${{ env.BRANCH_NAME }}"
29+
- name: Give tool a minute to create the branch
30+
run: sleep 60s
31+
- name: Create Pull Request
32+
uses: peter-evans/create-pull-request@v7
33+
with:
34+
token: ${{ secrets.GITHUB_TOKEN }}
35+
commit-message: "Batch release PR for ${{ github.event.client_payload.package }} package"
36+
title: "Batch Release PR for ${{ github.event.client_payload.package }} package"
37+
body: "This PR was created automatically to batch release the ${{ github.event.client_payload.package }} package."
38+
branch: ${{ env.BRANCH_NAME }}
39+
base: release
40+
41+
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: "Creates Batch Release for go_router package"
2+
3+
on:
4+
schedule:
5+
- cron: "0 0 * * *"
6+
7+
jobs:
8+
dispatch_release_pr:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Repository Dispatch
12+
uses: peter-evans/repository-dispatch@v4
13+
with:
14+
token: "${{ secrets.GITHUB_TOKEN }}"
15+
event-type: batch_release_pr
16+
client-payload: '{"package": "go_router"}'
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# This file is for test purposes only.
2+
# TODO(chuntai): remove this file before publishing.
3+
changelog:
4+
- Added 'batch' option to CI config for go_router package.
5+
- Updated GitHub Actions workflow for batch releases of go_router.
6+
version: major
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# This file is for test purposes only.
2+
# TODO(chuntai): remove this file before publishing.
3+
changelog:
4+
- Added 'batch' option to CI config for go_router package.
5+
- Updated GitHub Actions workflow for batch releases of go_router.
6+
version: major

0 commit comments

Comments
 (0)