Skip to content
Merged
Show file tree
Hide file tree
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
16 changes: 10 additions & 6 deletions .github/actions/build-xcframework/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'Build XCFrameworks'
description: 'Build OpenSwiftUI xcframeworks, zip each one, and compute checksums'
description: 'Build OpenSwiftUI xcframeworks and generate binaryTarget entries'

inputs:
xcode-version:
Expand Down Expand Up @@ -29,7 +29,7 @@ runs:
- name: Build XCFrameworks
run: Scripts/build_xcframework.sh OpenSwiftUI
shell: bash
- name: Zip and Compute Checksums
- name: Compute Checksums and Generate Summary
id: checksums
shell: bash
env:
Expand All @@ -46,13 +46,17 @@ runs:
OpenRenderBoxShims
)
BODY=""
echo "### XCFramework Checksums" >> $GITHUB_STEP_SUMMARY
echo "### XCFramework Binary Targets" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo '```swift' >> $GITHUB_STEP_SUMMARY
for fw in "${FRAMEWORKS[@]}"; do
zip -r "$fw.xcframework.zip" "$fw.xcframework"
CHECKSUM=$(swift package compute-checksum "$fw.xcframework.zip")
ENTRY=$(printf '.binaryTarget(\n name: "%s",\n url: "https://github.com/OpenSwiftUIProject/OpenSwiftUI/releases/download/%s/%s.xcframework.zip",\n checksum: "%s"\n),' "$fw" "${TAG_NAME:-<TAG>}" "$fw" "$CHECKSUM")
if [ -n "$TAG_NAME" ]; then
zip -ry "$fw.xcframework.zip" "$fw.xcframework"
CHECKSUM=$(swift package compute-checksum "$fw.xcframework.zip")
ENTRY=$(printf '.binaryTarget(\n name: "%s",\n url: "https://github.com/OpenSwiftUIProject/OpenSwiftUI/releases/download/%s/%s.xcframework.zip",\n checksum: "%s"\n),' "$fw" "$TAG_NAME" "$fw" "$CHECKSUM")
else
ENTRY=$(printf '.binaryTarget(\n name: "%s",\n path: "%s.xcframework"\n),' "$fw" "$fw")
fi
echo "$ENTRY" >> $GITHUB_STEP_SUMMARY
if [ -n "$BODY" ]; then
BODY=$(printf '%s\n%s' "$BODY" "$ENTRY")
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/build_xcframework.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ jobs:
- uses: actions/checkout@v4
- name: Build XCFrameworks
uses: ./.github/actions/build-xcframework
- name: Upload Artifacts
uses: actions/upload-artifact@v4
- name: Zip XCFrameworks
run: cd build && zip -ry xcframeworks.zip *.xcframework
- name: Upload XCFrameworks
uses: actions/upload-artifact@v7
with:
name: xcframeworks
path: build/*.xcframework.zip
path: build/xcframeworks.zip
archive: false
Loading