diff --git a/.github/workflows/android_deploy_production.yml b/.github/workflows/android_deploy_production.yml index 10e7d7db..13f2f9af 100644 --- a/.github/workflows/android_deploy_production.yml +++ b/.github/workflows/android_deploy_production.yml @@ -57,10 +57,16 @@ 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: Generate release notes + env: + PR_CONTENT: ${{ steps.PR.outputs.pr_body }} id: generate-release-notes run: | - echo "RELEASE_NOTE_CONTENT=$((git log -1 --merges | grep "\[") && echo "" || echo $(git log -1 --merges --format=%B))" >> $GITHUB_OUTPUT + echo "RELEASE_NOTE_CONTENT=$PR_CONTENT" >> $GITHUB_OUTPUT - name: Deploy Android Production to Firebase uses: wzieba/Firebase-Distribution-Github-Action@v1.5.0 diff --git a/.github/workflows/android_deploy_staging.yml b/.github/workflows/android_deploy_staging.yml index bf5b0d5d..da3a575d 100644 --- a/.github/workflows/android_deploy_staging.yml +++ b/.github/workflows/android_deploy_staging.yml @@ -4,7 +4,6 @@ on: push: branches: - develop - - chore/198-add-release-note-firebase-deploy jobs: build_and_deploy_android: @@ -50,10 +49,16 @@ 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: Generate release notes + env: + PR_TITLE: ${{ steps.PR.outputs.pr_title }} id: generate-release-notes run: | - echo "RELEASE_NOTE_CONTENT=$((git log -1 --merges | grep "\[") && echo "" || echo $(git log -1 --merges --format=%B))" >> $GITHUB_OUTPUT + echo "RELEASE_NOTE_CONTENT=$PR_TITLE" >> $GITHUB_OUTPUT - name: Deploy Android Staging to Firebase uses: wzieba/Firebase-Distribution-Github-Action@v1.5.0 diff --git a/.github/workflows/ios_deploy_staging_to_firebase.yml b/.github/workflows/ios_deploy_staging_to_firebase.yml index d8f55ad7..c5768f5a 100644 --- a/.github/workflows/ios_deploy_staging_to_firebase.yml +++ b/.github/workflows/ios_deploy_staging_to_firebase.yml @@ -4,7 +4,6 @@ on: push: branches: - develop - - chore/198-add-release-note-firebase-deploy jobs: build_and_deploy_ios: @@ -52,7 +51,17 @@ jobs: ENV: ${{ secrets.ENV }} run: | echo -e "$ENV" > .env.staging - echo "RELEASE_NOTE_CONTENT=$((git log -1 --merges | grep "\[") && echo "" || echo $(git log -1 --merges --format=%B))" >> $GITHUB_ENV + + - 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/bricks/template/__brick__/.github/workflows/android_deploy_production.yml b/bricks/template/__brick__/.github/workflows/android_deploy_production.yml index 8d37eeb5..88d22852 100644 --- a/bricks/template/__brick__/.github/workflows/android_deploy_production.yml +++ b/bricks/template/__brick__/.github/workflows/android_deploy_production.yml @@ -51,10 +51,16 @@ 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: Generate release notes + env: + PR_CONTENT: ${{#mustacheCase}}steps.PR.outputs.pr_body{{/mustacheCase}} id: generate-release-notes run: | - echo "RELEASE_NOTE_CONTENT=$((git log -1 --merges | grep "\[") && echo "" || echo $(git log -1 --merges --format=%B))" >> $GITHUB_OUTPUT + echo "RELEASE_NOTE_CONTENT=$PR_CONTENT" >> $GITHUB_OUTPUT - name: Deploy Android Production to Firebase uses: wzieba/Firebase-Distribution-Github-Action@v1.5.0 diff --git a/bricks/template/__brick__/.github/workflows/android_deploy_staging.yml b/bricks/template/__brick__/.github/workflows/android_deploy_staging.yml index fed44bac..ace5b481 100644 --- a/bricks/template/__brick__/.github/workflows/android_deploy_staging.yml +++ b/bricks/template/__brick__/.github/workflows/android_deploy_staging.yml @@ -43,10 +43,16 @@ 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: Generate release notes + env: + PR_TITLE: ${{#mustacheCase}}steps.PR.outputs.pr_title{{/mustacheCase}} id: generate-release-notes run: | - echo "RELEASE_NOTE_CONTENT=$((git log -1 --merges | grep "\[") && echo "" || echo $(git log -1 --merges --format=%B))" >> $GITHUB_OUTPUT + echo "RELEASE_NOTE_CONTENT=$PR_TITLE" >> $GITHUB_OUTPUT - name: Deploy Android Staging to Firebase uses: wzieba/Firebase-Distribution-Github-Action@v1.5.0 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 a0efe2ee..f12a96bb 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 @@ -45,7 +45,17 @@ jobs: ENV: ${{#mustacheCase}}secrets.ENV{{/mustacheCase}} run: | echo -e "$ENV" > .env.staging - echo "RELEASE_NOTE_CONTENT="$((git log -1 --merges | grep "\[") | grep . && echo "" || echo $(git log -1 --merges --format=%B))"" >> $GITHUB_ENV + + - 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: ${{#mustacheCase}}steps.PR.outputs.pr_title{{/mustacheCase}} + 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/bricks/template/__brick__/ios/fastlane/Fastfile b/bricks/template/__brick__/ios/fastlane/Fastfile index fd086fa3..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: Environments.RELEASE_NOTES_CONTENT + notes: Environments.RELEASE_NOTE_CONTENT ) end end diff --git a/sample/ios/fastlane/Fastfile b/sample/ios/fastlane/Fastfile index fd086fa3..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: Environments.RELEASE_NOTES_CONTENT + notes: Environments.RELEASE_NOTE_CONTENT ) end end