Skip to content

Commit

Permalink
[tool] github action to auto publish (skeleton) (flutter#3834)
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Yang committed May 11, 2021
1 parent 0d62083 commit 145b6cf
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# This workflow is to automatically publish and tag packages
#
# It waits until all other ci tasks to pass before running the critical section.

name: release
on:
push:
branches:
- master

jobs:
release:
name: release
runs-on: ubuntu-latest
steps:
# 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@1b1630e169116b58a4b933d5ad7effc46d3d312d
with:
ref: ${{ github.sha }} # can be commit SHA or tag too
running-workflow-name: 'release'
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 10 # seconds
allowed-conclusions: success
# The release process should be synchronized to avoid child commit release before the parent commit,
# which might cause issue when child commit and parent commit both contain version updates for the same
# plugin.
- name: Wait on "release" workflow at last commit
uses: lewagon/wait-on-check-action@1b1630e169116b58a4b933d5ad7effc46d3d312d
with:
ref: ${{ github.sha }}~ # can be commit SHA or tag too
check-name: 'release'
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 10 # seconds
# TODO(cyanglaz), only allow success and skipped after https://github.com/flutter/plugins/pull/3840 lands and correct configurations added to this workflow.
# https://github.com/flutter/flutter/issues/81444
allowed-conclusions: success,skipped,cancelled,failure
# Checks out a copy of the repo.
- name: Checkout code
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
with:
fetch-depth: 0 # Fetch all history so the tool can get all the tag to determine version.

- 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.
run: |
cd $HOME
git clone https://github.com/flutter/flutter.git --depth 1 -b stable _flutter
echo "$HOME/_flutter/bin" >> $GITHUB_PATH
echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH
echo "$HOME/_flutter/.pub-cache/bin" >> $GITHUB_PATH
echo "$HOME/_flutter/bin/cache/dart-sdk/bin" >> $GITHUB_PATH
flutter doctor -v
cd $GITHUB_WORKSPACE
# TODO(cyanglaz): add real publish command.
- name: run release
run: echo "replace this command with release command"

env:
DEFAULT_BRANCH: master
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 145b6cf

Please sign in to comment.