Skip to content

Commit 331a6ae

Browse files
authored
Merge pull request #713 from Iterable/MOB-7489-ios-sdk-automation-release-add-prerelease-option
[MOB-7489] add prerelease option to iOS SDK automated release
2 parents 0b783b4 + a3c0ae4 commit 331a6ae

File tree

9 files changed

+72
-18
lines changed

9 files changed

+72
-18
lines changed

.github/workflows/ios-sdk-release.yml

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,27 @@ on:
77
version_number:
88
description: "iOS SDK version"
99
required: true
10+
branch:
11+
description: "Branch to release (defaults to master)"
12+
required: true
13+
default: "master"
1014
changelog_section:
1115
description: "Changelog version header (e.g. 6.4.17, 6.5.0-beta)"
16+
required: true
17+
set_prerelease:
18+
type: boolean
19+
description: "Is this a prerelease?"
20+
default: false
21+
env:
22+
VERSION: ${{ github.event.inputs.version_number }}
23+
BRANCH: ${{ github.event.inputs.branch }}
24+
CHANGELOG_SECTION: ${{ github.event.inputs.changelog_section }}
25+
OUTPUT_DIR: ./output_dir
26+
GITHUB_TOKEN: ${{ secrets.SDK_RELEASE_TOKEN }}
27+
RELEASE_BRANCH:
28+
SET_PRERELEASE: ${{ github.event.inputs.set_prerelease }}
29+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
30+
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
1231

1332
jobs:
1433
ios-sdk-release:
@@ -24,7 +43,7 @@ jobs:
2443
run: gem install cocoapods
2544

2645
- name: set version number and push podspecs to git
27-
run: bundle exec fastlane ios bump_release_version version:${{ github.event.inputs.version_number }}
46+
run: bundle exec fastlane ios bump_release_version version:$VERSION
2847

2948
- name: clean cocaopods cache and lint
3049
run: bundle exec fastlane ios clean_and_lint
@@ -33,10 +52,12 @@ jobs:
3352
run: bundle exec fastlane ios build_xcframework output_dir:./output_dir
3453

3554
- name: create github release and upload assets
55+
3656
run: |
37-
bundle exec fastlane ios create_release version:${{ github.event.inputs.version_number }} changelog_section:${{ github.event.inputs.changelog_section }} output_dir:./output_dir github_token:${{ secrets.SDK_RELEASE_TOKEN }}
57+
bundle exec fastlane ios create_release version:$VERSION branch:$BRANCH changelog_section:$CHANGELOG_SECTION output_dir:$OUTPUT_DIR github_token:$GITHUB_TOKEN set_prerelease:$SET_PRERELEASE
3858
3959
- name: push pods to trunk
4060
run: bundle exec fastlane ios pod_trunk_push
41-
env:
42-
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
61+
62+
- name: slack notification
63+
run: bundle exec fastlane ios slack_message version:$VERSION changelog_section:$CHANGELOG_SECTION slack_webhook:$SLACK_WEBHOOK

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,18 @@
33
All notable changes to this project will be documented in this file.
44
This project adheres to [Semantic Versioning](http://semver.org/).
55

6+
## [7.0.1-testing]
7+
8+
### Added
9+
10+
- this is a test
11+
12+
### Changed
13+
14+
- this is a test
15+
16+
## [6.5.0-beta2]
17+
618
## [6.4.17]
719

820
### Changed

fastlane/Fastfile

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,11 @@ platform :ios do
8080
desc "create github release and upload assets"
8181
lane :create_release do |options|
8282
version = options[:version]
83+
branch = options[:branch]
8384
changelog_section = options[:changelog_section]
8485
output_dir = options[:output_dir]
8586
github_token = options[:github_token]
87+
set_prerelease = options[:set_prerelease]
8688

8789
add_git_tag(tag: "#{version}")
8890

@@ -97,8 +99,9 @@ platform :ios do
9799
name: "#{version}",
98100
tag_name: "#{version}",
99101
description: version_changelog,
100-
commitish: "master",
101-
upload_assets: ["./#{output_dir}/IterableSDK.xcframework.zip", "./#{output_dir}/IterableAppExtensions.xcframework.zip"]
102+
commitish: "#{branch}",
103+
upload_assets: ["./#{output_dir}/IterableSDK.xcframework.zip", "./#{output_dir}/IterableAppExtensions.xcframework.zip"],
104+
is_prerelease: set_prerelease
102105
)
103106
end
104107

