-
Notifications
You must be signed in to change notification settings - Fork 267
ci: Update release workflow #1600
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
7a22b21
f59ad35
71e1091
8661c05
4031729
4548f27
6d39e2f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| name: Create GitHub Release | ||
|
|
||
| # This workflow creates a GitHub release in iOS-SDK and attaches the built zip files. | ||
| # Run this AFTER the release PR has been merged. | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| ref: | ||
| description: 'Branch or commit SHA to run on (e.g., main, 5.3-main)' | ||
| type: string | ||
| required: false | ||
| default: 'main' | ||
|
|
||
| permissions: | ||
| contents: write | ||
| pull-requests: read | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| # Step 1: Extract version from podspec | ||
| get-version: | ||
| runs-on: ubuntu-latest | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. does it work on Ubuntu? |
||
| outputs: | ||
| version: ${{ steps.extract_version.outputs.version }} | ||
| steps: | ||
| - name: Checkout OneSignal-iOS-SDK | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ github.event.inputs.ref }} | ||
|
|
||
| - name: Extract release version from podspec | ||
| id: extract_version | ||
| run: | | ||
| VERSION=$(grep -E "s.version\s*=" OneSignal.podspec | sed -E 's/.*"(.*)".*/\1/') | ||
| echo "version=$VERSION" >> $GITHUB_OUTPUT | ||
| echo "Extracted version: $VERSION" | ||
|
|
||
| # Step 2: Use reusable workflow to create GitHub release with release notes | ||
| create-release: | ||
| needs: get-version | ||
| uses: OneSignal/sdk-actions/.github/workflows/github-release.yml@main | ||
| with: | ||
| version: ${{ needs.get-version.outputs.version }} | ||
|
|
||
| # Step 3: Upload the 10 xcframework zips to the release | ||
| upload-assets: | ||
| needs: [get-version, create-release] | ||
| runs-on: macos-13 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh you are using two instances? why dont do everything in one isntance?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Id imagine for this upload job, ubuntu should work? |
||
|
|
||
| env: | ||
| VERSION: ${{ needs.get-version.outputs.version }} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we need this token? |
||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| steps: | ||
| - name: Checkout OneSignal-iOS-SDK | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ github.event.inputs.ref }} | ||
|
|
||
| - name: 📋 Display Configuration | ||
| run: | | ||
| echo "============================================" | ||
| echo "📦 Uploading assets for version: $VERSION" | ||
| echo "============================================" | ||
|
|
||
| - name: Upload xcframework zips to release | ||
| run: | | ||
| cd iOS_SDK/OneSignalSDK | ||
|
|
||
| gh release upload "$VERSION" \ | ||
| OneSignalCore.xcframework.zip \ | ||
| OneSignalExtension.xcframework.zip \ | ||
| OneSignalFramework.xcframework.zip \ | ||
| OneSignalInAppMessages.xcframework.zip \ | ||
| OneSignalLiveActivities.xcframework.zip \ | ||
| OneSignalLocation.xcframework.zip \ | ||
| OneSignalNotifications.xcframework.zip \ | ||
| OneSignalOSCore.xcframework.zip \ | ||
| OneSignalOutcomes.xcframework.zip \ | ||
| OneSignalUser.xcframework.zip | ||
|
|
||
| echo "✅ All xcframework zips uploaded successfully!" | ||
| echo "🔗 https://github.com/${{ github.repository }}/releases/tag/$VERSION" | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could run on merge of the release pr instead? e.g.
https://github.com/OneSignal/react-native-onesignal/blob/main/.github/workflows/cd.yml