Skip to content

Commit

Permalink
Add lane to upload artifact to S3 and run it in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
mokagio committed May 18, 2023
1 parent 325e4fd commit 1d76e80
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .buildkite/publish-react-native-ios-artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,8 @@ HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_CLEANUP=1 brew install xcbeautify
echo "--- :xcode: Build XCFramework"
./build.sh

echo "--- :s3: Uploading XCFramework to S3"
bundle exec fastlane upload_xcframework_to_s3

# Restore initial the location in the filesystem location
cd ..
25 changes: 23 additions & 2 deletions ios-xcframework/fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,32 @@

default_platform :ios

PROJECT_ROOT_FOLDER = File.dirname(File.expand_path(__dir__))

before_all do
# Ensure we use the latest version of the toolkit
check_for_toolkit_updates unless is_ci || ENV['FASTLANE_SKIP_TOOLKIT_UPDATE_CHECK']
end

lane :hello do
UI.message 'Hello, world!'
lane :upload_xcframework_to_s3 do |options|
xcframework_zip_path = File.join(PROJECT_ROOT_FOLDER, 'xcframeworks/Gutenberg.zip')

unless File.exist? xcframework_zip_path
UI.user_error! "Could not find XCFramework ZIP to upload at #{xcframework_zip_path}"
end

name = options.fetch(:name, nil)

if name.nil?
name = "Gutenberg-#{last_git_commit[:commit_hash]}.zip"
UI.message "No name provide, will default to #{name}"
end

upload_to_s3(
bucket: 'a8c-apps-public-artifacts',
key: name,
file: xcframework_zip_path,
auto_prefix: false,
skip_if_exists: false
)
end

0 comments on commit 1d76e80

Please sign in to comment.