@@ -107,4 +110,22 @@ platform :ios do
107110
pod_push(path: "Iterable-iOS-AppExtensions.podspec", allow_warnings: true)
108111
pod_push(path: "Iterable-iOS-SDK.podspec", allow_warnings: true)
109112
end
113+
114+
desc "slack message"
115+
lane :slack_message do |options|
116+
version = options[:version]
117+
changelog_section = options[:changelog_section]
118+
slack_webhook = options[:slack_webhook]
119+
120+
read_changelog(
121+
changelog_path: 'CHANGELOG.md',
122+
section_identifier: "[#{changelog_section}]",
123+
)
124+
emojified_changelog = emojify_changelog # Emojify the output of `read_changelog` action
125+
126+
slack(
127+
message: ":appleinc: *iOS SDK #{version}* has been released, which includes the following: #{emojified_changelog}",
128+
slack_url: slack_webhook,
129+
)
130+
end
110131
end

swift-sdk.xcodeproj/project.pbxproj

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1771,7 +1771,7 @@
17711771
isa = PBXProject;
17721772
attributes = {
17731773
LastSwiftUpdateCheck = 1150;
1774-
LastUpgradeCheck = 1200;
1774+
LastUpgradeCheck = 1420;
17751775
ORGANIZATIONNAME = Iterable;
17761776
TargetAttributes = {
17771777
AC2263DE20CF49B8009800EB = {
@@ -2553,7 +2553,7 @@
25532553
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
25542554
GCC_WARN_UNUSED_FUNCTION = YES;
25552555
GCC_WARN_UNUSED_VARIABLE = YES;
2556-
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
2556+
IPHONEOS_DEPLOYMENT_TARGET = 16.2;
25572557
MTL_ENABLE_DEBUG_INFO = YES;
25582558
ONLY_ACTIVE_ARCH = YES;
25592559
PRODUCT_NAME = IterableSDK;
@@ -2614,7 +2614,7 @@
26142614
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
26152615
GCC_WARN_UNUSED_FUNCTION = YES;
26162616
GCC_WARN_UNUSED_VARIABLE = YES;
2617-
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
2617+
IPHONEOS_DEPLOYMENT_TARGET = 16.2;
26182618
MTL_ENABLE_DEBUG_INFO = NO;
26192619
PRODUCT_NAME = IterableSDK;
26202620
SDKROOT = iphoneos;
@@ -2639,7 +2639,7 @@
26392639
DYLIB_INSTALL_NAME_BASE = "@rpath";
26402640
INFOPLIST_FILE = "swift-sdk/Info.plist";
26412641
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
2642-
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
2642+
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
26432643
LD_RUNPATH_SEARCH_PATHS = (
26442644
"$(inherited)",
26452645
"@executable_path/Frameworks",
@@ -2670,7 +2670,7 @@
26702670
ENABLE_TESTABILITY = YES;
26712671
INFOPLIST_FILE = "swift-sdk/Info.plist";
26722672
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
2673-
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
2673+
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
26742674
LD_RUNPATH_SEARCH_PATHS = (
26752675
"$(inherited)",
26762676
"@executable_path/Frameworks",
@@ -2787,7 +2787,7 @@
27872787
ENABLE_TESTABILITY = YES;
27882788
INFOPLIST_FILE = "notification-extension/Info.plist";
27892789
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
2790-
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
2790+
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
27912791
LD_RUNPATH_SEARCH_PATHS = (
27922792
"$(inherited)",
27932793
"@executable_path/Frameworks",
@@ -2819,7 +2819,7 @@
28192819
ENABLE_TESTABILITY = YES;
28202820
INFOPLIST_FILE = "notification-extension/Info.plist";
28212821
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
2822-
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
2822+
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
28232823
LD_RUNPATH_SEARCH_PATHS = (
28242824
"$(inherited)",
28252825
"@executable_path/Frameworks",

swift-sdk.xcodeproj/xcshareddata/xcschemes/endpoint-tests.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1200"
3+
LastUpgradeVersion = "1420"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

swift-sdk.xcodeproj/xcshareddata/xcschemes/inbox-ui-tests-app.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1200"
3+
LastUpgradeVersion = "1420"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

swift-sdk.xcodeproj/xcshareddata/xcschemes/swift-sdk-parallel.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1200"
3+
LastUpgradeVersion = "1420"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

swift-sdk.xcodeproj/xcshareddata/xcschemes/swift-sdk.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1200"
3+
LastUpgradeVersion = "1420"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

swift-sdk.xcodeproj/xcshareddata/xcschemes/ui-tests-app.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1200"
3+
LastUpgradeVersion = "1420"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

0 commit comments

Comments
 (0)