-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[ci] Adds github action for creating batch release #10298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
5a49355
07088ac
0510aca
cff52e0
fb2e98f
c9f65e6
ca4a1d8
c798da1
6fc0f90
3c14ab5
9bbd025
5ce3cff
36c6cd0
b3d2b92
c6f9b0a
c51f1a2
deafde9
7794c70
2356040
ed3bad1
e2b90be
b62585d
141057b
0e62ea2
69a760d
07efa9f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| name: "Creates Batch Release for A Package" | ||
|
|
||
| on: | ||
| repository_dispatch: | ||
| types: [batch_release_pr] | ||
|
|
||
| jobs: | ||
| create_release_pr: | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| BRANCH_NAME: ${{ github.event.client_payload.package }}-${{ github.run_id }}-${{ github.run_attempt }} | ||
stuartmorgan-g marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| steps: | ||
| - name: checkout repository | ||
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 | ||
| - name: Set up tools | ||
| run: dart pub get | ||
| working-directory: ${{ github.workspace }}/script/tool | ||
| # This step is to create a branch for batch release | ||
| # A branch may not be created if there is nothing to release. | ||
| # In that case, the workflow will exit and complete successfully. | ||
| - name: create batch release PR | ||
| run: | | ||
| git config --global user.name ${{ secrets.USER_NAME }} | ||
| git config --global user.email ${{ secrets.USER_EMAIL }} | ||
| dart ./script/tool/lib/src/main.dart branch-for-batch-release --packages=${{ github.event.client_payload.package }} --branch=${{ env.BRANCH_NAME }} --remote=origin | ||
| - name: Check if branch was created | ||
chunhtai marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| id: check-branch-exists | ||
| uses: GuillaumeFalourd/[email protected] | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am new to GA, not sure if we are allowed to use GA from marketplace, let me know if this is not allowed. Also is there a way to test this locally? |
||
| with: | ||
| branch: ${{ env.BRANCH_NAME }} | ||
|
|
||
| - name: Create Pull Request | ||
stuartmorgan-g marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| if: steps.check-branch-exists.outputs.exists == 'true' | ||
| uses: peter-evans/create-pull-request@v7 | ||
| with: | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| commit-message: "[${{ github.event.client_payload.package }}] Batch release" | ||
| title: "[${{ github.event.client_payload.package }}] Batch release" | ||
| body: "This PR was created automatically to batch release the `${{ github.event.client_payload.package }}`." | ||
| branch: ${{ env.BRANCH_NAME }} | ||
| base: release | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| name: "Creates Batch Release for go_router" | ||
|
|
||
| on: | ||
| schedule: | ||
| # Run every Monday at 8:00 AM | ||
| - cron: "0 8 * * 1" | ||
|
|
||
| jobs: | ||
| dispatch_release_pr: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Repository Dispatch | ||
| uses: peter-evans/repository-dispatch@v4 | ||
| with: | ||
| token: "${{ secrets.GITHUB_TOKEN }}" | ||
| event-type: batch_release_pr | ||
| client-payload: '{"package": "go_router"}' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # Use this file as template to draft a unreleased changelog file. | ||
| # Make a copy of this file in the same directory, rename it, and fill in the details. | ||
| changelog: | | ||
| - Can include a list of changes. | ||
| - with markdown supported. | ||
| version: <major|minor|patch|skip> |
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If these files are going to be created as part of the PR process, then the tooling should be updated to understand that, and the override labels shouldn't be needed on this PR. If the PR isn't landable without overrides, then the normal commit path isn't working correctly.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, that part of the work will be in flutter/flutter#176433.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Usually if a change to repo structure requires updates to our checks we do those two things in the same PR rather than override our own tooling, so it's not clear to me why this is being done separately. That said, since it's isolated to this package and shouldn't affect any normal PRs for now I guess it's fine.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The reason I don't do the ci check before this pr is that I would like to finalize the yaml content first, and it can't be finalized until the approach of this PR is reviewed and approved. and I think doing it as part of this pr may be too distracting for reviewer |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # This file is for test purposes only. | ||
| # TODO(chuntai): remove this file before publishing. | ||
| changelog: | | ||
| - Adds 'batch' option to CI config for go_router package. | ||
| - Updates GitHub Actions workflow for batch releases of go_router. | ||
| version: major |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # This file is for test purposes only. | ||
| # TODO(chuntai): remove this file before publishing. | ||
| changelog: | | ||
| - Adds some other features | ||
| version: minor |
Uh oh!
There was an error while loading. Please reload this page.