[PM-9472] Update release notes generated for Firebase (#3664)

This commit is contained in:
Patrick Honkonen 2024-08-02 10:48:33 -04:00 committed by GitHub
parent 055fbc1277
commit 0612a5834a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 29 additions and 3 deletions

View file

@ -28,6 +28,7 @@ on:
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JAVA_VERSION: 17 JAVA_VERSION: 17
GITHUB_ACTION_RUN_URL: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
jobs: jobs:
build: build:
@ -355,6 +356,7 @@ jobs:
APP_PLAY_FIREBASE_CREDS_PATH: ${{ github.workspace }}/secrets/app_play_prod_firebase-creds.json APP_PLAY_FIREBASE_CREDS_PATH: ${{ github.workspace }}/secrets/app_play_prod_firebase-creds.json
run: | run: |
bundle exec fastlane distributeReleasePlayStoreToFirebase \ bundle exec fastlane distributeReleasePlayStoreToFirebase \
actionUrl:${{ env.GITHUB_ACTION_RUN_URL }} \
service_credentials_file:${{ env.APP_PLAY_FIREBASE_CREDS_PATH }} service_credentials_file:${{ env.APP_PLAY_FIREBASE_CREDS_PATH }}
- name: Publish beta artifacts to Firebase - name: Publish beta artifacts to Firebase
@ -363,6 +365,7 @@ jobs:
APP_PLAY_FIREBASE_CREDS_PATH: ${{ github.workspace }}/secrets/app_play_prod_firebase-creds.json APP_PLAY_FIREBASE_CREDS_PATH: ${{ github.workspace }}/secrets/app_play_prod_firebase-creds.json
run: | run: |
bundle exec fastlane distributeBetaPlayStoreToFirebase \ bundle exec fastlane distributeBetaPlayStoreToFirebase \
actionUrl:${{ env.GITHUB_ACTION_RUN_URL }} \
service_credentials_file:${{ env.APP_PLAY_FIREBASE_CREDS_PATH }} service_credentials_file:${{ env.APP_PLAY_FIREBASE_CREDS_PATH }}
- name: Verify Play Store credentials - name: Verify Play Store credentials
@ -526,4 +529,5 @@ jobs:
APP_FDROID_FIREBASE_CREDS_PATH: ${{ github.workspace }}/secrets/app_fdroid_firebase-creds.json APP_FDROID_FIREBASE_CREDS_PATH: ${{ github.workspace }}/secrets/app_fdroid_firebase-creds.json
run: | run: |
bundle exec fastlane distributeReleaseFDroidToFirebase \ bundle exec fastlane distributeReleaseFDroidToFirebase \
actionUrl:${{ env.GITHUB_ACTION_RUN_URL }} \
service_credentials_file:${{ env.APP_FDROID_FIREBASE_CREDS_PATH }} service_credentials_file:${{ env.APP_FDROID_FIREBASE_CREDS_PATH }}

View file

@ -180,37 +180,49 @@ platform :android do
desc "Publish Release Play Store artifacts to Firebase App Distribution" desc "Publish Release Play Store artifacts to Firebase App Distribution"
lane :distributeReleasePlayStoreToFirebase do |options| lane :distributeReleasePlayStoreToFirebase do |options|
releaseNotes = generateReleaseNotes(
repoName: "android",
actionUrl: "#{options[:actionUrl]}"
)
firebase_app_distribution( firebase_app_distribution(
app: "1:64530857057:android:f8d67b786db1b844", app: "1:64530857057:android:f8d67b786db1b844",
android_artifact_type: "APK", android_artifact_type: "APK",
android_artifact_path: "app/build/outputs/apk/standard/release/com.x8bit.bitwarden-standard-release.apk", android_artifact_path: "app/build/outputs/apk/standard/release/com.x8bit.bitwarden-standard-release.apk",
service_credentials_file: options[:service_credentials_file], service_credentials_file: options[:service_credentials_file],
groups: "internal-prod-group, livefront", groups: "internal-prod-group, livefront",
release_notes: "Native Play Store Release from commit #{sh("git rev-parse --short HEAD")} on branch #{sh("git rev-parse --abbrev-ref HEAD")}", release_notes: "#{releaseNotes}",
) )
end end
desc "Publish Beta Play Store artifacts to Firebase App Distribution" desc "Publish Beta Play Store artifacts to Firebase App Distribution"
lane :distributeBetaPlayStoreToFirebase do |options| lane :distributeBetaPlayStoreToFirebase do |options|
releaseNotes = generateReleaseNotes(
repoName: "android",
actionUrl: "#{options[:actionUrl]}"
)
firebase_app_distribution( firebase_app_distribution(
app: "1:64530857057:android:54c1ae56b269b959887e20", app: "1:64530857057:android:54c1ae56b269b959887e20",
android_artifact_type: "APK", android_artifact_type: "APK",
android_artifact_path: "app/build/outputs/apk/standard/beta/com.x8bit.bitwarden-standard-beta.apk", android_artifact_path: "app/build/outputs/apk/standard/beta/com.x8bit.bitwarden-standard-beta.apk",
service_credentials_file: options[:service_credentials_file], service_credentials_file: options[:service_credentials_file],
groups: "internal-prod-group, livefront", groups: "internal-prod-group, livefront",
release_notes: "Native Play Store Beta from commit #{sh("git rev-parse --short HEAD")} on branch #{sh("git rev-parse --abbrev-ref HEAD")}", release_notes: "#{releaseNotes}",
) )
end end
desc "Publish Release F-Droid artifacts to Firebase App Distribution" desc "Publish Release F-Droid artifacts to Firebase App Distribution"
lane :distributeReleaseFDroidToFirebase do |options| lane :distributeReleaseFDroidToFirebase do |options|
releaseNotes = generateReleaseNotes(
repoName: "android",
actionUrl: "#{options[:actionUrl]}"
)
firebase_app_distribution( firebase_app_distribution(
app: "1:439897860529:android:b143708734b99c0e3fb590", app: "1:439897860529:android:b143708734b99c0e3fb590",
android_artifact_type: "APK", android_artifact_type: "APK",
android_artifact_path: "app/build/outputs/apk/fdroid/release/com.x8bit.bitwarden-fdroid-release.apk", android_artifact_path: "app/build/outputs/apk/fdroid/release/com.x8bit.bitwarden-fdroid-release.apk",
service_credentials_file: options[:service_credentials_file], service_credentials_file: options[:service_credentials_file],
groups: "internal-prod-group, livefront", groups: "internal-prod-group, livefront",
release_notes: "Native F-Droid Beta from commit #{sh("git rev-parse --short HEAD")} on branch #{sh("git rev-parse --abbrev-ref HEAD")}", release_notes: "#{releaseNotes}"
) )
end end
@ -224,4 +236,14 @@ platform :android do
aab: "app/build/outputs/bundle/standardBeta/com.x8bit.bitwarden-standard-beta.aab", aab: "app/build/outputs/bundle/standardBeta/com.x8bit.bitwarden-standard-beta.aab",
) )
end end
desc "Generate release notes"
lane :generateReleaseNotes do |options|
branchName = `git rev-parse --abbrev-ref HEAD`.chomp()
releaseNotes = changelog_from_git_commits(
commits_count: 1,
pretty: "%s%n#{options[:repoName]}/#{branchName} @ %h %n %n#{options[:actionUrl]}"
)
releaseNotes
end
end end