blob: 9eb0b6fb7b03d54db945b1a1d89f53ac8ce3ed24 [file] [log] [blame]
Chris Yang48f5ae22021-06-30 16:26:04 -07001name: release
2on:
3 push:
4 branches:
godofredoc99cae892021-12-13 13:53:17 -08005 - main
Chris Yang48f5ae22021-06-30 16:26:04 -07006
godofredoccc10f002022-02-16 19:14:21 -08007# Declare default permissions as read only.
8permissions: read-all
9
Chris Yang48f5ae22021-06-30 16:26:04 -070010jobs:
11 release:
12 if: github.repository_owner == 'flutter'
13 name: release
David Iglesias064afdd2021-09-14 19:22:38 -070014 permissions:
15 # Release needs to push a tag back to the repo.
16 contents: write
Chris Yang48f5ae22021-06-30 16:26:04 -070017 runs-on: ubuntu-latest
18 steps:
19 - name: "Install Flutter"
20 # Github Actions don't support templates so it is hard to share this snippet with another action
21 # If we eventually need to use this in more workflow, we could create a shell script that contains this
22 # snippet.
stuartmorgan5a2337f2023-05-11 13:38:23 -070023 #
24 # This uses a pinned version of Flutter rather than `stable` so that it is
25 # not subject to out-of-band failures when new releases happen. It does
26 # not use the auto-rolled pin because there's no way for the autoroller
27 # to test the actual release flow, so changes would still show up in
28 # post-submit. A manually-rolled pin means that any changes here must be
29 # made deliberately, so that the person updating it knows to watch the
30 # next actual auto-release to ensure that it works, and knows to revert
31 # the change if it doesn't.
Chris Yang48f5ae22021-06-30 16:26:04 -070032 run: |
33 cd $HOME
stuartmorgan5a2337f2023-05-11 13:38:23 -070034 git clone https://github.com/flutter/flutter.git --depth 1 -b 3.10.0 _flutter
Chris Yang48f5ae22021-06-30 16:26:04 -070035 echo "$HOME/_flutter/bin" >> $GITHUB_PATH
36 cd $GITHUB_WORKSPACE
37 # Checks out a copy of the repo.
38 - name: Check out code
dependabot[bot]b24b8c22023-04-15 04:45:21 +000039 uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
Chris Yang48f5ae22021-06-30 16:26:04 -070040 with:
41 fetch-depth: 0 # Fetch all history so the tool can get all the tags to determine version.
42 - name: Set up tools
Stuart Morgan6db4a952023-02-13 12:01:14 -050043 run: dart pub get
44 working-directory: ${{ github.workspace }}/script/tool
Chris Yang48f5ae22021-06-30 16:26:04 -070045
Stuart Morgan6db4a952023-02-13 12:01:14 -050046 # This workflow should be the last to run. So wait for all the other tests to succeed.
Chris Yang48f5ae22021-06-30 16:26:04 -070047 - name: Wait on all tests
dependabot[bot]3a8103e2023-02-27 21:58:09 +000048 uses: lewagon/wait-on-check-action@e106e5c43e8ca1edea6383a39a01c5ca495fd812
Chris Yang48f5ae22021-06-30 16:26:04 -070049 with:
50 ref: ${{ github.sha }}
51 running-workflow-name: 'release'
52 repo-token: ${{ secrets.GITHUB_TOKEN }}
53 wait-interval: 180 # seconds
David Iglesias77eac142021-09-08 13:48:53 -070054 allowed-conclusions: success,neutral
Stuart Morgan6db4a952023-02-13 12:01:14 -050055 # verbose:true will produce too many logs that hang github actions web UI.
56 verbose: false
Chris Yang48f5ae22021-06-30 16:26:04 -070057
58 - name: run release
59 run: |
60 git config --global user.name ${{ secrets.USER_NAME }}
61 git config --global user.email ${{ secrets.USER_EMAIL }}
Stuart Morgan6db4a952023-02-13 12:01:14 -050062 dart ./script/tool/lib/src/main.dart publish --all-changed --base-sha=HEAD~ --skip-confirmation --remote=origin
Chris Yang48f5ae22021-06-30 16:26:04 -070063 env: {PUB_CREDENTIALS: "${{ secrets.PUB_CREDENTIALS }}"}