Skip to content

Commit

Permalink
[#198] Add Generate release notes for android and ios deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
doannimble committed Oct 31, 2023
1 parent f92f0d4 commit f393785
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 10 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/android_deploy_production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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/[email protected]
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/android_deploy_staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- develop
- chore/198-add-release-note-firebase-deploy

jobs:
build_and_deploy_android:
Expand Down Expand Up @@ -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/[email protected]
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/[email protected]
Expand Down
13 changes: 11 additions & 2 deletions .github/workflows/ios_deploy_staging_to_firebase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- develop
- chore/198-add-release-note-firebase-deploy

jobs:
build_and_deploy_ios:
Expand Down Expand Up @@ -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/[email protected]
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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/[email protected]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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/[email protected]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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
Expand Down
2 changes: 1 addition & 1 deletion bricks/template/__brick__/ios/fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion sample/ios/fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit f393785

Please sign in to comment.