@@ -9,8 +9,15 @@ permissions:
99 contents : write
1010
1111jobs :
12- release :
13- name : Build and Release XCFrameworks
12+ release-notes :
13+ uses : ./.github/workflows/release_notes.yml
14+ with :
15+ tag-name : ${{ github.ref_name }}
16+ secrets : inherit
17+
18+ build-xcframeworks :
19+ name : Build and Upload XCFrameworks
20+ needs : release-notes
1421 runs-on : macos-15
1522 outputs :
1623 checksum_OpenSwiftUI : ${{ steps.build.outputs.checksum_OpenSwiftUI }}
@@ -33,41 +40,35 @@ jobs:
3340 tag-name : ${{ github.ref_name }}
3441 signing-certificate-base64 : ${{ secrets.SIGNING_CERTIFICATE_BASE_64 }}
3542 signing-certificate-password : ${{ secrets.SIGNING_CERTIFICATE_PASSWORD }}
36- - name : Create Release
37- uses : ncipollo/release-action@v1
38- with :
39- body : |
40- ```swift
41- ${{ steps.build.outputs.body }}
42- ```
43- allowUpdates : true
44- artifacts : " build/*.xcframework.zip"
45- token : ${{ secrets.GITHUB_TOKEN }}
43+ - name : Upload assets to release
44+ run : gh release upload "${{ github.ref_name }}" build/*.xcframework.zip --clobber
4645
4746 update-binary-repo :
4847 name : Update OpenSwiftUI-spm
49- needs : release
48+ needs : build-xcframeworks
5049 runs-on : ubuntu-latest
51- if : ${{ secrets.BINARY_REPO_PAT != '' }}
50+ env :
51+ BINARY_REPO_PAT : ${{ secrets.BINARY_REPO_PAT }}
5252 steps :
53- - name : Clone binary repo
54- run : |
55- git clone https://x-access-token:${{ secrets.BINARY_REPO_PAT }}@github.com/OpenSwiftUIProject/OpenSwiftUI-spm.git
56- cd OpenSwiftUI-spm
57- git config user.name "github-actions[bot]"
58- git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
59- - name : Generate Package.swift from template
53+ - name : Update binary repo
6054 env :
6155 VERSION : ${{ github.ref_name }}
62- CHECKSUM_OpenSwiftUI : ${{ needs.release .outputs.checksum_OpenSwiftUI }}
63- CHECKSUM_OpenSwiftUICore : ${{ needs.release .outputs.checksum_OpenSwiftUICore }}
64- CHECKSUM_OpenAttributeGraphShims : ${{ needs.release .outputs.checksum_OpenAttributeGraphShims }}
65- CHECKSUM_OpenCoreGraphicsShims : ${{ needs.release .outputs.checksum_OpenCoreGraphicsShims }}
66- CHECKSUM_OpenObservation : ${{ needs.release .outputs.checksum_OpenObservation }}
67- CHECKSUM_OpenQuartzCoreShims : ${{ needs.release .outputs.checksum_OpenQuartzCoreShims }}
68- CHECKSUM_OpenRenderBoxShims : ${{ needs.release .outputs.checksum_OpenRenderBoxShims }}
56+ CHECKSUM_OpenSwiftUI : ${{ needs.build-xcframeworks .outputs.checksum_OpenSwiftUI }}
57+ CHECKSUM_OpenSwiftUICore : ${{ needs.build-xcframeworks .outputs.checksum_OpenSwiftUICore }}
58+ CHECKSUM_OpenAttributeGraphShims : ${{ needs.build-xcframeworks .outputs.checksum_OpenAttributeGraphShims }}
59+ CHECKSUM_OpenCoreGraphicsShims : ${{ needs.build-xcframeworks .outputs.checksum_OpenCoreGraphicsShims }}
60+ CHECKSUM_OpenObservation : ${{ needs.build-xcframeworks .outputs.checksum_OpenObservation }}
61+ CHECKSUM_OpenQuartzCoreShims : ${{ needs.build-xcframeworks .outputs.checksum_OpenQuartzCoreShims }}
62+ CHECKSUM_OpenRenderBoxShims : ${{ needs.build-xcframeworks .outputs.checksum_OpenRenderBoxShims }}
6963 run : |
64+ if [ -z "$BINARY_REPO_PAT" ]; then
65+ echo "::notice::BINARY_REPO_PAT not set, skipping binary repo update"
66+ exit 0
67+ fi
68+ git clone https://x-access-token:${BINARY_REPO_PAT}@github.com/OpenSwiftUIProject/OpenSwiftUI-spm.git
7069 cd OpenSwiftUI-spm
70+ git config user.name "github-actions[bot]"
71+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
7172 sed \
7273 -e "s|{{VERSION}}|${VERSION}|g" \
7374 -e "s|{{CHECKSUM_OpenSwiftUI}}|${CHECKSUM_OpenSwiftUI}|g" \
8081 Package.swift.template > Package.swift
8182 echo "Generated Package.swift:"
8283 head -50 Package.swift
83- - name : Commit, push, and tag
84- env :
85- VERSION : ${{ github.ref_name }}
86- run : |
87- cd OpenSwiftUI-spm
8884 git add Package.swift
8985 git diff --cached --quiet && echo "No changes" && exit 0
9086 git commit -m "Update to ${VERSION} with code-signed XCFrameworks"
0 commit comments