Skip to content
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

add set version script #407

Merged
merged 7 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Build, Analyze, & Test
env:
scheme: RadarSDK
Expand Down
13 changes: 11 additions & 2 deletions .github/workflows/release-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,22 @@ jobs:
event-type: update-xcframework
client-payload: '{"release": "${{ github.event.release.tag_name }}", "checksum": "${{ steps.checksum_radarsdk.outputs.checksum }}", "url": "${{ github.event.release.html_url }}", "checksum_motion": "${{ steps.checksum_radarsdkmotion.outputs.checksum }}"}'

- name: Check versions is not duplicate
run: |
VERSION=$(pod ipc spec RadarSDK.podspec | jq -r .version)
! pod trunk info RadarSDK | grep -q $VERSION
echo "RadarSDK version is OK"
VERSION=$(pod ipc spec RadarSDKMotion.podspec | jq -r .version)
! pod trunk info RadarSDKMotion | grep -q $VERSION
echo "RadarSDKMotion version is OK"

- name: Deploy to Cocoapods
run: |
set -eo pipefail
gem install cocoapods
pod lib lint --allow-warnings RadarSDK.podspec
pod trunk push --allow-warnings RadarSDK.podspec
pod lib lint --allow-warnings RadarSDKMotion.podspec
pod trunk push --allow-warnings RadarSDK.podspec
pod trunk push --allow-warnings RadarSDKMotion.podspec
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we definitely want to lint both before publishing any of the two.

env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
2 changes: 0 additions & 2 deletions RadarSDK.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,6 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 3.9.6;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the package settings, which overwrites the project settings, we should just have the version set for project settings which will be resolved everywhere to the single correct marketing version

PRODUCT_BUNDLE_IDENTIFIER = io.radar.sdk;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -983,7 +982,6 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 3.9.6;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

PRODUCT_BUNDLE_IDENTIFIER = io.radar.sdk;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
29 changes: 14 additions & 15 deletions RadarSDKMotion.podspec
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
Pod::Spec.new do |s|
s.name = 'RadarSDKMotion'
s.version = '3.19.1'
s.summary = 'Motion detection plugin for RadarSDK, the leading geofencing and location tracking platform'
s.homepage = 'https://radar.com'
s.author = { 'Radar Labs, Inc.' => 'support@radar.com' }
s.platform = :ios
s.source = { :git => 'https://github.com/radarlabs/radar-sdk-ios.git', :tag => s.version.to_s }
s.source_files = ["RadarSDKMotion/RadarSDKMotion/*.{h,m}", "RadarSDKMotion/RadarSDKMotion/Include/*.h"]
s.module_name = 'RadarSDKMotion'
s.ios.deployment_target = '12.0'
s.frameworks = 'CoreMotion'
s.requires_arc = true
s.license = { :type => 'Apache-2.0' }
end

s.name = 'RadarSDKMotion'
s.version = '3.19.1'
s.summary = 'Motion detection plugin for RadarSDK, the leading geofencing and location tracking platform'
s.homepage = 'https://radar.com'
s.author = { 'Radar Labs, Inc.' => 'support@radar.com' }
s.platform = :ios
s.source = { :git => 'https://github.com/radarlabs/radar-sdk-ios.git', :tag => s.version.to_s }
s.source_files = ["RadarSDKMotion/RadarSDKMotion/*.{h,m}", "RadarSDKMotion/RadarSDKMotion/Include/*.h"]
s.module_name = 'RadarSDKMotion'
s.ios.deployment_target = '12.0'
s.frameworks = 'CoreMotion'
s.requires_arc = true
s.license = { :type => 'Apache-2.0' }
end
6 changes: 2 additions & 4 deletions RadarSDKMotion/RadarSDKMotion.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MARKETING_VERSION = 3.18.4;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -347,6 +348,7 @@
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MARKETING_VERSION = 3.18.4;
Copy link
Contributor Author

@ShiCheng-Lu ShiCheng-Lu Nov 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding the marketing version to motion sdks to be the same as main sdk. (project setting)

MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -376,7 +378,6 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.0;
MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++20";
PRODUCT_BUNDLE_IDENTIFIER = RadarLabs.RadarSDKMotion;
Expand Down Expand Up @@ -407,7 +408,6 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.0;
MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++20";
PRODUCT_BUNDLE_IDENTIFIER = RadarLabs.RadarSDKMotion;
Expand All @@ -425,7 +425,6 @@
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 96GHH65B9D;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = RadarLabs.RadarMotionTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = NO;
Expand All @@ -440,7 +439,6 @@
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 96GHH65B9D;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = RadarLabs.RadarMotionTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = NO;
Expand Down
24 changes: 24 additions & 0 deletions set_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/sh

if [ $# -lt 1 ]; then
echo "Usage: $0 <version_string>"
exit 1
fi

# sed has slightly different syntax on linux vs mac
if [ $(uname -s) = "Darwin" ]; then
alias sed_inplace="sed -E -i ''"
else
alias sed_inplace="sed -E -i"
fi

version_full=$1
version="${version_full%%-*}"

sed_inplace "s/s.version( +)= '(.+)'/s.version\1= '$version_full'/" RadarSDK.podspec
sed_inplace "s/s.version( +)= '(.+)'/s.version\1= '$version_full'/" RadarSDKMotion.podspec

sed_inplace "s/MARKETING_VERSION = .+;/MARKETING_VERSION = $version;/" RadarSDK.xcodeproj/project.pbxproj
sed_inplace "s/MARKETING_VERSION = .+;/MARKETING_VERSION = $version;/" RadarSDKMotion/RadarSDKMotion.xcodeproj/project.pbxproj

sed_inplace "s/return @\"[0-9]+\.[0-9]+\.[0-9]+\";/return @\"$version_full\";/" RadarSDK/RadarUtils.m
Loading