|
| 1 | +name: Upload XCFrameworks |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - release/** |
| 6 | + |
| 7 | +jobs: |
| 8 | + # Craft uses the Git commit hash to query GitHub Actions for artifacts |
| 9 | + # uploaded in a workflow run associated with that commit. |
| 10 | + # |
| 11 | + # To support this, we download the XCFramework already built and uploaded |
| 12 | + # in release.yml (triggered via workflow_dispatch), and reupload it here. |
| 13 | + # This associates it with the new commit in the release branch, which is |
| 14 | + # created by getsentry/action-prepare-release in release.yml. |
| 15 | + # |
| 16 | + # This is necessary because Swift Package Manager requires a checksum for |
| 17 | + # XCFrameworks, creating a chicken-and-egg problem: we need the XCFramework |
| 18 | + # to generate the checksum, but we also need the checksum to update Package.swift. |
| 19 | + # |
| 20 | + # The sequence is: |
| 21 | + # 1. Build the XCFrameworks in release.yml. |
| 22 | + # 2. getsentry/action-prepare-release updates Package.swift with the checksum. |
| 23 | + # 3. Upload the XCFrameworks again here so Craft can find it by commit. |
| 24 | + upload-xcframeworks: |
| 25 | + runs-on: ubuntu-latest |
| 26 | + steps: |
| 27 | + - uses: actions/checkout@v4 |
| 28 | + |
| 29 | + - name: Get Release workflow run ID |
| 30 | + run: echo "FRAMEWORK_RUN_ID=$(./scripts/xcframework-generated-run.sh)" >> $GITHUB_ENV |
| 31 | + |
| 32 | + - uses: actions/download-artifact@v4 |
| 33 | + with: |
| 34 | + name: xcframeworks.zip |
| 35 | + path: Carthage/ |
| 36 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 37 | + run-id: ${{ env.FRAMEWORK_RUN_ID }} |
| 38 | + |
| 39 | + - name: Archive XCFrameworks for Craft |
| 40 | + uses: actions/upload-artifact@v4 |
| 41 | + with: |
| 42 | + # Craft uses the git commit hash of the release branch to download the release artifacts. |
| 43 | + name: ${{ github.sha }} |
| 44 | + if-no-files-found: error |
| 45 | + overwrite: true |
| 46 | + path: | |
| 47 | + ${{github.workspace}}/Carthage/*.zip |
0 commit comments