diff --git a/.github/workflows/android_deploy_production.yml b/.github/workflows/android_deploy_production.yml index 4c387402..ce95dfc9 100644 --- a/.github/workflows/android_deploy_production.yml +++ b/.github/workflows/android_deploy_production.yml @@ -57,10 +57,24 @@ jobs: - name: Build Android apk run: flutter build apk --flavor production --release --build-number $GITHUB_RUN_NUMBER + - name: Find HEAD commit + id: head + run: echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT + + - name: Build changelog on "main" + id: changelog + uses: mikepenz/release-changelog-builder-action@v4 + with: + configuration: ".github/workflows/configs/changelog-config.json" + # Listing PRs from the last tag to the HEAD commit + toTag: ${{ steps.head.outputs.sha }} + token: ${{ secrets.GITHUB_TOKEN }} + - 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.changelog.outputs.changelog }} 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..3a43f200 100644 --- a/.github/workflows/android_deploy_staging.yml +++ b/.github/workflows/android_deploy_staging.yml @@ -49,10 +49,31 @@ jobs: - name: Build Android apk run: flutter build apk --flavor staging --debug --build-number $GITHUB_RUN_NUMBER + - name: Find HEAD commit + id: head + run: echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT + + - name: Limit changelog to the latest pull request only + uses: jossef/action-set-json-field@v2 + with: + file: .github/workflows/configs/changelog-config.json + field: max_pull_requests + value: 1 + + - name: Build changelog on "develop" + id: changelog + uses: mikepenz/release-changelog-builder-action@v4 + with: + configuration: ".github/workflows/configs/changelog-config.json" + # Listing PRs from the last tag to the HEAD commit + toTag: ${{ steps.head.outputs.sha }} + token: ${{ secrets.GITHUB_TOKEN }} + - 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.changelog.outputs.changelog }} file: build/app/outputs/flutter-apk/app-staging-debug.apk diff --git a/.github/workflows/configs/changelog-config.json b/.github/workflows/configs/changelog-config.json new file mode 100644 index 00000000..c795bff1 --- /dev/null +++ b/.github/workflows/configs/changelog-config.json @@ -0,0 +1,32 @@ +{ + "categories": [ + { + "title": "## โœจ Features", + "labels": [ + "type : feature" + ] + }, + { + "title": "## ๐Ÿ› Bug fixes", + "labels": [ + "type : bug" + ] + }, + { + "title": "## ๐Ÿงน Chores", + "labels": [ + "type : chore" + ] + }, + { + "title": "## Others", + "exclude_labels": [ + "type : feature", + "type : bug", + "type : chore", + "type : release" + ] + } + ], + "max_pull_requests": 200 +} diff --git a/.github/workflows/ios_deploy_staging_to_firebase.yml b/.github/workflows/ios_deploy_staging_to_firebase.yml index a3d1ae54..658543c9 100644 --- a/.github/workflows/ios_deploy_staging_to_firebase.yml +++ b/.github/workflows/ios_deploy_staging_to_firebase.yml @@ -52,6 +52,26 @@ jobs: run: | echo -e "$ENV" > .env.staging + - name: Find HEAD commit + id: head + run: echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT + + - name: Limit changelog to the latest pull request only + uses: jossef/action-set-json-field@v2 + with: + file: .github/workflows/configs/changelog-config.json + field: max_pull_requests + value: 1 + + - name: Build changelog on "develop" + id: changelog + uses: mikepenz/release-changelog-builder-action@v4 + with: + configuration: ".github/workflows/configs/changelog-config.json" + # Listing PRs from the last tag to the HEAD commit + toTag: ${{ steps.head.outputs.sha }} + token: ${{ secrets.GITHUB_TOKEN }} + - name: Run code generator run: flutter packages pub run build_runner build --delete-conflicting-outputs @@ -65,5 +85,7 @@ jobs: run: cd ./ios && bundle exec fastlane sync_adhoc_staging_signing - name: Deploy to Firebase + env: + RELEASE_NOTE_CONTENT: ${{ steps.changelog.outputs.changelog }} 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..8aa9798b 100644 --- a/bricks/template/__brick__/.github/workflows/android_deploy_production.yml +++ b/bricks/template/__brick__/.github/workflows/android_deploy_production.yml @@ -51,10 +51,24 @@ jobs: - name: Build Android apk run: flutter build apk --flavor production --release --build-number $GITHUB_RUN_NUMBER + - name: Find HEAD commit + id: head + run: echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT + + - name: Build changelog on "main" + id: changelog + uses: mikepenz/release-changelog-builder-action@v4 + with: + configuration: ".github/workflows/configs/changelog-config.json" + # Listing PRs from the last tag to the HEAD commit + toTag: ${{#mustacheCase}}steps.head.outputs.sha{{/mustacheCase}} + token: ${{#mustacheCase}}secrets.GITHUB_TOKEN{{/mustacheCase}} + - 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.changelog.outputs.changelog{{/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..2b273d8e 100644 --- a/bricks/template/__brick__/.github/workflows/android_deploy_staging.yml +++ b/bricks/template/__brick__/.github/workflows/android_deploy_staging.yml @@ -43,10 +43,31 @@ jobs: - name: Build Android apk run: flutter build apk --flavor staging --debug --build-number $GITHUB_RUN_NUMBER + - name: Find HEAD commit + id: head + run: echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT + + - name: Limit changelog to the latest pull request only + uses: jossef/action-set-json-field@v2 + with: + file: .github/workflows/configs/changelog-config.json + field: max_pull_requests + value: 1 + + - name: Build changelog on "develop" + id: changelog + uses: mikepenz/release-changelog-builder-action@v4 + with: + configuration: ".github/workflows/configs/changelog-config.json" + # Listing PRs from the last tag to the HEAD commit + toTag: ${{#mustacheCase}}steps.head.outputs.sha{{/mustacheCase}} + token: ${{#mustacheCase}}secrets.GITHUB_TOKEN{{/mustacheCase}} + - 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.changelog.outputs.changelog{{/mustacheCase}} file: build/app/outputs/flutter-apk/app-staging-debug.apk diff --git a/bricks/template/__brick__/.github/workflows/configs/changelog-config.json b/bricks/template/__brick__/.github/workflows/configs/changelog-config.json new file mode 100644 index 00000000..c795bff1 --- /dev/null +++ b/bricks/template/__brick__/.github/workflows/configs/changelog-config.json @@ -0,0 +1,32 @@ +{ + "categories": [ + { + "title": "## โœจ Features", + "labels": [ + "type : feature" + ] + }, + { + "title": "## ๐Ÿ› Bug fixes", + "labels": [ + "type : bug" + ] + }, + { + "title": "## ๐Ÿงน Chores", + "labels": [ + "type : chore" + ] + }, + { + "title": "## Others", + "exclude_labels": [ + "type : feature", + "type : bug", + "type : chore", + "type : release" + ] + } + ], + "max_pull_requests": 200 +} 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..f16326ed 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,26 @@ jobs: run: | echo -e "$ENV" > .env.staging + - name: Find HEAD commit + id: head + run: echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT + + - name: Limit changelog to the latest pull request only + uses: jossef/action-set-json-field@v2 + with: + file: .github/workflows/configs/changelog-config.json + field: max_pull_requests + value: 1 + + - name: Build changelog on "develop" + id: changelog + uses: mikepenz/release-changelog-builder-action@v4 + with: + configuration: ".github/workflows/configs/changelog-config.json" + # Listing PRs from the last tag to the HEAD commit + toTag: ${{#mustacheCase}}steps.head.outputs.sha{{/mustacheCase}} + token: ${{#mustacheCase}}secrets.GITHUB_TOKEN{{/mustacheCase}} + - name: Run code generator run: flutter packages pub run build_runner build --delete-conflicting-outputs @@ -59,5 +79,7 @@ jobs: run: cd ./ios && bundle exec fastlane sync_adhoc_staging_signing - name: Deploy to Firebase + env: + RELEASE_NOTE_CONTENT:${{#mustacheCase}}steps.changelog.outputs.changelog{{/mustacheCase}} 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..767b9dc3 100644 --- a/sample/.github/workflows/android_deploy_production.yml +++ b/sample/.github/workflows/android_deploy_production.yml @@ -51,10 +51,24 @@ jobs: - name: Build Android apk run: flutter build apk --flavor production --release --build-number $GITHUB_RUN_NUMBER + - name: Find HEAD commit + id: head + run: echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT + + - name: Build changelog on "main" + id: changelog + uses: mikepenz/release-changelog-builder-action@v4 + with: + configuration: ".github/workflows/configs/changelog-config.json" + # Listing PRs from the last tag to the HEAD commit + toTag: ${{ steps.head.outputs.sha }} + token: ${{ secrets.GITHUB_TOKEN }} + - 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.changelog.outputs.changelog }} file: build/app/outputs/flutter-apk/app-production-release.apk diff --git a/sample/.github/workflows/android_deploy_staging.yml b/sample/.github/workflows/android_deploy_staging.yml index 6120d5ac..e20a4255 100644 --- a/sample/.github/workflows/android_deploy_staging.yml +++ b/sample/.github/workflows/android_deploy_staging.yml @@ -43,10 +43,31 @@ jobs: - name: Build Android apk run: flutter build apk --flavor staging --debug --build-number $GITHUB_RUN_NUMBER + - name: Find HEAD commit + id: head + run: echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT + + - name: Limit changelog to the latest pull request only + uses: jossef/action-set-json-field@v2 + with: + file: .github/workflows/configs/changelog-config.json + field: max_pull_requests + value: 1 + + - name: Build changelog on "develop" + id: changelog + uses: mikepenz/release-changelog-builder-action@v4 + with: + configuration: ".github/workflows/configs/changelog-config.json" + # Listing PRs from the last tag to the HEAD commit + toTag: ${{ steps.head.outputs.sha }} + token: ${{ secrets.GITHUB_TOKEN }} + - 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.changelog.outputs.changelog }} file: build/app/outputs/flutter-apk/app-staging-debug.apk diff --git a/sample/.github/workflows/configs/changelog-config.json b/sample/.github/workflows/configs/changelog-config.json new file mode 100644 index 00000000..c795bff1 --- /dev/null +++ b/sample/.github/workflows/configs/changelog-config.json @@ -0,0 +1,32 @@ +{ + "categories": [ + { + "title": "## โœจ Features", + "labels": [ + "type : feature" + ] + }, + { + "title": "## ๐Ÿ› Bug fixes", + "labels": [ + "type : bug" + ] + }, + { + "title": "## ๐Ÿงน Chores", + "labels": [ + "type : chore" + ] + }, + { + "title": "## Others", + "exclude_labels": [ + "type : feature", + "type : bug", + "type : chore", + "type : release" + ] + } + ], + "max_pull_requests": 200 +} diff --git a/sample/.github/workflows/ios_deploy_staging_to_firebase.yml b/sample/.github/workflows/ios_deploy_staging_to_firebase.yml index a20c1d66..8e5fa634 100644 --- a/sample/.github/workflows/ios_deploy_staging_to_firebase.yml +++ b/sample/.github/workflows/ios_deploy_staging_to_firebase.yml @@ -46,6 +46,26 @@ jobs: run: | echo -e "$ENV" > .env.staging + - name: Find HEAD commit + id: head + run: echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT + + - name: Limit changelog to the latest pull request only + uses: jossef/action-set-json-field@v2 + with: + file: .github/workflows/configs/changelog-config.json + field: max_pull_requests + value: 1 + + - name: Build changelog on "develop" + id: changelog + uses: mikepenz/release-changelog-builder-action@v4 + with: + configuration: ".github/workflows/configs/changelog-config.json" + # Listing PRs from the last tag to the HEAD commit + toTag: ${{ steps.head.outputs.sha }} + token: ${{ secrets.GITHUB_TOKEN }} + - name: Run code generator run: flutter packages pub run build_runner build --delete-conflicting-outputs @@ -59,5 +79,7 @@ jobs: run: cd ./ios && bundle exec fastlane sync_adhoc_staging_signing - name: Deploy to Firebase + env: + RELEASE_NOTE_CONTENT:${{ steps.changelog.outputs.changelog }} run: | cd ./ios && bundle exec fastlane build_and_upload_staging_app 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