Skip to content

Commit 6409db5

Browse files
authored
Fix code verification in attach-binary-to-github lane (#26)
1 parent 8e668cc commit 6409db5

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

fastlane/Fastfile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,15 @@ lane :download_xcframework_from_nexus_and_attach_to_github_release do |options|
111111
UI.user_error!("Checksum in Package.swift does not match the checksum of the downloaded file.") unless package_swift_contains_checksum
112112

113113
# Check if the downloaded xcframework file is signed and the signature is valid
114-
sh "codesign --verify #{asset_file}" # Returns code 1 if the signature is invalid or the xcframework is not signed at all
114+
# Extract the zip file to verify the signature
115+
sh "unzip -q #{asset_file} -d ./Downloads/"
116+
117+
# Find the .xcframework directory in the extracted content
118+
xcframework_path = Dir.glob("./Downloads/*.xcframework").first
119+
UI.user_error!("No .xcframework found in the extracted zip file.") unless xcframework_path
120+
121+
# Verify the code signature
122+
sh "codesign --verify #{xcframework_path}" # Returns code 1 if the signature is invalid or the xcframework is not signed at all
115123

116124
# Upload the xcframework.zip to GitHub release
117125
asset_file = "./Downloads/#{File.basename(artefact_path)}"

0 commit comments

Comments
 (0)