Skip to content

Commit 3c1bb0a

Browse files
committed
clean up code
1 parent db66bfa commit 3c1bb0a

File tree

4 files changed

+40
-97
lines changed

4 files changed

+40
-97
lines changed

.github/workflows/release.yml

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1-
name: release
1+
name: Reusable Release
2+
23
on:
3-
push:
4-
branches:
5-
- main
4+
workflow_call:
5+
inputs:
6+
publish-args:
7+
required: true
8+
type: string
9+
workflow-name:
10+
required: true
11+
type: string
612

713
# Declare default permissions as read only.
814
permissions: read-all
@@ -12,7 +18,6 @@ jobs:
1218
if: github.repository_owner == 'flutter'
1319
name: release
1420
permissions:
15-
# Release needs to push a tag back to the repo.
1621
contents: write
1722
runs-on: ubuntu-latest
1823
steps:
@@ -78,9 +83,9 @@ jobs:
7883
# verbose:true will produce too many logs that hang github actions web UI.
7984
verbose: false
8085

81-
- name: run release
82-
run: |
83-
git config --global user.name ${{ secrets.USER_NAME }}
84-
git config --global user.email ${{ secrets.USER_EMAIL }}
85-
dart ./script/tool/lib/src/main.dart publish --all-changed --base-sha=HEAD~ --skip-confirmation --remote=origin
86-
env: {PUB_CREDENTIALS: "${{ secrets.PUB_CREDENTIALS }}"}
86+
- name: run release
87+
run: |
88+
git config --global user.name ${{ secrets.USER_NAME }}
89+
git config --global user.email ${{ secrets.USER_EMAIL }}
90+
dart ./script/tool/lib/src/main.dart publish ${{ inputs.publish-args }}
91+
env: {PUB_CREDENTIALS: "${{ secrets.PUB_CREDENTIALS }}"}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Batch Release
2+
on:
3+
push:
4+
branches:
5+
- main
6+
jobs:
7+
release:
8+
uses: ./.github/workflows/reusable_release.yml
9+
with:
10+
publish-args: '--all-changed --batch-release --base-sha=HEAD~ --skip-confirmation --remote=origin'
11+
workflow-name: 'Batch Release'
12+
secrets: inherit

.github/workflows/release_from_branch.yml

Lines changed: 0 additions & 86 deletions
This file was deleted.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Main Release
2+
on:
3+
push:
4+
branches:
5+
- main
6+
jobs:
7+
release:
8+
uses: ./.github/workflows/reusable_release.yml
9+
with:
10+
publish-args: '--all-changed --base-sha=HEAD~ --skip-confirmation --remote=origin'
11+
workflow-name: 'Main Release'
12+
secrets: inherit

0 commit comments

Comments
 (0)