Skip to content

Commit

Permalink
[#198] Add Generate release notes step
Browse files Browse the repository at this point in the history
  • Loading branch information
doannimble committed Oct 27, 2023
1 parent 0fb35c2 commit c7f17dc
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 10 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/android_deploy_production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,21 @@ jobs:
ENV: ${{ secrets.ENV }}
run: |
echo -e "$ENV" > .env
echo "RELEASE_NOTE_CONTENT="$(git log --merges --pretty=%B $(git describe --abbrev=0 --tags)..HEAD | grep "\[")""
# App Bundle requires Firebase connected to Play Store to upload https://appdistribution.page.link/KPoa
- name: Build Android apk
run: flutter build apk --flavor production --debug --build-number $GITHUB_RUN_NUMBER

- name: Generate release notes
id: generate-release-notes
run: |
echo "RELEASE_NOTE_CONTENT=$((git log -1 --merges | grep "\[") && echo "" || echo $(git log -1 --merges --format=%B))" >> $GITHUB_OUTPUT
- name: Deploy Android Production to Firebase
uses: wzieba/[email protected]
with:
appId: ${{ vars.FIREBASE_ANDROID_APP_ID }}
serviceCredentialsFileContent: ${{ secrets.FIREBASE_DISTRIBUTION_CREDENTIAL_JSON }}
groups: ${{ vars.FIREBASE_DISTRIBUTION_TESTER_GROUPS }}
releaseNotes: ${{ env.RELEASE_NOTE }}
releaseNotes: ${{ steps.generate-release-notes.outputs.RELEASE_NOTE_CONTENT }}
file: build/app/outputs/flutter-apk/app-production-debug.apk
8 changes: 6 additions & 2 deletions .github/workflows/android_deploy_staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,21 @@ jobs:
ENV: ${{ secrets.ENV }}
run: |
echo -e "$ENV" > .env.staging
echo "RELEASE_NOTE_CONTENT="$((git log -1 --merges | grep "\[") | grep . && echo "" || echo $(git log -1 --merges --format=%B))""
# App Bundle requires Firebase connected to Play Store to upload https://appdistribution.page.link/KPoa
- name: Build Android apk
run: flutter build apk --flavor staging --debug --build-number $GITHUB_RUN_NUMBER

- name: Generate release notes
id: generate-release-notes
run: |
echo "RELEASE_NOTE_CONTENT=$((git log -1 --merges | grep "\[") && echo "" || echo $(git log -1 --merges --format=%B))" >> $GITHUB_OUTPUT
- name: Deploy Android Staging to Firebase
uses: wzieba/[email protected]
with:
appId: ${{ vars.FIREBASE_ANDROID_APP_ID }}
serviceCredentialsFileContent: ${{ secrets.FIREBASE_DISTRIBUTION_CREDENTIAL_JSON }}
groups: ${{ vars.FIREBASE_DISTRIBUTION_TESTER_GROUPS }}
releaseNotes: ${{ env.RELEASE_NOTE }}
releaseNotes: ${{ steps.generate-release-notes.outputs.RELEASE_NOTE_CONTENT }}
file: build/app/outputs/flutter-apk/app-staging-debug.apk
2 changes: 1 addition & 1 deletion .github/workflows/ios_deploy_staging_to_firebase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
ENV: ${{ secrets.ENV }}
run: |
echo -e "$ENV" > .env.staging
echo "RELEASE_NOTE_CONTENT="$((git log -1 --merges | grep "\[") | grep . && echo "" || echo $(git log -1 --merges --format=%B))""
echo "RELEASE_NOTE_CONTENT=$((git log -1 --merges | grep "\[") && echo "" || echo $(git log -1 --merges --format=%B))"
- 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 @@ -38,17 +38,21 @@ jobs:
ENV: ${{#mustacheCase}}secrets.ENV{{/mustacheCase}}
run: |
echo -e "$ENV" > .env
echo "RELEASE_NOTE_CONTENT="$(git log --merges --pretty=%B $(git describe --abbrev=0 --tags)..HEAD | grep "\[")""
# App Bundle requires Firebase connected to Play Store to upload https://appdistribution.page.link/KPoa
- name: Build Android apk
run: flutter build apk --flavor production --debug --build-number $GITHUB_RUN_NUMBER

- name: Generate release notes
id: generate-release-notes
run: |
echo "RELEASE_NOTE_CONTENT=$((git log -1 --merges | grep "\[") && echo "" || echo $(git log -1 --merges --format=%B))" >> $GITHUB_OUTPUT
- name: Deploy Android Production to Firebase
uses: wzieba/[email protected]
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}} env.RELEASE_NOTE {{/mustacheCase}}
releaseNotes: ${{#mustacheCase}} steps.generate-release-notes.outputs.RELEASE_NOTE_CONTENT {{/mustacheCase}}
file: build/app/outputs/flutter-apk/app-production-debug.apk
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,21 @@ 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))""
# App Bundle requires Firebase connected to Play Store to upload https://appdistribution.page.link/KPoa
- name: Build Android apk
run: flutter build apk --flavor staging --debug --build-number $GITHUB_RUN_NUMBER

- name: Generate release notes
id: generate-release-notes
run: |
echo "RELEASE_NOTE_CONTENT=$((git log -1 --merges | grep "\[") && echo "" || echo $(git log -1 --merges --format=%B))" >> $GITHUB_OUTPUT
- name: Deploy Android Staging to Firebase
uses: wzieba/[email protected]
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}} env.RELEASE_NOTE {{/mustacheCase}}
releaseNotes: ${{#mustacheCase}} steps.generate-release-notes.outputs.RELEASE_NOTE_CONTENT {{/mustacheCase}}
file: build/app/outputs/flutter-apk/app-staging-debug.apk
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,8 @@ def self.FIREBASE_TESTER_GROUPS
def self.GITHUB_RUN_NUMBER
ENV["GITHUB_RUN_NUMBER"]
end

def self.RELEASE_NOTE_CONTENT
ENV["RELEASE_NOTE_CONTENT"]
end
end
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: ENV["RELEASE_NOTE"]
notes: Environments.RELEASE_NOTES_CONTENT
)
end
end

0 comments on commit c7f17dc

Please sign in to comment.