From c6a23594fbe1a7c58c297841dd04d7414f88c5f2 Mon Sep 17 00:00:00 2001 From: hemengyang Date: Wed, 4 Jan 2023 17:37:44 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BD=BF=E7=94=A8=E6=96=B0=E7=9A=84?= =?UTF-8?q?=E8=AF=AD=E6=B3=95=EF=BC=8C=E5=B9=B6=E4=B8=94=E6=9B=B4=E6=8D=A2?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=20Flutter=20=E7=9A=84=20Actions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/main.yml | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6613d864..f0f71264 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -34,20 +34,21 @@ jobs: BUILD_NUMBER=$(echo $VERSION_STRING | cut -d"+" -f2) COMMIT_ID=$(git rev-parse --short HEAD) if [[ "${{github.event_name}}" == "release" && "${{github.event.action}}" == "published" ]]; then - echo "::set-output name=environment::prod" - echo "::set-output name=version::$VERSION+$BUILD_NUMBER" - echo "::set-output name=release::xyz.hehome.smarthome@$VERSION+$BUILD_NUMBER" + echo "environment=prod" >> $GITHUB_OUTPUT + echo "version=$VERSION+$BUILD_NUMBER" >> $GITHUB_OUTPUT + echo "release=xyz.hehome.smarthome@$VERSION+$BUILD_NUMBER" >> $GITHUB_OUTPUT else - echo "::set-output name=environment::dev" - echo "::set-output name=version::$VERSION-git.$COMMIT_ID+$BUILD_NUMBER" - echo "::set-output name=release::xyz.hehome.smarthome.dev@$VERSION-git.$COMMIT_ID+$BUILD_NUMBER" + echo "environment=dev" >> $GITHUB_OUTPUT + echo "version=$VERSION-git.$COMMIT_ID+$BUILD_NUMBER" >> $GITHUB_OUTPUT + echo "release=xyz.hehome.smarthome.dev@$VERSION-git.$COMMIT_ID+$BUILD_NUMBER" >> $GITHUB_OUTPUT fi - name: Get lcov_cobertura run: curl -sSL https://raw.github.com/eriwen/lcov-to-cobertura-xml/master/lcov_cobertura/lcov_cobertura.py -o lcov_cobertura.py - name: Setup Flutter - uses: hrishikesh-kadam/setup-flutter@2bf2efb3b590d514835044647db9ce5f3a81b769 + uses: subosito/flutter-action@dbf1fa04f4d2e52c33185153d06cdb5443aa189d with: - ref: ${{ env.flutter_version }} + flutter-version: ${{ env.flutter_version }} + channel: 'stable' - name: Flutter test run: | flutter pub get @@ -78,9 +79,10 @@ jobs: env: LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }} - name: Setup Flutter - uses: hrishikesh-kadam/setup-flutter@2bf2efb3b590d514835044647db9ce5f3a81b769 + uses: subosito/flutter-action@dbf1fa04f4d2e52c33185153d06cdb5443aa189d with: - ref: ${{ env.flutter_version }} + flutter-version: ${{ env.flutter_version }} + channel: 'stable' - name: Build split-per-abi apks run: flutter build apk --split-per-abi -t ./lib/main_$ENVIRONMENT.dart --flavor $ENVIRONMENT env: @@ -110,9 +112,10 @@ jobs: RELEASE: ${{ needs.test.outputs.release }} SENTRY_DSN: ${{ secrets.SENTRY_DSN }} - name: Setup Flutter - uses: hrishikesh-kadam/setup-flutter@2bf2efb3b590d514835044647db9ce5f3a81b769 + uses: subosito/flutter-action@dbf1fa04f4d2e52c33185153d06cdb5443aa189d with: - ref: ${{ env.flutter_version }} + flutter-version: ${{ env.flutter_version }} + channel: 'stable' - name: Build web version run: | flutter build web --web-renderer=html -t ./lib/main_$ENVIRONMENT.dart @@ -143,9 +146,10 @@ jobs: RELEASE: ${{ needs.test.outputs.release }} SENTRY_DSN: ${{ secrets.SENTRY_DSN }} - name: Setup Flutter - uses: hrishikesh-kadam/setup-flutter@2bf2efb3b590d514835044647db9ce5f3a81b769 + uses: subosito/flutter-action@dbf1fa04f4d2e52c33185153d06cdb5443aa189d with: - ref: ${{ env.flutter_version }} + flutter-version: ${{ env.flutter_version }} + channel: 'stable' - name: Build windows version run: | flutter build windows -t ./lib/main_${env:ENVIRONMENT}.dart From 98c7ed843eb35411e597b7a619d6e1e11be6bf84 Mon Sep 17 00:00:00 2001 From: hemengyang Date: Wed, 4 Jan 2023 17:40:58 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=90=AF=E7=94=A8=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/main.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f0f71264..2389f7af 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -49,6 +49,7 @@ jobs: with: flutter-version: ${{ env.flutter_version }} channel: 'stable' + cache: true - name: Flutter test run: | flutter pub get @@ -83,6 +84,7 @@ jobs: with: flutter-version: ${{ env.flutter_version }} channel: 'stable' + cache: true - name: Build split-per-abi apks run: flutter build apk --split-per-abi -t ./lib/main_$ENVIRONMENT.dart --flavor $ENVIRONMENT env: @@ -116,6 +118,7 @@ jobs: with: flutter-version: ${{ env.flutter_version }} channel: 'stable' + cache: true - name: Build web version run: | flutter build web --web-renderer=html -t ./lib/main_$ENVIRONMENT.dart @@ -150,6 +153,7 @@ jobs: with: flutter-version: ${{ env.flutter_version }} channel: 'stable' + cache: true - name: Build windows version run: | flutter build windows -t ./lib/main_${env:ENVIRONMENT}.dart