From 90044b749aa66477712132c96dbfc5e42c8ce10a Mon Sep 17 00:00:00 2001 From: Sergio Martins Date: Mon, 22 Apr 2024 18:34:15 +0100 Subject: [PATCH 1/5] ci: Add flutter-pub-update.yml to 2.1 branch as well Due to a GH limitation, scheduled workflows only run on the default branch --- .github/workflows/flutter-pub-update.yml | 64 ++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 .github/workflows/flutter-pub-update.yml diff --git a/.github/workflows/flutter-pub-update.yml b/.github/workflows/flutter-pub-update.yml new file mode 100644 index 000000000..a6aea51d6 --- /dev/null +++ b/.github/workflows/flutter-pub-update.yml @@ -0,0 +1,64 @@ +# SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company +# +# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only + +# On demand flutter action to trigger flutter pub upgrade + +name: (Scheduled) Runs flutter pub upgrade + +on: + schedule: + - cron: '0 3 * * *' + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: true + + steps: + - name: Checkout sources + uses: actions/checkout@v4 + ref: main # always main branch + + - name: Install dependencies + run: | + sudo apt update -qq + sudo apt install wget curl file unzip zip xz-utils -y + + - name: Install Dart SDK + uses: dart-lang/setup-dart@v1 + + - name: Setup git author name + uses: fregante/setup-git-user@v2 + + - name: pub upgrade on flutter_tests_embedder + run: | + cd tests/flutter_tests_embedder/ + flutter pub upgrade + + - name: pub upgrade on flutter_tests_embedder + run: | + cd tests/flutter_tests_embedder/ + flutter pub upgrade --major-versions + + - name: pub upgrade on examples + run: | + cd examples/flutter + flutter pub upgrade --major-versions + + - name: pub upgrade on src/flutter + run: | + cd src/flutter + flutter pub upgrade --major-versions + + - name: pub upgrade on src/flutter/dart + run: | + cd src/flutter/dart + flutter pub upgrade --major-versions + + - name: Create PR + run: sh src/flutter/create_pub_upgrade_pr.sh + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From dcbe84f701fce729daeda0dd9630aefa1026c766 Mon Sep 17 00:00:00 2001 From: Sergio Martins Date: Mon, 22 Apr 2024 18:44:50 +0100 Subject: [PATCH 2/5] ci: Run flutter pub upgrade only monthly No need to run everyday. We'll manually run it before a release anyway. --- .github/workflows/flutter-pub-update.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/flutter-pub-update.yml b/.github/workflows/flutter-pub-update.yml index a6aea51d6..561794b2a 100644 --- a/.github/workflows/flutter-pub-update.yml +++ b/.github/workflows/flutter-pub-update.yml @@ -8,7 +8,7 @@ name: (Scheduled) Runs flutter pub upgrade on: schedule: - - cron: '0 3 * * *' + - cron: '0 0 1 * *' # monthly workflow_dispatch: jobs: From 287d8e6e0756bcfde2bb0b81ef0edda0c7b9456e Mon Sep 17 00:00:00 2001 From: Sergio Martins Date: Mon, 22 Apr 2024 20:25:40 +0100 Subject: [PATCH 3/5] ci: Install flutter for flutter-pub-update workflow --- .github/workflows/flutter-pub-update.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/flutter-pub-update.yml b/.github/workflows/flutter-pub-update.yml index 561794b2a..fa550e312 100644 --- a/.github/workflows/flutter-pub-update.yml +++ b/.github/workflows/flutter-pub-update.yml @@ -30,6 +30,11 @@ jobs: - name: Install Dart SDK uses: dart-lang/setup-dart@v1 + - uses: subosito/flutter-action@v2 + with: + flutter-version: '3.19.6' + channel: 'stable' + - name: Setup git author name uses: fregante/setup-git-user@v2 From ba1a9a19ecda810d5a8a7b703bb4b56caa7245ef Mon Sep 17 00:00:00 2001 From: Sergio Martins Date: Mon, 22 Apr 2024 20:32:18 +0100 Subject: [PATCH 4/5] ci: Fix installing flutter Remove Dart, as flutter SDK already brings dart. --- .github/workflows/flutter-pub-update.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/flutter-pub-update.yml b/.github/workflows/flutter-pub-update.yml index fa550e312..a45369c12 100644 --- a/.github/workflows/flutter-pub-update.yml +++ b/.github/workflows/flutter-pub-update.yml @@ -27,9 +27,7 @@ jobs: sudo apt update -qq sudo apt install wget curl file unzip zip xz-utils -y - - name: Install Dart SDK - uses: dart-lang/setup-dart@v1 - + - name: Install Flutter SDK - uses: subosito/flutter-action@v2 with: flutter-version: '3.19.6' From e8450edcd623055a9731c3a66989562b74edae29 Mon Sep 17 00:00:00 2001 From: Sergio Martins Date: Mon, 22 Apr 2024 20:35:13 +0100 Subject: [PATCH 5/5] ci: Fix flutter yml syntax --- .github/workflows/flutter-pub-update.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/flutter-pub-update.yml b/.github/workflows/flutter-pub-update.yml index a45369c12..f9da9379c 100644 --- a/.github/workflows/flutter-pub-update.yml +++ b/.github/workflows/flutter-pub-update.yml @@ -28,7 +28,7 @@ jobs: sudo apt install wget curl file unzip zip xz-utils -y - name: Install Flutter SDK - - uses: subosito/flutter-action@v2 + uses: subosito/flutter-action@v2 with: flutter-version: '3.19.6' channel: 'stable'