diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7ede8d05a1..a0c0445491 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -15,9 +15,14 @@ on: required: true type: number rollout-percentage: - description: "Starting percentage of users who will receive this version update." + description: "Percentage of users who will receive this version update." required: true - type: number + type: choice + options: + - 10% + - 30% + - 50% + - 100% release-notes: description: "Change notes to be included with this release." type: string @@ -50,16 +55,6 @@ jobs: bundle config path vendor/bundle bundle install --jobs 4 --retry 3 - # - name: Check - # run: bundle exec fastlane check - - # - name: Upload test reports on failure - # uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 - # if: failure() - # with: - # name: test-reports - # path: app/build/reports/tests/ - - name: Log in to Azure uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0 with: @@ -93,6 +88,12 @@ jobs: echo "$FORMATTED_MESSAGE" >> $GITHUB_ENV echo "EOF" >> $GITHUB_ENV + - name: Convert input percentage + run: | + PERCENTAGE=${{ inputs.rollout-percentage }} + DECIMAL=$(awk "BEGIN {print $PERCENTAGE/100}") + echo "ROLL_OUT=$DECIMAL" >> $GITHUB_ENV + - name: Promote Play Store version to production env: PLAY_KEYSTORE_PASSWORD: ${{ secrets.PLAY_BETA_KEYSTORE_PASSWORD }} @@ -116,6 +117,6 @@ jobs: bundle exec fastlane promoteToProduction \ versionCode:"$VERSION_CODE" \ - rolloutPercentage:"$ROLLOUT_PERCENTAGE" \ + rolloutPercentage:"$ROLL_OUT" \ packageName:"$PACKAGE_NAME"\ releaseNotes:"$RELEASE_NOTES" diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 8a5e1d7309..94f87dbae5 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -387,7 +387,6 @@ platform :android do desc "Retrieve build from Github releases" lane :retrieveBuildFromGithub do |options| - version_codes = Actions.lane_context[SharedValues::GOOGLE_PLAY_TRACK_VERSION_CODES] UI.message("Version codes in beta track: #{version_codes}") @@ -413,17 +412,23 @@ platform :android do desc "Promote to production." lane :promoteToProduction do |options| - supply( + supply_options = { package_name: options[:packageName], version_code: options[:versionCode], - track: "Staged for Production", # The current track - track_promote_to: "production", # Target track + track: "Staged for Production", + track_promote_to: "production", # production is case sensitive skip_upload_apk: true, skip_upload_aab: true, - skip_upload_metadata: false, - track_promote_release_status: "inProgress", - # track_promote_release_status: "draft", - rollout: options[:rolloutPercentage] - ) + skip_upload_metadata: false + } + + if options[:rolloutPercentage] < 1 + supply_options[:track_promote_release_status] = "inProgress" + supply_options[:rollout] = options[:rolloutPercentage] + else + supply_options[:track_promote_release_status] = "complete" + end + + supply(supply_options) end end