Skip to content

Commit 4e60df9

Browse files
authored
Fix issue where XCFramework archive built by CI was double-zipped and rejected by SPM (airbnb#1924)
1 parent ad510b8 commit 4e60df9

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

.github/workflows/main.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,14 @@ jobs:
6868
- name: Upload XCFramework
6969
uses: actions/upload-artifact@v2
7070
with:
71-
name: Lottie.xcframework
72-
path: .build/archives/Lottie.xcframework.zip
71+
name: BuildProducts
72+
# The xcframework is at the path `.build/archives/Lottie.xcframework.zip`.
73+
# GitHub always zips the artifacts before uploading, so if we uploaded the .xframework.zip
74+
# directly then it would actually upload a double-zip (a .zip containing our `Lottie.xcframework.zip`).
75+
# This is confusing especially since macOS Archive Utility automatially unzips both layers at once.
76+
# Instead, we upload the entire archives folder, resulting in an `XCFramework.zip` that unzips
77+
# to an `archives` directory containing our `Lottie.xcframework.zip`.
78+
path: .build/archives
7379

7480
cocoapod:
7581
name: "Lint CocoaPods podspec"

Rakefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ namespace :build do
6464
].join(" "))
6565
Dir.chdir('.build/archives') do
6666
sh 'zip -r Lottie.xcframework.zip Lottie.xcframework'
67+
sh 'rm -rf Lottie.xcframework'
6768
end
6869
sh 'swift package compute-checksum .build/archives/Lottie.xcframework.zip'
6970
end

script/ReleaseInstructions.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ Lottie is made available through multiple package managers, each of which has to
88
3. Update the [Cocoapod](https://cocoapods.org/pods/lottie-ios) by running `pod trunk push lottie-ios.podspec`
99
4. Update the [npm package](https://www.npmjs.com/package/lottie-ios) by running `npm publish`
1010
5. Attach `Lottie.xframework.zip` to the GitHub release
11-
- For every PR / commit, `Lottie.xcframework.zip` is build by CI and uploaded to the job summary.
11+
- For every PR / commit, `Lottie.xcframework.zip` is built by CI and uploaded to the job summary once all jobs are completed.
12+
- Make sure to use the `Lottie.xcframework.zip` from the CI job for the commit on master / the specific release tag and not from a PR CI job.
1213
6. Update the [lottie-spm](https://github.com/airbnb/lottie-spm) [Package.swift](https://github.com/airbnb/lottie-spm/blob/main/Package.swift) manifest to reference the new version's XCFramework.
14+
- You can compute the checksum by running `swift package compute-checksum Lottie.xcframework.zip`.
1315
- Optionally, consider updating the version number in `README.md` as well.
1416
7. Publish the new release in the [lottie-spm](https://github.com/airbnb/lottie-spm) repo

0 commit comments

Comments
 (0)