Skip to content

Commit e527156

Browse files
committed
Update travis
1 parent 97a8a11 commit e527156

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

.travis.yml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Build only if commit is tagged or PR is opened/updated
2-
if: (tag IS present) OR (type = pull_request)
2+
if: ((tag IS present) OR (type = pull_request)) AND \
3+
((commit_message != "update spm") AND (sender != env(GITHUB_NAME)))
34

45
language: objective-c
56
osx_image: xcode13.1
@@ -11,11 +12,6 @@ xcode_destination: platform=iOS Simulator,OS=15.0,name=iPhone 12
1112
cache: cocoapods
1213
podfile: Podfile
1314
before_install:
14-
- >
15-
if ! [ -z "$TRAVIS_TAG" ] && grep -q "/$TRAVIS_TAG/" Package.swift; then
16-
echo "Duplicate build from SPM update"
17-
exit 1
18-
fi
1915
- gem install cocoapods # Since Travis is not always on latest version
2016
- pod install
2117

@@ -53,12 +49,6 @@ deploy:
5349
tags: true
5450
- provider: script
5551
skip_cleanup: true
56-
script:
57-
>-
58-
git config --local user.email "[email protected]";git config --local user.name "leanplum-e2";
59-
git remote set-url origin https://leanplum-e2:[email protected]/Leanplum/Leanplum-iOS-SDK.git;
60-
export RELEASE_VERSION=${TRAVIS_TAG%-*};git checkout -b release/$RELEASE_VERSION;
61-
git restore --staged .; git add Package.swift; git commit -m 'update spm';
62-
git tag -f `cat sdk-version.txt`; git push -f origin `cat sdk-version.txt`;
52+
script: ./Tools/pushSPM.sh
6353
on:
6454
tags: true

Tools/pushSPM.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
git config --local user.email "$GITHUB_EMAIL"
3+
git config --local user.name "$GITHUB_NAME"
4+
git remote set-url origin https://$GITHUB_NAME:$GITHUB_TOKEN@github.com/Leanplum/Leanplum-iOS-SDK.git
5+
RELEASE_VERSION=${TRAVIS_TAG%-*}
6+
echo $RELEASE_VERSION
7+
git checkout -b release/$RELEASE_VERSION
8+
git restore --staged .
9+
git add Package.swift
10+
git commit -m 'update spm'
11+
git push --set-upstream origin release/$RELEASE_VERSION
12+
git tag -f `cat sdk-version.txt`
13+
git push -f origin `cat sdk-version.txt`

0 commit comments

Comments
 (0)