Skip to content

Commit

Permalink
Automating publication of new releases (close #337)
Browse files Browse the repository at this point in the history
  • Loading branch information
oguzhanunlu committed Oct 17, 2019
1 parent b352bf9 commit 535058b
Show file tree
Hide file tree
Showing 8 changed files with 157 additions and 108 deletions.
2 changes: 1 addition & 1 deletion .slather.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
coverage_service: coveralls
xcodeproj: Snowplow.xcodeproj
workspace: Snowplow.xcworkspace
scheme: Snowplow
scheme: Snowplow-iOS
59 changes: 49 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,52 @@
language: objective-c
osx_image: xcode10.2

xcode_workspace: Snowplow.xcworkspace

stages:
- lint
- test
- name: deploy
if: tag IS present

jobs:
include:
- stage: lint
install: gem install cocoapods
script: pod lib lint --allow-warnings

# # FIXME: This test fails due to platform specific deps
# # - <<: *test
# # stage: test
# # xcode_scheme: Snowplow-macOS
# # xcode_destination: platform=macOS
# # before_script:
# # - carthage update --platform macOS
# # - pod install

- &test
stage: test
xcode_scheme: Snowplow-iOS
xcode_destination: platform=iOS Simulator,OS=12.1,name=iPhone X
before_script:
- carthage update --platform iOS
- pod install
after_success:
- gem install slather
- slather

- stage: deploy
script: pod trunk push --verbose --allow-warnings
osx_image: xcode10.2
language: objective-c
xcode_scheme: Snowplow-iOS
xcode_workspace: Snowplow.xcworkspace
on:
condition: $(< VERSION) == $TRAVIS_TAG
tags: true

env:
- TEST_PLATFORM="platform=iOS Simulator,OS=12.1,name=iPhone XR"
rvm:
- 2.3.7
before_install:
- gem install slather
- gem install xcpretty -N --no-document
install:
- ./.travis/install.sh
script: ./.travis/test.sh
after_success: slather
global:
- secure: FfsA8B/GHFnIst46Z9Z2VNzd38NTsRp/DLF3IGDWTZAUFMRqVVu2fC/KmfOMH47XMqhtdvOkAjCf0K9BzDrpEwypAz4h5BoZPR7x+sz5eZ91jSKGAK7R8JWvj2hihoPSCc+ytXQwQFZYzP1hM6Wfyc+37riU7w00eJEz3vexD3w=
- CODE_SIGNING_REQUIRED=NO
- CODE_SIGN_IDENTITY=""
3 changes: 0 additions & 3 deletions .travis/install.sh

This file was deleted.

10 changes: 0 additions & 10 deletions .travis/test.sh

This file was deleted.

70 changes: 13 additions & 57 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
source 'https://github.com/CocoaPods/Specs.git'
target 'Snowplow-iOS' do
inherit! :search_paths
platform :ios, '8.0'
platform :ios, '8.4'
pod 'FMDB', '2.6.2'
pod 'ReachabilitySwift', '4.3.1'
end
Expand All @@ -17,59 +17,15 @@ target 'Snowplow-macOS' do
platform :osx, '10.9'
end

target 'Snowplow-iOSTests' do
inherit! :search_paths
platform :ios, '8.0'
pod 'Nocilla'
pod 'SnowplowIgluClient', :git => 'https://github.com/snowplow/iglu-objc-client.git', :branch => 'feature/carthage'
end

target 'Snowplow-macOSTests' do
platform :osx, '10.9'
pod 'Nocilla'
pod 'SnowplowIgluClient', :git => 'https://github.com/snowplow/iglu-objc-client.git', :branch => 'feature/carthage'
end

post_install do |installer|
handle_sqlite3 installer
installer.pods_project.targets.each do |target|
if ['ReachabilitySwift'].include? target.name
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.2'
end
end
end
end

def handle_sqlite3 installer
# We need to remove sqlite3 from the library
# For details see: https://github.com/CocoaPods/CocoaPods/issues/830
default_library = installer.aggregate_targets.detect { |i| i.target_definition.name == 'Snowplow-iOS' }
[default_library.xcconfig_relative_path('Debug'), default_library.xcconfig_relative_path('Release')].each do |path|
path = File.expand_path(File.join(File.dirname(__FILE__), path))
File.open("config.tmp", "w") do |io|
f = File.read(path)
f.gsub!(/-l"sqlite3"/, '')
io << f
end
FileUtils.mv("config.tmp", path)
end

# We need to add sqlite3 into the test suite
default_library = installer.aggregate_targets.detect { |i| i.target_definition.name == 'Snowplow-iOSTests' }
[default_library.xcconfig_relative_path('Debug'), default_library.xcconfig_relative_path('Release')].each do |path|
path = File.expand_path(File.join(File.dirname(__FILE__), path))
File.open("config.tmp", "w") do |io|
f = File.read(path)
f.gsub!(/(OTHER_LDFLAGS =)/, '\1 -l"sqlite3"')
io << f
end
FileUtils.mv("config.tmp", path)
end

installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO'
end
end
end
# target 'Snowplow-iOSTests' do
# inherit! :search_paths
# platform :ios, '8.0'
# pod 'Nocilla'
# pod 'SnowplowIgluClient', :git => 'https://github.com/snowplow/iglu-objc-client.git', :branch => 'feature/carthage'
# end

# target 'Snowplow-macOSTests' do
# platform :osx, '10.9'
# pod 'Nocilla'
# pod 'SnowplowIgluClient', :git => 'https://github.com/snowplow/iglu-objc-client.git', :branch => 'feature/carthage'
# end
33 changes: 6 additions & 27 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,21 @@ PODS:
- FMDB (2.6.2):
- FMDB/standard (= 2.6.2)
- FMDB/standard (2.6.2)
- Nocilla (0.11.0)
- ReachabilitySwift (4.3.0)
- SnowplowIgluClient (0.1.1):
- VVJSONSchemaValidation (~> 1.5.0)
- VVJSONSchemaValidation (1.5.0)
- ReachabilitySwift (4.3.1)

DEPENDENCIES:
- FMDB (= 2.6.2)
- Nocilla
- ReachabilitySwift
- SnowplowIgluClient (from `https://github.com/snowplow/iglu-objc-client.git`, branch `feature/carthage`)
- ReachabilitySwift (= 4.3.1)

SPEC REPOS:
https://github.com/cocoapods/specs.git:
https://github.com/CocoaPods/Specs.git:
- FMDB
- Nocilla
- ReachabilitySwift
- VVJSONSchemaValidation

EXTERNAL SOURCES:
SnowplowIgluClient:
:branch: feature/carthage
:git: https://github.com/snowplow/iglu-objc-client.git

CHECKOUT OPTIONS:
SnowplowIgluClient:
:commit: 10b9758ef35c21d4bfee9c11d8f4813347a50097
:git: https://github.com/snowplow/iglu-objc-client.git

SPEC CHECKSUMS:
FMDB: 854a0341b4726e53276f2a8996f06f1b80f9259a
Nocilla: 7af7a386071150cc8aa5da4da97d060f049dd61c
ReachabilitySwift: 408477d1b6ed9779dba301953171e017c31241f3
SnowplowIgluClient: 4cda3cca105c844bea49b45e30145dc35cb5208d
VVJSONSchemaValidation: 40411ea98f65d065a7c2ce7483876106bf710e9b
ReachabilitySwift: 4032e2f59586e11e3b0ebe15b167abdd587a388b

PODFILE CHECKSUM: 047bc905c385190179c8d68cd4481474c8e05932
PODFILE CHECKSUM: 5f230c29159932a037894236c170aae4f5768d7d

COCOAPODS: 1.5.3
COCOAPODS: 1.8.3
78 changes: 78 additions & 0 deletions Snowplow.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@
75F9C5F021FA35BC00A5B8FC /* SPWeakTimerTarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 044CA88B1B94791E000EA3B1 /* SPWeakTimerTarget.h */; settings = {ATTRIBUTES = (Private, ); }; };
75F9C5F121FA35BC00A5B8FC /* SPEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 0402EBEB1BA93CA5006C8818 /* SPEvent.h */; settings = {ATTRIBUTES = (Public, ); }; };
75F9C5F221FA35BC00A5B8FC /* SPRequestCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 049B2BDA1B7A203200BD82FC /* SPRequestCallback.h */; settings = {ATTRIBUTES = (Public, ); }; };
CE36CDAD6AF3BC5A4363C424 /* libPods-Snowplow-iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3F181025C6895CE148E3DFEE /* libPods-Snowplow-iOS.a */; };
D69C8D6BF7D5B7242BDD7B8E /* libPods-Snowplow-macOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DA6B41AFB435BC178644FF13 /* libPods-Snowplow-macOS.a */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -256,6 +258,8 @@
0485CA141BAC658500214BC5 /* SPSelfDescribingJson.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SPSelfDescribingJson.h; sourceTree = "<group>"; };
0485CA151BAC65A300214BC5 /* SPSelfDescribingJson.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPSelfDescribingJson.m; sourceTree = "<group>"; };
049B2BDA1B7A203200BD82FC /* SPRequestCallback.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SPRequestCallback.h; sourceTree = "<group>"; };
2310CAFDB439910DB73B2C3B /* Pods-Snowplow-iOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Snowplow-iOS.release.xcconfig"; path = "Target Support Files/Pods-Snowplow-iOS/Pods-Snowplow-iOS.release.xcconfig"; sourceTree = "<group>"; };
3F181025C6895CE148E3DFEE /* libPods-Snowplow-iOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Snowplow-iOS.a"; sourceTree = BUILT_PRODUCTS_DIR; };
750E7F1121F2735C0050A993 /* Nocilla.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Nocilla.framework; path = Carthage/Build/iOS/Nocilla.framework; sourceTree = "<group>"; };
75264A2F224E5DBC000E0E9B /* SPInstallTracker.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SPInstallTracker.h; sourceTree = "<group>"; };
75264A31224E5DD2000E0E9B /* SPInstallTracker.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SPInstallTracker.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -316,6 +320,10 @@
ABB767AF194974D3006275D1 /* SPEventStore.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPEventStore.m; sourceTree = "<group>"; };
ABFCC3741922984A00FAE8FE /* SPUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPUtilities.h; sourceTree = "<group>"; };
ABFCC3751922984A00FAE8FE /* SPUtilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPUtilities.m; sourceTree = "<group>"; };
C41365912C979A8F5F2FC3DB /* Pods-Snowplow-macOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Snowplow-macOS.debug.xcconfig"; path = "Target Support Files/Pods-Snowplow-macOS/Pods-Snowplow-macOS.debug.xcconfig"; sourceTree = "<group>"; };
D86552B4F81DDF04E65E26A1 /* Pods-Snowplow-iOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Snowplow-iOS.debug.xcconfig"; path = "Target Support Files/Pods-Snowplow-iOS/Pods-Snowplow-iOS.debug.xcconfig"; sourceTree = "<group>"; };
DA6B41AFB435BC178644FF13 /* libPods-Snowplow-macOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Snowplow-macOS.a"; sourceTree = BUILT_PRODUCTS_DIR; };
F7B7404247EE4B716112168A /* Pods-Snowplow-macOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Snowplow-macOS.release.xcconfig"; path = "Target Support Files/Pods-Snowplow-macOS/Pods-Snowplow-macOS.release.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -327,6 +335,7 @@
752DAC3F21CC4A7B0065F874 /* CoreTelephony.framework in Frameworks */,
752DAC0D21CC3EEA0065F874 /* FMDB.framework in Frameworks */,
752DAC0F21CC3EED0065F874 /* Reachability.framework in Frameworks */,
CE36CDAD6AF3BC5A4363C424 /* libPods-Snowplow-iOS.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -361,6 +370,7 @@
753DDA6D21F803B10007C3AE /* Cocoa.framework in Frameworks */,
75CAC45721F2A1E400271FB3 /* FMDB.framework in Frameworks */,
75CAC45621F2A1CC00271FB3 /* Foundation.framework in Frameworks */,
D69C8D6BF7D5B7242BDD7B8E /* libPods-Snowplow-macOS.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -386,6 +396,18 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
0936EEEA63738B4E6E398403 /* Pods */ = {
isa = PBXGroup;
children = (
D86552B4F81DDF04E65E26A1 /* Pods-Snowplow-iOS.debug.xcconfig */,
2310CAFDB439910DB73B2C3B /* Pods-Snowplow-iOS.release.xcconfig */,
C41365912C979A8F5F2FC3DB /* Pods-Snowplow-macOS.debug.xcconfig */,
F7B7404247EE4B716112168A /* Pods-Snowplow-macOS.release.xcconfig */,
);
name = Pods;
path = Pods;
sourceTree = "<group>";
};
752DABD821CC38560065F874 /* Snowplow iOSTests */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -444,6 +466,7 @@
AB0C27C2191B408200018557 /* Snowplow */,
AB0C27BF191B408200018557 /* Frameworks */,
AB0C27BE191B408200018557 /* Products */,
0936EEEA63738B4E6E398403 /* Pods */,
);
sourceTree = "<group>";
};
Expand Down Expand Up @@ -475,6 +498,8 @@
AB9E8213192DEC38006744C9 /* CoreTelephony.framework */,
ABB67D8C192D9552009A1ECE /* UIKit.framework */,
AB0C27C0191B408200018557 /* Foundation.framework */,
3F181025C6895CE148E3DFEE /* libPods-Snowplow-iOS.a */,
DA6B41AFB435BC178644FF13 /* libPods-Snowplow-macOS.a */,
);
name = Frameworks;
sourceTree = "<group>";
Expand Down Expand Up @@ -637,6 +662,7 @@
isa = PBXNativeTarget;
buildConfigurationList = 752DABDD21CC38560065F874 /* Build configuration list for PBXNativeTarget "Snowplow-iOS" */;
buildPhases = (
099C714988EDECFAAA6B4C7E /* [CP] Check Pods Manifest.lock */,
752DABC721CC38550065F874 /* Headers */,
752DABC821CC38550065F874 /* Sources */,
752DABC921CC38550065F874 /* Frameworks */,
Expand Down Expand Up @@ -692,6 +718,7 @@
isa = PBXNativeTarget;
buildConfigurationList = 752DAC0621CC3B380065F874 /* Build configuration list for PBXNativeTarget "Snowplow-macOS" */;
buildPhases = (
C0FB3D44875422D6495E7E0C /* [CP] Check Pods Manifest.lock */,
752DABF021CC3B380065F874 /* Headers */,
752DABF121CC3B380065F874 /* Sources */,
752DABF221CC3B380065F874 /* Frameworks */,
Expand Down Expand Up @@ -826,6 +853,53 @@
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
099C714988EDECFAAA6B4C7E /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-Snowplow-iOS-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
C0FB3D44875422D6495E7E0C /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-Snowplow-macOS-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
752DABC821CC38550065F874 /* Sources */ = {
isa = PBXSourcesBuildPhase;
Expand Down Expand Up @@ -976,6 +1050,7 @@
/* Begin XCBuildConfiguration section */
752DABDE21CC38560065F874 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = D86552B4F81DDF04E65E26A1 /* Pods-Snowplow-iOS.debug.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;
CLANG_ANALYZER_NONNULL = YES;
Expand Down Expand Up @@ -1030,6 +1105,7 @@
};
752DABDF21CC38560065F874 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 2310CAFDB439910DB73B2C3B /* Pods-Snowplow-iOS.release.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;
CLANG_ANALYZER_NONNULL = YES;
Expand Down Expand Up @@ -1269,6 +1345,7 @@
};
752DAC0721CC3B380065F874 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = C41365912C979A8F5F2FC3DB /* Pods-Snowplow-macOS.debug.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;
CLANG_ANALYZER_NONNULL = YES;
Expand Down Expand Up @@ -1323,6 +1400,7 @@
};
752DAC0821CC3B380065F874 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = F7B7404247EE4B716112168A /* Pods-Snowplow-macOS.release.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;
CLANG_ANALYZER_NONNULL = YES;
Expand Down
Loading

0 comments on commit 535058b

Please sign in to comment.