diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 7b9792e19..989b72bb7 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -1,100 +1,281 @@ -name: iOS CD +name: Create Release PRs + +# Note: The "Use workflow from" dropdown selects which version of THIS workflow to run. +# Always select "main" unless you're testing workflow changes from another branch. +# The "base_branch" input below determines where the release PR will be targeted. on: workflow_dispatch: inputs: version: + description: "The version number of the release (e.g., 5.2.15 or 5.2.3-beta-01)" type: string - description: "The version number of the release" required: true - release_branch: + base_branch: + description: 'Target branch for the PR (e.g. main for regular releases, 5.3-main for 5.3.x releases)' type: string - description: "The release branch with bumped version numbers for the release" - required: true + required: false + default: 'main' + +permissions: + contents: write + pull-requests: write jobs: build: - name: Build the binaries for the release and create a PR runs-on: macos-13 + env: + VERSION: ${{ github.event.inputs.version }} + BASE_BRANCH: ${{ github.event.inputs.base_branch }} + RELEASE_BRANCH: rel/${{ github.event.inputs.version }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: - - name: setup xcode - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: '15.2' + - name: 📋 Display Configuration + run: | + echo "============================================" + echo "📦 Release Version: $VERSION" + echo "🎯 Base Branch (PR Target): $BASE_BRANCH" + echo "🌿 Release Branch (to create): $RELEASE_BRANCH" + echo "============================================" + - name: Checkout OneSignal-iOS-SDK uses: actions/checkout@v4 with: - ref: ${{github.event.inputs.release_branch}} + ref: ${{ env.BASE_BRANCH }} + fetch-depth: 0 + + - name: Create Release Branch + run: | + # Delete remote branch if it exists + git push origin --delete $RELEASE_BRANCH || true + + # Create and checkout new release branch + git checkout -b $RELEASE_BRANCH + echo "Created release branch: $RELEASE_BRANCH" + + - name: Setup Xcode + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: '15.2' - - name: Install the Apple distribution certificate and provisioning profile + - name: Install the Apple distribution certificate and provisioning profile (OneSignal) uses: apple-actions/import-codesign-certs@v2 with: keychain-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }} p12-file-base64: ${{ secrets.CERTIFICATES_P12 }} p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }} - - name: Install the Apple distribution certificate and provisioning profile + - name: Install the Apple distribution certificate and provisioning profile (Lilomi) uses: apple-actions/import-codesign-certs@v2 with: create-keychain: false # do not create a new keychain for this value keychain-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }} p12-file-base64: ${{ secrets.DEV_CERTIFICATES_P12 }} p12-password: ${{ secrets.DEV_CERTIFICATES_P12_PASSWORD }} - # - name: Bump Version Number - # run: | - - name: Build Binaries + + - name: Update Version in SDK and Podspec Files run: | cd iOS_SDK/OneSignalSDK - chmod +x ./build_all_frameworks.sh - ./build_all_frameworks.sh + chmod +x ./update_version.sh + ./update_version.sh $VERSION shell: bash - - name: Code Sign + + # DO a commit here + - name: Commit and Push Changes + run: | + git config --local user.email "noreply@onesignal.com" + git config --local user.name "SyncR 🤖" + + git commit -am "chore: bump version to $VERSION" + git push origin $RELEASE_BRANCH + + - name: Build Binaries run: | cd iOS_SDK/OneSignalSDK - codesign --timestamp -v --sign "Apple Distribution: OneSignal, Inc. (J3J28YJX9L)" OneSignal_Core/OneSignalCore.xcframework - codesign --timestamp -v --sign "Apple Distribution: OneSignal, Inc. (J3J28YJX9L)" OneSignal_Extension/OneSignalExtension.xcframework - codesign --timestamp -v --sign "Apple Distribution: OneSignal, Inc. (J3J28YJX9L)" OneSignal_InAppMessages/OneSignalInAppMessages.xcframework - codesign --timestamp -v --sign "Apple Distribution: OneSignal, Inc. (J3J28YJX9L)" OneSignal_Location/OneSignalLocation.xcframework - codesign --timestamp -v --sign "Apple Distribution: OneSignal, Inc. (J3J28YJX9L)" OneSignal_Notifications/OneSignalNotifications.xcframework - codesign --timestamp -v --sign "Apple Distribution: OneSignal, Inc. (J3J28YJX9L)" OneSignal_OSCore/OneSignalOSCore.xcframework - codesign --timestamp -v --sign "Apple Distribution: OneSignal, Inc. (J3J28YJX9L)" OneSignal_Outcomes/OneSignalOutcomes.xcframework - codesign --timestamp -v --sign "Apple Distribution: OneSignal, Inc. (J3J28YJX9L)" OneSignal_User/OneSignalUser.xcframework - codesign --timestamp -v --sign "Apple Distribution: OneSignal, Inc. (J3J28YJX9L)" OneSignal_XCFramework/OneSignalFramework.xcframework - codesign --timestamp -v --sign "Apple Distribution: OneSignal, Inc. (J3J28YJX9L)" OneSignal_LiveActivities/OneSignalLiveActivities.xcframework + chmod +x ./build_all_frameworks.sh + ./build_all_frameworks.sh shell: bash + + # - name: Code Sign + # run: | + # cd iOS_SDK/OneSignalSDK + # codesign --timestamp -v --sign "Apple Distribution: OneSignal, Inc. (J3J28YJX9L)" OneSignal_Core/OneSignalCore.xcframework + # codesign --timestamp -v --sign "Apple Distribution: OneSignal, Inc. (J3J28YJX9L)" OneSignal_Extension/OneSignalExtension.xcframework + # codesign --timestamp -v --sign "Apple Distribution: OneSignal, Inc. (J3J28YJX9L)" OneSignal_InAppMessages/OneSignalInAppMessages.xcframework + # codesign --timestamp -v --sign "Apple Distribution: OneSignal, Inc. (J3J28YJX9L)" OneSignal_Location/OneSignalLocation.xcframework + # codesign --timestamp -v --sign "Apple Distribution: OneSignal, Inc. (J3J28YJX9L)" OneSignal_Notifications/OneSignalNotifications.xcframework + # codesign --timestamp -v --sign "Apple Distribution: OneSignal, Inc. (J3J28YJX9L)" OneSignal_OSCore/OneSignalOSCore.xcframework + # codesign --timestamp -v --sign "Apple Distribution: OneSignal, Inc. (J3J28YJX9L)" OneSignal_Outcomes/OneSignalOutcomes.xcframework + # codesign --timestamp -v --sign "Apple Distribution: OneSignal, Inc. (J3J28YJX9L)" OneSignal_User/OneSignalUser.xcframework + # codesign --timestamp -v --sign "Apple Distribution: OneSignal, Inc. (J3J28YJX9L)" OneSignal_XCFramework/OneSignalFramework.xcframework + # codesign --timestamp -v --sign "Apple Distribution: OneSignal, Inc. (J3J28YJX9L)" OneSignal_LiveActivities/OneSignalLiveActivities.xcframework + # shell: bash + + # DO a commit here + # - name: Commit and Push Changes + # run: | + # git config --local user.email "noreply@onesignal.com" + # git config --local user.name "SyncR 🤖" + + # git commit -am "chore: build binaries" + # git push origin $RELEASE_BRANCH + - name: Update Swift Package run: | cd iOS_SDK/OneSignalSDK chmod +x ./update_swift_package.sh - ./update_swift_package.sh ${{github.event.inputs.version}} + ./update_swift_package.sh $VERSION shell: bash - - name: Commit Changes + + - name: Commit and Push Changes run: | git config --local user.email "noreply@onesignal.com" git config --local user.name "SyncR 🤖" - git add . - git commit -m "Release ${{github.event.inputs.version}}" - - name: Pushing changes - uses: ad-m/github-push-action@master - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - repository: 'OneSignal/OneSignal-iOS-SDK' - force: true - branch: ${{github.event.inputs.release_branch}} + git commit -am "chore: update Swift package" + git push origin $RELEASE_BRANCH + + + # TODO: Does this consider the base branch? + - name: Fetch Last GitHub Release Tag + id: fetch_last_release + run: | + echo "Fetching latest GitHub release tag..." + LAST_TAG=$(gh release list --limit 1 --json tagName --jq '.[0].tagName') + + if [[ -z "$LAST_TAG" ]]; then + echo "❌ No previous release tag found. Cannot generate release notes." + exit 0 + fi + + echo "✅ Found last release tag: $LAST_TAG" + echo "range=$LAST_TAG..HEAD" >> $GITHUB_OUTPUT + + + - name: Generate Release Notes from PR Titles + run: | + echo "## 🔖 Auto-Generated Release Notes" > pr_body.md + echo "" >> pr_body.md + + if [[ "$VERSION" == *"alpha"* ]]; then + CHANNEL="alpha" + elif [[ "$VERSION" == *"beta"* ]]; then + CHANNEL="beta" + else + CHANNEL="current" + fi + + echo "**Channels:** $CHANNEL" >> pr_body.md + echo "" >> pr_body.md + + RANGE="${{ steps.fetch_last_release.outputs.range }}" + echo "📦 Commit range: $RANGE" + + COMMITS=$(git log "$RANGE" --pretty=format:"%H" | sort -u) + + if [[ -z "$COMMITS" ]]; then + echo "❌ No commits found. Exiting." + exit 0 + fi + + > raw_titles.txt + for SHA in $COMMITS; do + PR_INFO=$(gh api "repos/${{ github.repository }}/commits/$SHA/pulls" \ + -H "Accept: application/vnd.github.groot-preview+json" 2>/dev/null) + + TITLE=$(echo "$PR_INFO" | jq -r '.[0].title // empty') + NUMBER=$(echo "$PR_INFO" | jq -r '.[0].number // empty') + + if [[ -n "$TITLE" && -n "$NUMBER" ]]; then + echo "$TITLE ([#$NUMBER](https://github.com/${{ github.repository }}/pull/$NUMBER))" >> raw_titles.txt + echo "✅ $SHA → $TITLE (#$NUMBER)" + else + echo "⚠️ $SHA → No PR found" + fi + done + + sort -fu raw_titles.txt > pr_titles.txt + + if [[ ! -s pr_titles.txt ]]; then + echo "❌ No PR titles found from commits. Exiting." + exit 0 + fi + + echo "" >> pr_body.md + echo "### 🚀 New Features" >> pr_body.md + grep -i '^feat' pr_titles.txt | sed 's/^/- /' >> pr_body.md || echo "- _None_" >> pr_body.md + + echo "" >> pr_body.md + echo "### 🐛 Bug Fixes" >> pr_body.md + grep -i '^bug' pr_titles.txt | sed 's/^/- /' >> pr_body.md || echo "- _None_" >> pr_body.md + + echo "" >> pr_body.md + echo "### 🔧 Improvements" >> pr_body.md + grep -i -E '^(perf|refactor)' pr_titles.txt | sed 's/^/- /' >> pr_body.md || echo "- _None_" >> pr_body.md + + echo "" >> pr_body.md + echo "### 📝 Uncategorized PRs" >> pr_body.md + grep -v -i -E '^(feat|bug|perf|refactor)' pr_titles.txt | sed 's/^/- /' >> pr_body.md || echo "- _None_" >> pr_body.md - - name: "Submitting PR" - uses: octokit/request-action@v2.x + echo "" >> pr_body.md + echo "### 📦 Version" >> pr_body.md + echo "$VERSION" >> pr_body.md + + + - name: Create Pull Request for iOS SDK + run: | + gh pr create \ + --title "Release $VERSION" \ + --body-file pr_body.md \ + --head "$RELEASE_BRANCH" \ + --base "$BASE_BRANCH" + + + + + - name: Checkout OneSignal-XCFramework + uses: actions/checkout@v4 with: - route: POST /repos/{owner}/{repo}/pulls - owner: OneSignal - repo: OneSignal-iOS-SDK - head: ${{github.event.inputs.release_branch}} - base: main - title: | - "Release ${{github.event.inputs.version}}" - body: | - "Add Release Notes For Review Here" + repository: OneSignal/OneSignal-XCFramework + ref: ${{ env.BASE_BRANCH }} + path: xcframework-repo + token: ${{ secrets.PAT_TOKEN }} + + - name: Update Package.swift in XCFramework Repository + run: | + # Copy Package.swift from iOS SDK to XCFramework repo + cp Package.swift xcframework-repo/Package.swift + + # Navigate to XCFramework repo + cd xcframework-repo + + # Delete remote branch if it exists + git push origin --delete $RELEASE_BRANCH || true + + # Create release branch + git checkout -b $RELEASE_BRANCH + + # Configure git + git config --local user.email "noreply@onesignal.com" + git config --local user.name "SyncR 🤖" + + # Commit changes + git commit -am "Release $VERSION" + + # Push to remote + git push origin $RELEASE_BRANCH + + - name: Create Pull Request for XCFramework Repository env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} + + + run: | + cd xcframework-repo + gh pr create \ + --title "Release $VERSION" \ + --body-file ../pr_body.md \ + --head "$RELEASE_BRANCH" \ + --base "$BASE_BRANCH" diff --git a/OneSignal.podspec b/OneSignal.podspec index 71975699c..52a1a6ff7 100755 --- a/OneSignal.podspec +++ b/OneSignal.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "OneSignal" - s.version = "5.2.15" + s.version = "5.2.16" s.summary = "OneSignal push notification library for mobile apps." s.homepage = "https://onesignal.com" s.license = { :type => 'MIT', :file => 'LICENSE' } diff --git a/OneSignalXCFramework.podspec b/OneSignalXCFramework.podspec index 080000429..208960ce3 100644 --- a/OneSignalXCFramework.podspec +++ b/OneSignalXCFramework.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "OneSignalXCFramework" - s.version = "5.2.15" + s.version = "5.2.16" s.summary = "OneSignal push notification library for mobile apps." s.homepage = "https://onesignal.com" s.license = { :type => 'MIT', :file => 'LICENSE' } diff --git a/Package.swift b/Package.swift index 3faf1cdc2..b573602af 100644 --- a/Package.swift +++ b/Package.swift @@ -114,53 +114,53 @@ let package = Package( ), .binaryTarget( name: "OneSignalFramework", - url: "https://github.com/OneSignal/OneSignal-iOS-SDK/releases/download/5.2.15/OneSignalFramework.xcframework.zip", - checksum: "ac13c2879825ac07a750042b177d31a6ae978f7e38cf2eab2c199c03f2b9269e" + url: "https://github.com/OneSignal/OneSignal-iOS-SDK/releases/download/5.2.16/OneSignalFramework.xcframework.zip", + checksum: "77c639454b9baad6a16176b0b3fd1ea01624217ae6b2e7ed842145f2697d07e0" ), .binaryTarget( name: "OneSignalInAppMessages", - url: "https://github.com/OneSignal/OneSignal-iOS-SDK/releases/download/5.2.15/OneSignalInAppMessages.xcframework.zip", - checksum: "1f3c39f3ea2c9c11160a26e0104cdf33d4dc65fd2bfdc2a846b0e47b7f5db33c" + url: "https://github.com/OneSignal/OneSignal-iOS-SDK/releases/download/5.2.16/OneSignalInAppMessages.xcframework.zip", + checksum: "b4a1506ae4b7033a8bb0a49cd5ea9f8596120d15c45910ed0ff53d5999a17908" ), .binaryTarget( name: "OneSignalLocation", - url: "https://github.com/OneSignal/OneSignal-iOS-SDK/releases/download/5.2.15/OneSignalLocation.xcframework.zip", - checksum: "9e0e1e954f7cd75254d6658e05a1f954a2666e97abb6715347361ded17f4ecef" + url: "https://github.com/OneSignal/OneSignal-iOS-SDK/releases/download/5.2.16/OneSignalLocation.xcframework.zip", + checksum: "b30b0e96470d5d4e41b54d28e7a3aba7fb4e9f98d3217273a4171032511d9316" ), .binaryTarget( name: "OneSignalUser", - url: "https://github.com/OneSignal/OneSignal-iOS-SDK/releases/download/5.2.15/OneSignalUser.xcframework.zip", - checksum: "90fa006e0f406e09677d65e664295a29da9b02221aca4d9f046a6583cc3dca18" + url: "https://github.com/OneSignal/OneSignal-iOS-SDK/releases/download/5.2.16/OneSignalUser.xcframework.zip", + checksum: "76b17935adc2af21712b5ee2266778716f32565891b08534c3a4fed5f93bbd06" ), .binaryTarget( name: "OneSignalNotifications", - url: "https://github.com/OneSignal/OneSignal-iOS-SDK/releases/download/5.2.15/OneSignalNotifications.xcframework.zip", - checksum: "d23445fe2b1ba21405a47e063cbb08e577e16eb635284a17cedca7145b9fa3ce" + url: "https://github.com/OneSignal/OneSignal-iOS-SDK/releases/download/5.2.16/OneSignalNotifications.xcframework.zip", + checksum: "bad9d75cea94253ba4496314157e66c462563b0071eb4a5ce07618115b0240c8" ), .binaryTarget( name: "OneSignalExtension", - url: "https://github.com/OneSignal/OneSignal-iOS-SDK/releases/download/5.2.15/OneSignalExtension.xcframework.zip", - checksum: "c1961b5c3a9fb156fc21f51f2f4631105361d7b22abb0c718f043f362b92def3" + url: "https://github.com/OneSignal/OneSignal-iOS-SDK/releases/download/5.2.16/OneSignalExtension.xcframework.zip", + checksum: "c9bab652d029b3137f2652f0a889c14d5df88937e7e4fd80057885bd6c83272c" ), .binaryTarget( name: "OneSignalOutcomes", - url: "https://github.com/OneSignal/OneSignal-iOS-SDK/releases/download/5.2.15/OneSignalOutcomes.xcframework.zip", - checksum: "04c13bb9f000424e6ac9a7d1eb946c4174bdfdaee5fb59414c71f7f311111967" + url: "https://github.com/OneSignal/OneSignal-iOS-SDK/releases/download/5.2.16/OneSignalOutcomes.xcframework.zip", + checksum: "4ce31aab9f4ddf52b2e4b78b09cefe4ab6b1e0e7d6a4970c1124136d8e047f73" ), .binaryTarget( name: "OneSignalOSCore", - url: "https://github.com/OneSignal/OneSignal-iOS-SDK/releases/download/5.2.15/OneSignalOSCore.xcframework.zip", - checksum: "779353af7b4be1f4869ee449e47815da8b6eb813e0592e8204625cadbf5430d6" + url: "https://github.com/OneSignal/OneSignal-iOS-SDK/releases/download/5.2.16/OneSignalOSCore.xcframework.zip", + checksum: "c2f34a8850bc6b576f42fcd04792b979dbf400d20d9fe6e463683a57b6241a71" ), .binaryTarget( name: "OneSignalCore", - url: "https://github.com/OneSignal/OneSignal-iOS-SDK/releases/download/5.2.15/OneSignalCore.xcframework.zip", - checksum: "fab9a7f47663ceaafaf993789027b75e4afbbd7feeb773e67924df20fe51bee8" + url: "https://github.com/OneSignal/OneSignal-iOS-SDK/releases/download/5.2.16/OneSignalCore.xcframework.zip", + checksum: "17066ab62fb0505bddf779f27bfe6590d4847905ac6df35643c941ebb1a5fe73" ), .binaryTarget( name: "OneSignalLiveActivities", - url: "https://github.com/OneSignal/OneSignal-iOS-SDK/releases/download/5.2.15/OneSignalLiveActivities.xcframework.zip", - checksum: "bda1140f2a35b56a0ed11875bd10d37017bd633ff3cd350705e8ea705e1abade" + url: "https://github.com/OneSignal/OneSignal-iOS-SDK/releases/download/5.2.16/OneSignalLiveActivities.xcframework.zip", + checksum: "31ff72b996f1d2defcac5059044cecc060564bed26d3eba354241f697a9800e8" ) ] ) diff --git a/iOS_SDK/OneSignalSDK/OneSignalCore/Source/OneSignalCommonDefines.h b/iOS_SDK/OneSignalSDK/OneSignalCore/Source/OneSignalCommonDefines.h index 8ed318877..c525c99cb 100644 --- a/iOS_SDK/OneSignalSDK/OneSignalCore/Source/OneSignalCommonDefines.h +++ b/iOS_SDK/OneSignalSDK/OneSignalCore/Source/OneSignalCommonDefines.h @@ -46,7 +46,7 @@ // "*" in comment line ending comment means the string value has not been changed // App -#define ONESIGNAL_VERSION @"050215" +#define ONESIGNAL_VERSION @"050216" #define OSUD_APP_ID @"GT_APP_ID" // * OSUD_APP_ID #define OSUD_REGISTERED_WITH_APPLE @"GT_REGISTERED_WITH_APPLE" // * OSUD_REGISTERED_WITH_APPLE diff --git a/iOS_SDK/OneSignalSDK/OneSignal_Core/OneSignalCore.xcframework.zip b/iOS_SDK/OneSignalSDK/OneSignal_Core/OneSignalCore.xcframework.zip index 92b867d4d..05254cd43 100644 Binary files a/iOS_SDK/OneSignalSDK/OneSignal_Core/OneSignalCore.xcframework.zip and b/iOS_SDK/OneSignalSDK/OneSignal_Core/OneSignalCore.xcframework.zip differ diff --git a/iOS_SDK/OneSignalSDK/OneSignal_Extension/OneSignalExtension.xcframework.zip b/iOS_SDK/OneSignalSDK/OneSignal_Extension/OneSignalExtension.xcframework.zip index e09f78b0b..5dbf90716 100644 Binary files a/iOS_SDK/OneSignalSDK/OneSignal_Extension/OneSignalExtension.xcframework.zip and b/iOS_SDK/OneSignalSDK/OneSignal_Extension/OneSignalExtension.xcframework.zip differ diff --git a/iOS_SDK/OneSignalSDK/OneSignal_InAppMessages/OneSignalInAppMessages.xcframework.zip b/iOS_SDK/OneSignalSDK/OneSignal_InAppMessages/OneSignalInAppMessages.xcframework.zip index 1e83a02a5..0532379cc 100644 Binary files a/iOS_SDK/OneSignalSDK/OneSignal_InAppMessages/OneSignalInAppMessages.xcframework.zip and b/iOS_SDK/OneSignalSDK/OneSignal_InAppMessages/OneSignalInAppMessages.xcframework.zip differ diff --git a/iOS_SDK/OneSignalSDK/OneSignal_LiveActivities/OneSignalLiveActivities.xcframework.zip b/iOS_SDK/OneSignalSDK/OneSignal_LiveActivities/OneSignalLiveActivities.xcframework.zip index cefe93ece..0a149acac 100644 Binary files a/iOS_SDK/OneSignalSDK/OneSignal_LiveActivities/OneSignalLiveActivities.xcframework.zip and b/iOS_SDK/OneSignalSDK/OneSignal_LiveActivities/OneSignalLiveActivities.xcframework.zip differ diff --git a/iOS_SDK/OneSignalSDK/OneSignal_Location/OneSignalLocation.xcframework.zip b/iOS_SDK/OneSignalSDK/OneSignal_Location/OneSignalLocation.xcframework.zip index 28b151b91..e3b414121 100644 Binary files a/iOS_SDK/OneSignalSDK/OneSignal_Location/OneSignalLocation.xcframework.zip and b/iOS_SDK/OneSignalSDK/OneSignal_Location/OneSignalLocation.xcframework.zip differ diff --git a/iOS_SDK/OneSignalSDK/OneSignal_Notifications/OneSignalNotifications.xcframework.zip b/iOS_SDK/OneSignalSDK/OneSignal_Notifications/OneSignalNotifications.xcframework.zip index 906cd42b5..19c2ad464 100644 Binary files a/iOS_SDK/OneSignalSDK/OneSignal_Notifications/OneSignalNotifications.xcframework.zip and b/iOS_SDK/OneSignalSDK/OneSignal_Notifications/OneSignalNotifications.xcframework.zip differ diff --git a/iOS_SDK/OneSignalSDK/OneSignal_OSCore/OneSignalOSCore.xcframework.zip b/iOS_SDK/OneSignalSDK/OneSignal_OSCore/OneSignalOSCore.xcframework.zip index 22d2691db..bd31c4bd3 100644 Binary files a/iOS_SDK/OneSignalSDK/OneSignal_OSCore/OneSignalOSCore.xcframework.zip and b/iOS_SDK/OneSignalSDK/OneSignal_OSCore/OneSignalOSCore.xcframework.zip differ diff --git a/iOS_SDK/OneSignalSDK/OneSignal_Outcomes/OneSignalOutcomes.xcframework.zip b/iOS_SDK/OneSignalSDK/OneSignal_Outcomes/OneSignalOutcomes.xcframework.zip index f7c66e021..b8211caf1 100644 Binary files a/iOS_SDK/OneSignalSDK/OneSignal_Outcomes/OneSignalOutcomes.xcframework.zip and b/iOS_SDK/OneSignalSDK/OneSignal_Outcomes/OneSignalOutcomes.xcframework.zip differ diff --git a/iOS_SDK/OneSignalSDK/OneSignal_User/OneSignalUser.xcframework.zip b/iOS_SDK/OneSignalSDK/OneSignal_User/OneSignalUser.xcframework.zip index 3e4f11768..5f346fc4a 100644 Binary files a/iOS_SDK/OneSignalSDK/OneSignal_User/OneSignalUser.xcframework.zip and b/iOS_SDK/OneSignalSDK/OneSignal_User/OneSignalUser.xcframework.zip differ diff --git a/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignalFramework.xcframework.zip b/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignalFramework.xcframework.zip index 78eeaeb6d..b63660488 100644 Binary files a/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignalFramework.xcframework.zip and b/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignalFramework.xcframework.zip differ diff --git a/iOS_SDK/OneSignalSDK/build_all_frameworks.sh b/iOS_SDK/OneSignalSDK/build_all_frameworks.sh index c9b7804ed..ac9854182 100755 --- a/iOS_SDK/OneSignalSDK/build_all_frameworks.sh +++ b/iOS_SDK/OneSignalSDK/build_all_frameworks.sh @@ -2,7 +2,7 @@ set -e WORKING_DIR=$(pwd) - +: ' create_xcframework() { FRAMEWORK_FOLDER_NAME=$1 @@ -69,3 +69,4 @@ create_xcframework "OneSignal_InAppMessages" "OneSignalInAppMessages" "OneSignal create_xcframework "OneSignal_XCFramework" "OneSignalFramework" "OneSignalFramework" open "${WORKING_DIR}" +' diff --git a/iOS_SDK/OneSignalSDK/update_version.sh b/iOS_SDK/OneSignalSDK/update_version.sh new file mode 100755 index 000000000..401568789 --- /dev/null +++ b/iOS_SDK/OneSignalSDK/update_version.sh @@ -0,0 +1,80 @@ +#!/bin/bash +set -e + +# Script to update the SDK version across the codebase +# Updates: .podspec files and ONESIGNAL_VERSION +# Usage: ./update_version.sh + +if [ -z "$1" ]; then + echo "Error: Version number is required" + echo "Usage: ./update_version.sh " + exit 1 +fi + +VERSION=$1 + +WORKING_DIR=$(pwd) +REPO_ROOT="${WORKING_DIR}/../.." + +# Validate version format (supports X.Y.Z or X.Y.Z-suffix) +if ! [[ $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+(-.*)?$ ]]; then + echo "Error: Version must be in format X.Y.Z or X.Y.Z-suffix (e.g., 5.2.15 or 5.2.3-beta-01)" + exit 1 +fi + +# Convert semantic version to numeric version +# Examples: "5.2.15" -> "050215", "5.2.3-beta-01" -> "050203-beta-01" +convert_to_numeric() { + local version=$1 + local version_part="" + local suffix="" + + # Split by dash to separate version and suffix + if [[ $version == *"-"* ]]; then + version_part="${version%%-*}" + suffix="-${version#*-}" + else + version_part="$version" + fi + + # Split version by dots and pad each part to 2 digits + IFS='.' read -r major minor patch <<< "$version_part" + printf "%02d%02d%02d%s" "$major" "$minor" "$patch" "$suffix" +} + +VERSION_NUMERIC=$(convert_to_numeric "$VERSION") + +ONESIGNAL_PODSPEC="${REPO_ROOT}/OneSignal.podspec" +ONESIGNAL_XCFRAMEWORK_PODSPEC="${REPO_ROOT}/OneSignalXCFramework.podspec" +ONESIGNAL_COMMON_DEFINES="${WORKING_DIR}/OneSignalCore/Source/OneSignalCommonDefines.h" + +echo "Updating version to ${VERSION}..." + +# Update OneSignal.podspec +if [ -f "$ONESIGNAL_PODSPEC" ]; then + sed -i '' "s/s\.version[[:space:]]*=[[:space:]]*\"[^\"]*\"/s.version = \"${VERSION}\"/" "$ONESIGNAL_PODSPEC" + echo "✓ Updated OneSignal.podspec" +else + echo "Error: OneSignal.podspec not found at ${ONESIGNAL_PODSPEC}" + exit 1 +fi + +# Update OneSignalXCFramework.podspec +if [ -f "$ONESIGNAL_XCFRAMEWORK_PODSPEC" ]; then + sed -i '' "s/s\.version[[:space:]]*=[[:space:]]*\"[^\"]*\"/s.version = \"${VERSION}\"/" "$ONESIGNAL_XCFRAMEWORK_PODSPEC" + echo "✓ Updated OneSignalXCFramework.podspec" +else + echo "Error: OneSignalXCFramework.podspec not found at ${ONESIGNAL_XCFRAMEWORK_PODSPEC}" + exit 1 +fi + +# Update OneSignalCommonDefines.h +if [ -f "$ONESIGNAL_COMMON_DEFINES" ]; then + sed -i '' "s/^#define ONESIGNAL_VERSION[[:space:]]*@\"[^\"]*\"/#define ONESIGNAL_VERSION @\"${VERSION_NUMERIC}\"/" "$ONESIGNAL_COMMON_DEFINES" + echo "✓ Updated ONESIGNAL_VERSION in OneSignalCommonDefines.h to ${VERSION_NUMERIC}" +else + echo "Error: OneSignalCommonDefines.h not found at ${ONESIGNAL_COMMON_DEFINES}" + exit 1 +fi + +echo "Successfully updated version to ${VERSION} (numeric: ${VERSION_NUMERIC}) in all files"