diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 277a4769..7a64b30d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -80,6 +80,17 @@ jobs: SENTRY_URL: ${{ secrets.SENTRY_URL }} SENTRY_RELEASE: ${{ steps.build.outputs.SENTRY_RELEASE }} SENTRY_DIST: ${{ steps.build.outputs.SENTRY_DIST }} + - name: Upload Beta + if: github.event_name == 'push1' || github.event_name == 'release1' # Disabled for now + run: bash ${GITHUB_WORKSPACE}/Scripts/fastlane.sh + working-directory: Scripts + continue-on-error: true + env: + VERSION: ${{ steps.build.outputs.SENTRY_RELEASE }} + BUILD_NUMBER: ${{ steps.build.outputs.SENTRY_DIST }} + GOOGLE_SECRETS: ${{ secrets.GOOGLE_PLAY }} + APPLE_SECRETS: ${{ secrets.APPLE }} + release-job: name: Releasing needs: [ build_android ] diff --git a/Scripts/fastlane.sh b/Scripts/fastlane.sh new file mode 100644 index 00000000..531f0ab9 --- /dev/null +++ b/Scripts/fastlane.sh @@ -0,0 +1,22 @@ + set -e + set -x + + # -v checks if a variable exists + + + # We want to be in the project root folder, not the scripts folder + if [[ "$(pwd)" == *"/Scripts" ]]; then + cd .. + fi + +if [[ $GITHUB_EVENT_NAME == 'pull_request' ]]; then + exit 1 +fi + + if [[ $OS == 'macos-latest' ]]; then + cd ios + fastlane beta + else + cd android + fastlane beta + fi \ No newline at end of file diff --git a/android/fastlane/Fastfile b/android/fastlane/Fastfile index 022f9f3c..ca18cc59 100644 --- a/android/fastlane/Fastfile +++ b/android/fastlane/Fastfile @@ -15,9 +15,11 @@ update_fastlane default_platform(:android) desc "Deploy a new version to the Google Play" - lane :deploy do + lane :beta do setup_ci if ENV['CI'] + # note the `..`, since fastlane runs in the _fastlane_ directory + changelog = File.read("../../CHANGELOG.md") #gradle(task: "clean assembleRelease") - upload_to_play_store(aab: "../build/app/outputs/bundle/release/app-release.aab", track:"beta") + upload_to_play_store(aab: "../build/app/outputs/bundle/release/app-release.aab", track:"beta", release_notes: changelog, version_code: ENV['BUILD_NUMBER'], version_name: ENV['VERSION'], , json_key_data: ENV['GOOGLE_SECRETS']) end end diff --git a/ios/fastlane/Fastfile b/ios/fastlane/Fastfile index cd97eeb3..8116e086 100644 --- a/ios/fastlane/Fastfile +++ b/ios/fastlane/Fastfile @@ -7,7 +7,10 @@ platform :ios do desc "Push a new beta build to TestFlight" lane :beta do setup_ci if ENV['CI'] + + # note the `..`, since fastlane runs in the _fastlane_ directory + changelog = File.read("../../CHANGELOG.md") build_app(workspace: "Runner.xcworkspace", scheme: "Runner") - upload_to_testflight(skip_waiting_for_build_processing: true) + upload_to_testflight(skip_waiting_for_build_processing: true, changelog:changelog, build_number: ENV['BUILD_NUMBER'], app_version: ENV['VERSION'], reject_build_waiting_for_review: true) end end