diff --git a/.github/workflows/prepare.yml b/.github/workflows/prepare.yml index 903ca419..5e91f104 100644 --- a/.github/workflows/prepare.yml +++ b/.github/workflows/prepare.yml @@ -8,6 +8,9 @@ on: required: true outputs: + build-changelog: + description: "Build Changelog" + value: ${{ jobs.build-details.outputs.build-changelog }} build-number: description: "Build Number" value: ${{ jobs.build-details.outputs.build-number }} @@ -164,16 +167,36 @@ jobs: fetch-depth: 0 - name: Count Commits - id: commit_count + id: commit-count run: | COUNT=`git rev-list HEAD --count` - echo "::set-output name=commit_count::$COUNT" + echo "::set-output name=commit-count::$COUNT" + + - name: Latest Commit Message + id: commit-message + run: | + MESSAGE=`git show -s --format=%s` + echo "::set-output name=commit-message::$MESSAGE" + + - name: Build Changelog + id: build-changelog + uses: actions/github-script@v6 + env: + FLAVOR: ${{ inputs.flavor }} + MESSAGE: ${{ steps.commit-message.outputs.commit-message }} + with: + result-encoding: string + script: | + const defaultMessage = 'Thank you for testing pre-release builds of LunaSea! Please consider joining the Discord to give feedback to the developer.\n\nChanges can be found on GitHub or by going to settings/system!'; + const isEdge = process.env.FLAVOR === 'edge'; + if (isEdge) return process.env.MESSAGE ?? defaultMessage; + return defaultMessage; - name: Build Number id: build-number uses: actions/github-script@v6 env: - COUNT: ${{ steps.commit_count.outputs.commit_count }} + COUNT: ${{ steps.commit-count.outputs.commit-count }} with: result-encoding: string script: | @@ -194,10 +217,12 @@ jobs: - name: Log Build Details env: + changelog: ${{ steps.build-changelog.outputs.result }} number: ${{ steps.build-number.outputs.result }} title: ${{ steps.build-title.outputs.output }} version: ${{ steps.build-version.outputs.current-version }} run: | + echo "Build Changelog: $changelog" echo "Build Number: $number" echo "Build Title: $title" echo "Build Version: $version" @@ -226,12 +251,17 @@ jobs: - name: Generate Build Runner Files run: flutter packages pub run build_runner build - + + - name: Generate Changelog + run: | + echo ${{ needs.build-details.outputs.build-changelog }} > ${{ github.workspace }}/android/fastlane/metadata/android/en-CA/changelogs/default.txt + - name: Upload Core Files uses: actions/upload-artifact@v3 with: name: core-files path: | + ${{ github.workspace }}/android/fastlane/metadata/android/en-CA/changelogs/default.txt ${{ github.workspace }}/assets/localization ${{ github.workspace }}/lib/**/*.g.dart ${{ github.workspace }}/lib/system/environment.dart diff --git a/.github/workflows/publish_ios.yml b/.github/workflows/publish_ios.yml index e58da74f..698e24c0 100644 --- a/.github/workflows/publish_ios.yml +++ b/.github/workflows/publish_ios.yml @@ -3,6 +3,9 @@ name: Publish iOS on: workflow_call: inputs: + build-changelog: + required: true + type: string build-number: required: true type: string @@ -63,7 +66,7 @@ jobs: APPLE_STORE_CONNECT_KEY_FILEPATH: ${{ github.workspace }}/keys/appstore.p8 APPLE_STORE_CONNECT_KEY_ID: ${{ secrets.APPLE_STORE_CONNECT_KEY_ID }} APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} - run: bundle exec fastlane deploy_appstore groups:${{ inputs.flavor }} ipa:${{ github.workspace }}/output/lunasea-ios.ipa + run: bundle exec fastlane deploy_appstore groups:${{ inputs.flavor }} changelog:${{ inputs.build-changelog }} ipa:${{ github.workspace }}/output/lunasea-ios.ipa s3: name: S3 diff --git a/.github/workflows/publish_macos.yml b/.github/workflows/publish_macos.yml index 52bf2787..4b95576d 100644 --- a/.github/workflows/publish_macos.yml +++ b/.github/workflows/publish_macos.yml @@ -3,6 +3,9 @@ name: Publish macOS on: workflow_call: inputs: + build-changelog: + required: true + type: string build-number: required: true type: string @@ -63,7 +66,7 @@ jobs: APPLE_STORE_CONNECT_KEY_FILEPATH: ${{ github.workspace }}/keys/appstore.p8 APPLE_STORE_CONNECT_KEY_ID: ${{ secrets.APPLE_STORE_CONNECT_KEY_ID }} APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} - run: bundle exec fastlane deploy_appstore groups:${{ inputs.flavor }} pkg:${{ github.workspace }}/output/lunasea-macos-amd64.pkg + run: bundle exec fastlane deploy_appstore groups:${{ inputs.flavor }} changelog:${{ inputs.build-changelog }} pkg:${{ github.workspace }}/output/lunasea-macos-amd64.pkg s3: name: S3 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 57b38308..4f8dd7d5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -136,6 +136,7 @@ jobs: uses: JagandeepBrar/LunaSea/.github/workflows/publish_ios.yml@master with: flavor: ${{ inputs.flavor || 'edge' }} + build-changelog: ${{ needs.prepare.outputs.build-changelog }} build-number: ${{ needs.prepare.outputs.build-number }} build-title: ${{ needs.prepare.outputs.build-title }} secrets: @@ -173,6 +174,7 @@ jobs: uses: JagandeepBrar/LunaSea/.github/workflows/publish_macos.yml@master with: flavor: ${{ inputs.flavor || 'edge' }} + build-changelog: ${{ needs.prepare.outputs.build-changelog }} build-number: ${{ needs.prepare.outputs.build-number }} build-title: ${{ needs.prepare.outputs.build-title }} secrets: diff --git a/ios/fastlane/Fastfile b/ios/fastlane/Fastfile index b33eca76..64573ea1 100644 --- a/ios/fastlane/Fastfile +++ b/ios/fastlane/Fastfile @@ -81,7 +81,7 @@ platform :ios do connect_appstore_connect upload_to_testflight( - changelog: "Thank you for testing pre-release builds of LunaSea! Please consider joining the Discord to give feedback to the developer.\n\nChanges can be found on GitHub or by going to settings/system and tapping on the version tile!", + changelog: options[:changelog], distribute_external: true, groups: options[:groups], ipa: options[:ipa], diff --git a/macos/fastlane/Fastfile b/macos/fastlane/Fastfile index 9ac0c03b..434edc09 100644 --- a/macos/fastlane/Fastfile +++ b/macos/fastlane/Fastfile @@ -162,7 +162,7 @@ platform :mac do connect_appstore_connect upload_to_testflight( - changelog: "Thank you for testing pre-release builds of LunaSea! Please consider joining the Discord to give feedback to the developer.\n\nChanges can be found on GitHub or by going to settings/system and tapping on the version tile!", + changelog: options[:changelog], distribute_external: true, groups: options[:groups], pkg: options[:pkg],