File tree Expand file tree Collapse file tree 2 files changed +21
-4
lines changed Expand file tree Collapse file tree 2 files changed +21
-4
lines changed Original file line number Diff line number Diff line change 8383 xcode-version : 14.1.0
8484 - name : Push to cocoapods.org
8585 env :
86- GITHUB_TOKEN : ${{ secrets.CI_USER_TOKEN }}
86+ HOME : ' home/runner'
87+ REPO_SLUG : ${{ github.repository }}
8788 BRANCH : ${{ github.ref_name }}
89+ GITHUB_TOKEN : ${{ secrets.CI_USER_TOKEN }}
8890 COCOAPODS_TRUNK_TOKEN : ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
8991 COCOAPODS_VERSION : ' 1.11.3'
9092 run : |
Original file line number Diff line number Diff line change 77
88# COCOAPODS_TRUNK_TOKEN - should be defined in job settings so that we can `pod trunk push`
99
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+
1019function release_github {
11- LAST_RELEASE=$( git describe --abbrev=0 --tags --always)
20+ LAST_RELEASE=$( git describe --abbrev=0 --tags)
21+
1222 if [[ ${LAST_RELEASE} == " v${VERSION} " ]]; then
1323 echo " ${LAST_RELEASE} tag exists already (probably created while in the current release process). Skipping..."
1424 return
@@ -32,6 +42,10 @@ function release_github {
3242}
3343
3444function release_cocoapods {
45+
46+ # - cocoapods requires ENV['HOME'] with absolute path
47+ HOME=$( pwd)
48+ gem install cocoapods -v $COCOAPODS_VERSION
3549
3650 # ---- Optimizely's pods ----
3751 pods=(OptimizelySwiftSDK);
@@ -44,13 +58,14 @@ function release_cocoapods {
4458 do
4559 podname=${pods[i]} ;
4660 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
4963 done
5064
5165}
5266
5367function main {
68+ prep_workspace
5469 release_github
5570 release_cocoapods
5671}
You can’t perform that action at this time.
0 commit comments