From ff16640c15c45254dd74f4690a7d220311f8ea5f Mon Sep 17 00:00:00 2001 From: Doan Dinh Date: Mon, 21 Aug 2023 14:06:10 +0700 Subject: [PATCH] [#198] Add release notes for Android staging/production and iOS staging --- .github/workflows/android_deploy_production.yml | 5 +++++ .github/workflows/android_deploy_staging.yml | 5 +++++ .github/workflows/ios_deploy_staging_to_firebase.yml | 6 ++++++ .../.github/workflows/android_deploy_production.yml | 5 +++++ .../.github/workflows/android_deploy_staging.yml | 5 +++++ .../workflows/ios_deploy_staging_to_firebase.yml | 6 ++++++ .../__brick__/ios/fastlane/Constants/Environments.rb | 6 +++++- bricks/template/__brick__/ios/fastlane/Fastfile | 2 +- .../.github/workflows/android_deploy_production.yml | 7 ++++++- sample/.github/workflows/android_deploy_staging.yml | 5 +++++ .../workflows/ios_deploy_staging_to_firebase.yml | 11 +++++++++++ sample/ios/fastlane/Constants/Environments.rb | 6 +++++- sample/ios/fastlane/Fastfile | 2 +- 13 files changed, 66 insertions(+), 5 deletions(-) diff --git a/.github/workflows/android_deploy_production.yml b/.github/workflows/android_deploy_production.yml index 4c387402..aee293dd 100644 --- a/.github/workflows/android_deploy_production.yml +++ b/.github/workflows/android_deploy_production.yml @@ -57,10 +57,15 @@ jobs: - name: Build Android apk run: flutter build apk --flavor production --release --build-number $GITHUB_RUN_NUMBER + - name: Get PR information + uses: 8BitJonny/gh-get-current-pr@2.2.0 + id: PR + - name: Deploy Android Production to Firebase uses: wzieba/Firebase-Distribution-Github-Action@v1.5.0 with: appId: ${{ vars.FIREBASE_ANDROID_APP_ID }} serviceCredentialsFileContent: ${{ secrets.FIREBASE_DISTRIBUTION_CREDENTIAL_JSON }} groups: ${{ vars.FIREBASE_DISTRIBUTION_TESTER_GROUPS }} + releaseNotes: ${{ steps.PR.outputs.pr_body }} file: build/app/outputs/flutter-apk/app-production-release.apk diff --git a/.github/workflows/android_deploy_staging.yml b/.github/workflows/android_deploy_staging.yml index b6d3ad21..fbf23912 100644 --- a/.github/workflows/android_deploy_staging.yml +++ b/.github/workflows/android_deploy_staging.yml @@ -49,10 +49,15 @@ jobs: - name: Build Android apk run: flutter build apk --flavor staging --debug --build-number $GITHUB_RUN_NUMBER + - name: Get PR information + uses: 8BitJonny/gh-get-current-pr@2.2.0 + id: PR + - name: Deploy Android Staging to Firebase uses: wzieba/Firebase-Distribution-Github-Action@v1.5.0 with: appId: ${{ vars.FIREBASE_ANDROID_APP_ID }} serviceCredentialsFileContent: ${{ secrets.FIREBASE_DISTRIBUTION_CREDENTIAL_JSON }} groups: ${{ vars.FIREBASE_DISTRIBUTION_TESTER_GROUPS }} + releaseNotes: ${{ steps.PR.outputs.pr_title }} file: build/app/outputs/flutter-apk/app-staging-debug.apk diff --git a/.github/workflows/ios_deploy_staging_to_firebase.yml b/.github/workflows/ios_deploy_staging_to_firebase.yml index a3d1ae54..d3979421 100644 --- a/.github/workflows/ios_deploy_staging_to_firebase.yml +++ b/.github/workflows/ios_deploy_staging_to_firebase.yml @@ -52,6 +52,10 @@ jobs: run: | echo -e "$ENV" > .env.staging + - name: Get PR information + uses: 8BitJonny/gh-get-current-pr@2.2.0 + id: PR + - name: Run code generator run: flutter packages pub run build_runner build --delete-conflicting-outputs @@ -65,5 +69,7 @@ jobs: run: cd ./ios && bundle exec fastlane sync_adhoc_staging_signing - name: Deploy to Firebase + env: + RELEASE_NOTE_CONTENT: ${{ steps.PR.outputs.pr_title }} run: | cd ./ios && bundle exec fastlane build_and_upload_staging_app diff --git a/bricks/template/__brick__/.github/workflows/android_deploy_production.yml b/bricks/template/__brick__/.github/workflows/android_deploy_production.yml index d78f52b5..acdc5c3a 100644 --- a/bricks/template/__brick__/.github/workflows/android_deploy_production.yml +++ b/bricks/template/__brick__/.github/workflows/android_deploy_production.yml @@ -51,10 +51,15 @@ jobs: - name: Build Android apk run: flutter build apk --flavor production --release --build-number $GITHUB_RUN_NUMBER + - name: Get PR information + uses: 8BitJonny/gh-get-current-pr@2.2.0 + id: PR + - name: Deploy Android Production to Firebase uses: wzieba/Firebase-Distribution-Github-Action@v1.5.0 with: appId: ${{#mustacheCase}}vars.FIREBASE_ANDROID_APP_ID{{/mustacheCase}} serviceCredentialsFileContent: ${{#mustacheCase}}secrets.FIREBASE_DISTRIBUTION_CREDENTIAL_JSON{{/mustacheCase}} groups: ${{#mustacheCase}}vars.FIREBASE_DISTRIBUTION_TESTER_GROUPS{{/mustacheCase}} + releaseNotes: ${{#mustacheCase}}steps.PR.outputs.pr_body{{/mustacheCase}} file: build/app/outputs/flutter-apk/app-production-release.apk diff --git a/bricks/template/__brick__/.github/workflows/android_deploy_staging.yml b/bricks/template/__brick__/.github/workflows/android_deploy_staging.yml index 60ede1f1..7e9e7239 100644 --- a/bricks/template/__brick__/.github/workflows/android_deploy_staging.yml +++ b/bricks/template/__brick__/.github/workflows/android_deploy_staging.yml @@ -43,10 +43,15 @@ jobs: - name: Build Android apk run: flutter build apk --flavor staging --debug --build-number $GITHUB_RUN_NUMBER + - name: Get PR information + uses: 8BitJonny/gh-get-current-pr@2.2.0 + id: PR + - name: Deploy Android Staging to Firebase uses: wzieba/Firebase-Distribution-Github-Action@v1.5.0 with: appId: ${{#mustacheCase}}vars.FIREBASE_ANDROID_APP_ID{{/mustacheCase}} serviceCredentialsFileContent: ${{#mustacheCase}}secrets.FIREBASE_DISTRIBUTION_CREDENTIAL_JSON{{/mustacheCase}} groups: ${{#mustacheCase}}vars.FIREBASE_DISTRIBUTION_TESTER_GROUPS{{/mustacheCase}} + releaseNotes: ${{#mustacheCase}}steps.PR.outputs.pr_title{{/mustacheCase}} file: build/app/outputs/flutter-apk/app-staging-debug.apk diff --git a/bricks/template/__brick__/.github/workflows/ios_deploy_staging_to_firebase.yml b/bricks/template/__brick__/.github/workflows/ios_deploy_staging_to_firebase.yml index bb9e3523..dead1d2f 100644 --- a/bricks/template/__brick__/.github/workflows/ios_deploy_staging_to_firebase.yml +++ b/bricks/template/__brick__/.github/workflows/ios_deploy_staging_to_firebase.yml @@ -46,6 +46,10 @@ jobs: run: | echo -e "$ENV" > .env.staging + - name: Get PR information + uses: 8BitJonny/gh-get-current-pr@2.2.0 + id: PR + - name: Run code generator run: flutter packages pub run build_runner build --delete-conflicting-outputs @@ -59,5 +63,7 @@ jobs: run: cd ./ios && bundle exec fastlane sync_adhoc_staging_signing - name: Deploy to Firebase + env: + RELEASE_NOTE_CONTENT: ${{ steps.PR.outputs.pr_title }} run: | cd ./ios && bundle exec fastlane build_and_upload_staging_app diff --git a/bricks/template/__brick__/ios/fastlane/Constants/Environments.rb b/bricks/template/__brick__/ios/fastlane/Constants/Environments.rb index 2900ccd5..4ebed9a1 100644 --- a/bricks/template/__brick__/ios/fastlane/Constants/Environments.rb +++ b/bricks/template/__brick__/ios/fastlane/Constants/Environments.rb @@ -44,6 +44,10 @@ def self.FIREBASE_TESTER_GROUPS end def self.GITHUB_RUN_NUMBER - ENV["GITHUB_RUN_NUMBER"] + ENV['GITHUB_RUN_NUMBER'] + end + + def self.RELEASE_NOTE_CONTENT + ENV['RELEASE_NOTE_CONTENT'] end end diff --git a/bricks/template/__brick__/ios/fastlane/Fastfile b/bricks/template/__brick__/ios/fastlane/Fastfile index 71bf3415..62aa7940 100644 --- a/bricks/template/__brick__/ios/fastlane/Fastfile +++ b/bricks/template/__brick__/ios/fastlane/Fastfile @@ -211,7 +211,7 @@ platform :ios do product_name: options[:product_name], firebase_app_id: options[:firebase_app_id], tester_groups: options[:tester_groups], - notes: "" + notes: Environments.RELEASE_NOTE_CONTENT ) end end diff --git a/sample/.github/workflows/android_deploy_production.yml b/sample/.github/workflows/android_deploy_production.yml index 700abdd8..27762840 100644 --- a/sample/.github/workflows/android_deploy_production.yml +++ b/sample/.github/workflows/android_deploy_production.yml @@ -51,10 +51,15 @@ jobs: - name: Build Android apk run: flutter build apk --flavor production --release --build-number $GITHUB_RUN_NUMBER + - name: Get PR information + uses: 8BitJonny/gh-get-current-pr@2.2.0 + id: PR + - name: Deploy Android Production to Firebase uses: wzieba/Firebase-Distribution-Github-Action@v1.5.0 with: appId: ${{ vars.FIREBASE_ANDROID_APP_ID }} serviceCredentialsFileContent: ${{ secrets.FIREBASE_DISTRIBUTION_CREDENTIAL_JSON }} groups: ${{ vars.FIREBASE_DISTRIBUTION_TESTER_GROUPS }} - file: build/app/outputs/flutter-apk/app-production-release.apk + releaseNotes: ${{ steps.PR.outputs.pr_body }} + file: build/app/outputs/flutter-apk/app-production-debug.apk diff --git a/sample/.github/workflows/android_deploy_staging.yml b/sample/.github/workflows/android_deploy_staging.yml index 6120d5ac..e7405416 100644 --- a/sample/.github/workflows/android_deploy_staging.yml +++ b/sample/.github/workflows/android_deploy_staging.yml @@ -43,10 +43,15 @@ jobs: - name: Build Android apk run: flutter build apk --flavor staging --debug --build-number $GITHUB_RUN_NUMBER + - name: Get PR information + uses: 8BitJonny/gh-get-current-pr@2.2.0 + id: PR + - name: Deploy Android Staging to Firebase uses: wzieba/Firebase-Distribution-Github-Action@v1.5.0 with: appId: ${{ vars.FIREBASE_ANDROID_APP_ID }} serviceCredentialsFileContent: ${{ secrets.FIREBASE_DISTRIBUTION_CREDENTIAL_JSON }} groups: ${{ vars.FIREBASE_DISTRIBUTION_TESTER_GROUPS }} + releaseNotes: ${{ steps.PR.outputs.pr_title }} file: build/app/outputs/flutter-apk/app-staging-debug.apk diff --git a/sample/.github/workflows/ios_deploy_staging_to_firebase.yml b/sample/.github/workflows/ios_deploy_staging_to_firebase.yml index a20c1d66..fd67e681 100644 --- a/sample/.github/workflows/ios_deploy_staging_to_firebase.yml +++ b/sample/.github/workflows/ios_deploy_staging_to_firebase.yml @@ -46,6 +46,17 @@ jobs: run: | echo -e "$ENV" > .env.staging + - name: Get PR information + uses: 8BitJonny/gh-get-current-pr@2.2.0 + id: PR + + - name: Generate release notes + id: generate-release-notes + env: + PR_TITLE: ${{ steps.PR.outputs.pr_title }} + run: | + echo "RELEASE_NOTE_CONTENT=$PR_TITLE" >> $GITHUB_ENV + - name: Run code generator run: flutter packages pub run build_runner build --delete-conflicting-outputs diff --git a/sample/ios/fastlane/Constants/Environments.rb b/sample/ios/fastlane/Constants/Environments.rb index 2900ccd5..4ebed9a1 100644 --- a/sample/ios/fastlane/Constants/Environments.rb +++ b/sample/ios/fastlane/Constants/Environments.rb @@ -44,6 +44,10 @@ def self.FIREBASE_TESTER_GROUPS end def self.GITHUB_RUN_NUMBER - ENV["GITHUB_RUN_NUMBER"] + ENV['GITHUB_RUN_NUMBER'] + end + + def self.RELEASE_NOTE_CONTENT + ENV['RELEASE_NOTE_CONTENT'] end end diff --git a/sample/ios/fastlane/Fastfile b/sample/ios/fastlane/Fastfile index 71bf3415..62aa7940 100644 --- a/sample/ios/fastlane/Fastfile +++ b/sample/ios/fastlane/Fastfile @@ -211,7 +211,7 @@ platform :ios do product_name: options[:product_name], firebase_app_id: options[:firebase_app_id], tester_groups: options[:tester_groups], - notes: "" + notes: Environments.RELEASE_NOTE_CONTENT ) end end