From bc5a69a057d379589002d3b096963314bb61b165 Mon Sep 17 00:00:00 2001 From: Dave Snabel-Caunt Date: Mon, 13 May 2024 17:09:11 +0100 Subject: [PATCH] Update iOS versioning for Cocoapods changes --- .github/workflows/shared-publish-to-ios-version.yaml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/shared-publish-to-ios-version.yaml b/.github/workflows/shared-publish-to-ios-version.yaml index 3579c558..a84ed94a 100644 --- a/.github/workflows/shared-publish-to-ios-version.yaml +++ b/.github/workflows/shared-publish-to-ios-version.yaml @@ -58,9 +58,11 @@ jobs: - name: Update UID2.Client.ios run: | - current_version=$(grep -o '.*' ${{ inputs.working_dir }}/Sources/UID2/Properties/sdk_properties.plist | head -1 | sed 's/\(.*\)<\/string>/\1/') + formatted_current_version=$(grep -o '\d*,\s*\d*,\s*\d*' ${{ inputs.working_dir }}/Sources/UID2/Properties/UID2SDKProperties.swift | head -1) new_version=${{ steps.version.outputs.new_version }} - sed -i '' -e "s/$current_version/$new_version/g" ${{ inputs.working_dir }}/Sources/UID2/Properties/sdk_properties.plist + formatted_new_version=$(echo "$new_version" | sed 's/\([[:digit:]]\)\.\([[:digit:]]\)\.\([[:digit:]]\)/\1, \2, \3/') + sed -i '' -e "s/$formatted_current_version/$formatted_new_version/g" ${{ inputs.working_dir }}/Sources/UID2/Properties/UID2SDKProperties.swift + current_version=$(echo "$formatted_current_version" | sed 's/\(.*\),[[:space:]]*\(.*\),[[:space:]]*\(.*\)/\1.\2.\3/') echo "Version number updated from $current_version to $new_version" - name: Select Xcode 15.3 @@ -72,10 +74,10 @@ jobs: xcodebuild -scheme UID2 -sdk iphonesimulator17.4 -destination "OS=17.4,name=iPhone 15" xcodebuild test -scheme UID2 -sdk iphonesimulator17.4 -destination "OS=17.4,name=iPhone 15" - - name: Commit sdk_properties, version.json and set tag + - name: Commit SDK properties, version.json and set tag uses: IABTechLab/uid2-shared-actions/actions/commit_pr_and_merge@v2 with: - add: '${{ inputs.working_dir }}/Sources/UID2/Properties/sdk_properties.plist ${{ inputs.working_dir }}/version.json' + add: '${{ inputs.working_dir }}/Sources/UID2/Properties/UID2SDKProperties.swift ${{ inputs.working_dir }}/version.json' message: 'Released ${{ inputs.release_type }} version: ${{ steps.version.outputs.new_version }}' tag: v${{ steps.version.outputs.new_version }}