Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: write build number to summary - no ticket #2232

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,26 @@ platform :ios do
def generate_build_number
build_number = `curl -H "Accept: text/plain" -X POST -d '' "https://incrementator.appspot.com/api/v1/code/ORUHILeMbXB4D5Z5conFzYoYpQPjVnyUA4pu56X2MHVJSFxM/increment"`
`echo BUILD_NUMBER=#{build_number} >> ./.post_build/.env`
write_extra_info_to_summary
build_number
end

def write_extra_info_to_summary
summary_file = ENV['GITHUB_STEP_SUMMARY']

if summary_file.nil? || summary_file.empty?
UI.error("GITHUB_STEP_SUMMARY is not set. Are you running in GitHub Actions?")
return
end
Comment on lines +303 to +306
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does it stop fastlane locally? if yes, we should just warn instead


File.open(summary_file, "a") do |file|
file.puts "## Fastlane Summary"
file.puts "- 🛠️ Version: '#{extra_info}'"
end

UI.message("Successfully wrote to GITHUB_STEP_SUMMARY.")
end

# Fetch dependencies and prepare for building a release
def prepare_for_release(options)
xcode_version = options[:xcode_version]
Expand Down
Loading