diff --git a/.github/workflows/publish-store.yml b/.github/workflows/publish-store.yml index 843930f90..ee0eeedf9 100644 --- a/.github/workflows/publish-store.yml +++ b/.github/workflows/publish-store.yml @@ -110,7 +110,6 @@ jobs: - name: Upload app to with Fastlane id: publish - if: ${{ inputs.dry-run == false }} env: VERSION_CODE: ${{ inputs.build-number }} VERSION_NAME: ${{inputs.build-version}} @@ -119,7 +118,16 @@ jobs: CHANGELOG: ${{ inputs.changelog }} FASTLANE_ENABLE_BETA_DELIVER_SYNC_SCREENSHOTS: true SUBMIT_RELEASE: ${{ inputs.submit-release }} + DRY_RUN: ${{ inputs.dry-run }} run: | + if [ "$DRY_RUN" = "true" ]; then + echo "๐Ÿงช DRY RUN MODE - Testing without actual App Store submission" + echo "๐Ÿ“ฆ Would publish build $VERSION_CODE to iOS App Store" + else + echo "๐Ÿš€ PRODUCTION MODE - Publishing to iOS App Store" + echo "๐Ÿ“ฆ Publishing build $VERSION_CODE to iOS App Store" + fi + if [ "$PRODUCT" = "Password Manager" ]; then PACKAGE_NAME="com.8bit.bitwarden" METADATA_PATH="metadata_bwpm_prod" @@ -139,7 +147,8 @@ jobs: app_identifier:"$PACKAGE_NAME" \ changelog:"$CHANGELOG" \ metadata_path:"$METADATA_PATH" \ - submit_release:"$SUBMIT_RELEASE" + submit_release:"$SUBMIT_RELEASE" \ + dry_run:"$DRY_RUN" - name: Enable Publish Github Release Workflow if: ${{ steps.publish.conclusion == 'success' }} diff --git a/fastlane/Fastfile b/fastlane/Fastfile index bd9b8814c..77ca433fd 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -452,11 +452,26 @@ platform :ios do |options| desc "Submit iOS app to the App Store" lane :release_to_production do |options| - changelog = options[:changelog] + changelog = options[:changelog] || "Bug fixes and improvements" + is_dry_run = options[:dry_run] == "true" || options[:dry_run] == true + + formatted_changelog = changelog + .split('.') + .map(&:strip) + .reject(&:empty?) + .map { |item| "โ€ข #{item.gsub(/\A(?:โ€ข|\u2022)\s*/, '')}" } + .join("\n") + auth_locales = ["en-US"] pw_manager_locales = ["ca", "zh-Hans", "zh-Hant", "hr", "cs", "da", "nl-NL", "en-US", "fi", "fr-FR", "de-DE", "id", "it", "ja", "ko", "no", "pl", "pt-PT", "pt-BR", "ro", "ru", "sk", "es-ES", "es-MX", "sv", "tr", "uk", "vi"] metadata_path = options[:metadata_path] + if is_dry_run + UI.header("๐Ÿงช DRY RUN: Testing iOS App Store submission") + else + UI.header("๐Ÿš€ Publishing iOS app to App Store") + end + if options[:app_identifier] == "com.bitwarden.authenticator" locales = auth_locales else @@ -466,7 +481,7 @@ platform :ios do |options| locales.each do |locale| dir = "#{metadata_path}/#{locale}" FileUtils.mkdir_p(dir) - File.write("#{dir}/release_notes.txt", changelog) + File.write("#{dir}/release_notes.txt", formatted_changelog) end notes = locales.each_with_object({}) do |locale, hash| @@ -478,6 +493,16 @@ platform :ios do |options| end end + if is_dry_run + UI.important("๐Ÿงช DRY RUN MODE - Skipping actual App Store Connect submission") + UI.message("โœ… Validation passed") + UI.message("โœ… Release notes prepared for #{locales.count} locales") + UI.message("โœ… Release notes: ") + UI.message("#{formatted_changelog}") + UI.success("๐ŸŽฏ DRY RUN COMPLETE - Everything looks ready for production!") + next # โ† EXITS HERE in dry run + end + deliver( force: true, app_identifier: options[:app_identifier],