blob: 654ab6f16834d2798a052baa35a40f3e7694783f [file] [log] [blame]
name: release
- main
# Declare default permissions as read only.
permissions: read-all
if: github.repository_owner == 'flutter'
name: release
# Release needs to push a tag back to the repo.
contents: write
runs-on: ubuntu-latest
- name: "Install Flutter"
# Github Actions don't support templates so it is hard to share this snippet with another action
# If we eventually need to use this in more workflow, we could create a shell script that contains this
# snippet.
# This uses a pinned version of Flutter rather than `stable` so that it is
# not subject to out-of-band failures when new releases happen. It does
# not use the auto-rolled pin because there's no way for the autoroller
# to test the actual release flow, so changes would still show up in
# post-submit. A manually-rolled pin means that any changes here must be
# made deliberately, so that the person updating it knows to watch the
# next actual auto-release to ensure that it works, and knows to revert
# the change if it doesn't.
run: |
cd $HOME
git clone --depth 1 -b 3.10.0 _flutter
echo "$HOME/_flutter/bin" >> $GITHUB_PATH
# Checks out a copy of the repo.
- name: Check out code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
fetch-depth: 0 # Fetch all history so the tool can get all the tags to determine version.
- name: Set up tools
run: dart pub get
working-directory: ${{ github.workspace }}/script/tool
# This workflow should be the last to run. So wait for all the other tests to succeed.
- name: Wait on all tests
uses: lewagon/wait-on-check-action@e106e5c43e8ca1edea6383a39a01c5ca495fd812
ref: ${{ github.sha }}
running-workflow-name: 'release'
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 180 # seconds
allowed-conclusions: success,neutral
# verbose:true will produce too many logs that hang github actions web UI.
verbose: false
- name: run release
run: |
git config --global ${{ secrets.USER_NAME }}
git config --global ${{ secrets.USER_EMAIL }}
dart ./script/tool/lib/src/main.dart publish --all-changed --base-sha=HEAD~ --skip-confirmation --remote=origin
env: {PUB_CREDENTIALS: "${{ secrets.PUB_CREDENTIALS }}"}