|
| 1 | +name: Create GitHub Release |
| 2 | + |
| 3 | +# This workflow creates a GitHub release in iOS-SDK and attaches the built zip files. |
| 4 | +# Run this AFTER the release PR has been merged. |
| 5 | + |
| 6 | +on: |
| 7 | + workflow_dispatch: |
| 8 | + inputs: |
| 9 | + ref: |
| 10 | + description: 'Branch or commit SHA to run on (e.g., main, 5.3-main)' |
| 11 | + type: string |
| 12 | + required: false |
| 13 | + default: 'main' |
| 14 | + |
| 15 | +permissions: |
| 16 | + contents: write |
| 17 | + pull-requests: read |
| 18 | + |
| 19 | +concurrency: |
| 20 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 21 | + cancel-in-progress: true |
| 22 | + |
| 23 | +jobs: |
| 24 | + # Step 1: Extract version from podspec |
| 25 | + get-version: |
| 26 | + runs-on: ubuntu-latest |
| 27 | + outputs: |
| 28 | + version: ${{ steps.extract_version.outputs.version }} |
| 29 | + steps: |
| 30 | + - name: Checkout OneSignal-iOS-SDK |
| 31 | + uses: actions/checkout@v4 |
| 32 | + with: |
| 33 | + ref: ${{ github.event.inputs.ref }} |
| 34 | + |
| 35 | + - name: Extract release version from podspec |
| 36 | + id: extract_version |
| 37 | + run: | |
| 38 | + VERSION=$(grep -E "s.version\s*=" OneSignal.podspec | sed -E 's/.*"(.*)".*/\1/') |
| 39 | + echo "version=$VERSION" >> $GITHUB_OUTPUT |
| 40 | + echo "Extracted version: $VERSION" |
| 41 | +
|
| 42 | + # Step 2: Use reusable workflow to create GitHub release with release notes |
| 43 | + create-release: |
| 44 | + needs: get-version |
| 45 | + uses: OneSignal/sdk-actions/.github/workflows/github-release.yml@main |
| 46 | + with: |
| 47 | + version: ${{ needs.get-version.outputs.version }} |
| 48 | + |
| 49 | + # Step 3: Upload the 10 xcframework zips to the release |
| 50 | + upload-assets: |
| 51 | + needs: [get-version, create-release] |
| 52 | + runs-on: macos-13 |
| 53 | + |
| 54 | + env: |
| 55 | + VERSION: ${{ needs.get-version.outputs.version }} |
| 56 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 57 | + |
| 58 | + steps: |
| 59 | + - name: Checkout OneSignal-iOS-SDK |
| 60 | + uses: actions/checkout@v4 |
| 61 | + with: |
| 62 | + ref: ${{ github.event.inputs.ref }} |
| 63 | + |
| 64 | + - name: 📋 Display Configuration |
| 65 | + run: | |
| 66 | + echo "============================================" |
| 67 | + echo "📦 Uploading assets for version: $VERSION" |
| 68 | + echo "============================================" |
| 69 | +
|
| 70 | + - name: Upload xcframework zips to release |
| 71 | + run: | |
| 72 | + cd iOS_SDK/OneSignalSDK |
| 73 | +
|
| 74 | + gh release upload "$VERSION" \ |
| 75 | + OneSignalCore.xcframework.zip \ |
| 76 | + OneSignalExtension.xcframework.zip \ |
| 77 | + OneSignalFramework.xcframework.zip \ |
| 78 | + OneSignalInAppMessages.xcframework.zip \ |
| 79 | + OneSignalLiveActivities.xcframework.zip \ |
| 80 | + OneSignalLocation.xcframework.zip \ |
| 81 | + OneSignalNotifications.xcframework.zip \ |
| 82 | + OneSignalOSCore.xcframework.zip \ |
| 83 | + OneSignalOutcomes.xcframework.zip \ |
| 84 | + OneSignalUser.xcframework.zip |
| 85 | +
|
| 86 | + echo "✅ All xcframework zips uploaded successfully!" |
| 87 | + echo "🔗 https://github.com/${{ github.repository }}/releases/tag/$VERSION" |
0 commit comments