-
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
7a22b21
nit(cleanup): remove unused semantic version helpers
nan-li f59ad35
ci: Update `create-release-prs` workflow
nan-li 71e1091
ci: add `create-github-release.yml` to make tagged release with zips
nan-li 8661c05
ci: add `publish-release.yml` to push to pods, SPM
nan-li 4031729
chore: delete stale workflow files
nan-li 4548f27
use updated shared workflows consider target branch
nan-li 6d39e2f
Add warning to Package.swift
nan-li e637e88
chore: use ubuntu-latest for upload-assets job
nan-li 9bef2c6
chore: auto-trigger create-github-release on release PR merge
nan-li File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| name: Create GitHub Release | ||
|
|
||
| # This workflow creates a GitHub release in iOS-SDK and attaches the built zip files. | ||
| # Runs automatically when a release PR is merged. | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: | ||
| - closed | ||
| branches: | ||
| - main | ||
| - '*-main' # Matches version branches like 5.3-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: | ||
| if: | | ||
| github.event.pull_request.merged == true && | ||
| contains(github.event.pull_request.title, 'Release') | ||
| runs-on: ubuntu-latest | ||
abdulraqeeb33 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| outputs: | ||
| version: ${{ steps.extract_version.outputs.version }} | ||
| steps: | ||
| - name: Checkout OneSignal-iOS-SDK | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ github.event.pull_request.base.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: ubuntu-latest | ||
|
|
||
| env: | ||
| VERSION: ${{ needs.get-version.outputs.version }} | ||
abdulraqeeb33 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| steps: | ||
| - name: Checkout OneSignal-iOS-SDK | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ github.event.pull_request.base.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" | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
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.
Yeah, good suggestion. We have a chance in this process to manually test releases before pushing out to package managers, but that happens after this workflow, so this one can be run automatically
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.
Changed in 9bef2c6