File tree 2 files changed +21
-4
lines changed
2 files changed +21
-4
lines changed Original file line number Diff line number Diff line change 83
83
xcode-version : 14.1.0
84
84
- name : Push to cocoapods.org
85
85
env :
86
- GITHUB_TOKEN : ${{ secrets.CI_USER_TOKEN }}
86
+ HOME : ' home/runner'
87
+ REPO_SLUG : ${{ github.repository }}
87
88
BRANCH : ${{ github.ref_name }}
89
+ GITHUB_TOKEN : ${{ secrets.CI_USER_TOKEN }}
88
90
COCOAPODS_TRUNK_TOKEN : ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
89
91
COCOAPODS_VERSION : ' 1.11.3'
90
92
run : |
Original file line number Diff line number Diff line change 7
7
8
8
# COCOAPODS_TRUNK_TOKEN - should be defined in job settings so that we can `pod trunk push`
9
9
10
+ MYREPO=${HOME} /workdir/${REPO_SLUG}
11
+
12
+ function prep_workspace {
13
+ rm -rf ${MYREPO}
14
+ mkdir -p ${MYREPO}
15
+ git clone -b ${BRANCH} https://${GITHUB_TOKEN} @github.com/${REPO_SLUG} ${MYREPO}
16
+ cd ${MYREPO}
17
+ }
18
+
10
19
function release_github {
11
- LAST_RELEASE=$( git describe --abbrev=0 --tags --always)
20
+ LAST_RELEASE=$( git describe --abbrev=0 --tags)
21
+
12
22
if [[ ${LAST_RELEASE} == " v${VERSION} " ]]; then
13
23
echo " ${LAST_RELEASE} tag exists already (probably created while in the current release process). Skipping..."
14
24
return
@@ -32,6 +42,10 @@ function release_github {
32
42
}
33
43
34
44
function release_cocoapods {
45
+
46
+ # - cocoapods requires ENV['HOME'] with absolute path
47
+ HOME=$( pwd)
48
+ gem install cocoapods -v $COCOAPODS_VERSION
35
49
36
50
# ---- Optimizely's pods ----
37
51
pods=(OptimizelySwiftSDK);
@@ -44,13 +58,14 @@ function release_cocoapods {
44
58
do
45
59
podname=${pods[i]} ;
46
60
printf " Pushing the ${podname} pod to COCOAPODS.ORG .\n"
47
- pod trunk push --allow-warnings ${podname} .podspec
48
- pod update
61
+ pod _ ${COCOAPODS_VERSION} _ trunk push --allow-warnings ${podname} .podspec
62
+ pod _ ${COCOAPODS_VERSION} _ update
49
63
done
50
64
51
65
}
52
66
53
67
function main {
68
+ prep_workspace
54
69
release_github
55
70
release_cocoapods
56
71
}
You can’t perform that action at this time.
0 commit comments