forked from MobileDevOps/flutter-sdk-image
-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (28 loc) · 1.06 KB
/
nightly_flutter_version.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Check Flutter Version
# on:
# schedule:
# - cron: "0 0 * * *"
on:
pull_request:
branches:
- master
jobs:
check-flutter-version:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Get latest stable Flutter version
id: flutter-version
uses: subosito/flutter-action@v2
with:
channel: "stable"
- name: Get latest tag
id: latest-tag
run: echo ::set-output name=tag::$(git describe --tags $(git rev-list --tags --max-count=1))
- name: Compare versions
id: compare-versions
run: echo ::set-output name=is-lower::$(python -c "import re; from distutils.version import LooseVersion; print(LooseVersion(re.search(r'\d+\.\d+\.\d+', '${{ steps.flutter-version.outputs.flutter-version }}').group(0)) > LooseVersion('${{ steps.latest-tag.outputs.tag }}'))")
- name: Create pull request if necessary
if: ${{ steps.compare-versions.outputs.is-lower == 'True' }}
run: echo current flutter version is higher