Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit 04beebf

Browse files
author
Chris Yang
authored
[ci] Add release github action (#4061)
1 parent b921089 commit 04beebf

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: release
2+
on:
3+
push:
4+
branches:
5+
- master
6+
7+
jobs:
8+
release:
9+
name: release
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: "Install Flutter"
13+
# Github Actions don't support templates so it is hard to share this snippet with another action
14+
# If we eventually need to use this in more workflow, we could create a shell script that contains this
15+
# snippet.
16+
run: |
17+
cd $HOME
18+
git clone https://github.com/flutter/flutter.git --depth 1 -b stable _flutter
19+
echo "$HOME/_flutter/bin" >> $GITHUB_PATH
20+
cd $GITHUB_WORKSPACE
21+
# Checks out a copy of the repo.
22+
- name: Check out code
23+
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
24+
with:
25+
fetch-depth: 0 # Fetch all history so the tool can get all the tags to determine version.
26+
- name: Set up tools
27+
run: dart pub get
28+
working-directory: ${{ github.workspace }}/script/tool
29+
30+
# # This workflow should be the last to run. So wait for all the other tests to succeed.
31+
- name: Wait on all tests
32+
uses: lewagon/wait-on-check-action@1b1630e169116b58a4b933d5ad7effc46d3d312d
33+
with:
34+
ref: ${{ github.sha }}
35+
running-workflow-name: 'release'
36+
repo-token: ${{ secrets.GITHUB_TOKEN }}
37+
wait-interval: 10 # seconds
38+
allowed-conclusions: success
39+
40+
- name: run release
41+
run: |
42+
git config --global user.name ${{ secrets.USER_NAME }}
43+
git config --global user.email ${{ secrets.USER_EMAIL }}
44+
dart ./script/tool/lib/src/main.dart publish-plugin --all-changed --base-sha=HEAD~ --skip-confirmation --remote=origin
45+
env: {PUB_CREDENTIALS: "${{ secrets.PUB_CREDENTIALS }}"}
46+
47+
env:
48+
DEFAULT_BRANCH: master

0 commit comments

Comments
 (0)