Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#198] Generate and add "release notes" when distributing new builds on Firebase (staging and production) #270

Merged
merged 3 commits into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/android_deploy_production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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
21 changes: 21 additions & 0 deletions .github/workflows/android_deploy_staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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
32 changes: 32 additions & 0 deletions .github/workflows/configs/changelog-config.json
Original file line number Diff line number Diff line change
@@ -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
}
22 changes: 22 additions & 0 deletions .github/workflows/ios_deploy_staging_to_firebase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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/[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}}steps.changelog.outputs.changelog{{/mustacheCase}}
file: build/app/outputs/flutter-apk/app-production-release.apk
Original file line number Diff line number Diff line change
Expand Up @@ -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/[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}}steps.changelog.outputs.changelog{{/mustacheCase}}
file: build/app/outputs/flutter-apk/app-staging-debug.apk
Original file line number Diff line number Diff line change
@@ -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
}
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
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: ""
notes: Environments.RELEASE_NOTE_CONTENT
)
end
end
14 changes: 14 additions & 0 deletions sample/.github/workflows/android_deploy_production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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
21 changes: 21 additions & 0 deletions sample/.github/workflows/android_deploy_staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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
32 changes: 32 additions & 0 deletions sample/.github/workflows/configs/changelog-config.json
Original file line number Diff line number Diff line change
@@ -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
}
22 changes: 22 additions & 0 deletions sample/.github/workflows/ios_deploy_staging_to_firebase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Loading