Publish pods gh (#1083)

Summary:
This PR adds a github action to publish pods on a new tag. It also tries to fix a race condition which happens when we try to publish FlipperKit pod. During the release of FlipperKit pod, we rely on the newly published Flipper Pod, and sometimes the release of Flipper Pod takes a time to get updated in the cocoapods trunk.

This is a known issue by the Cocoapods and they will be shipping a fix to this in Cocoapods 1.10. Till then we can keep retrying for 5 times.

Ref: https://github.com/CocoaPods/CocoaPods/issues/9502#issuecomment-579486258

## Changelog

- Adds Github actions to publish cocoapods.
- Removes the Circle CI config to publish on cocoapods
Pull Request resolved: https://github.com/facebook/flipper/pull/1083

Test Plan: I tested this action by running it on this PR and it worked fine.

Reviewed By: jknoxville

Differential Revision: D21348084

Pulled By: priteshrnandgaonkar

fbshipit-source-id: f33f3cdef43ae032ad42c94db72323212e40ec67
This commit is contained in:
Pritesh Nandgaonkar
2020-05-01 09:04:49 -07:00
committed by Facebook GitHub Bot
parent c5cd182ac6
commit 6f9d82117e
2 changed files with 41 additions and 25 deletions

View File

@@ -28,25 +28,6 @@ jobs:
command: |
yes | sdkmanager "platforms;android-27" || true
./gradlew :android:assembleRelease && scripts/publish-android-release.sh
publish-pods:
macos:
xcode: "10.2.1"
steps:
- checkout
- run: curl https://cocoapods-specs.circleci.com/fetch-cocoapods-repo-from-s3.sh | bash -s cf
- run:
name: "Pod version"
command: |
pod --version
- run:
name: "Push Flipper Pod"
command: |
pod trunk push ./Flipper.podspec --use-libraries --allow-warnings --verbose --skip-import-validation
- run:
name: "Push FlipperKit Pod"
command: |
pod trunk push ./FlipperKit.podspec --use-libraries --allow-warnings --verbose --skip-import-validation --swift-version=4.2
workflows:
version: 2
build-and-deploy:
@@ -61,9 +42,3 @@ workflows:
only: /^v.*/
branches:
ignore: /.*/
- publish-pods:
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/

41
.github/workflows/publish-pods.yml vendored Normal file
View File

@@ -0,0 +1,41 @@
name: Publish Pods
on:
push:
tags:
- v*
jobs:
publish_flipper_pod:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Install Dependences
run: pod repo update
- name: Pod Version
run: pod --version
- name: Push Flipper
run: pod trunk push Flipper.podspec --use-libraries --allow-warnings --verbose --skip-import-validation
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
publish_flipperkit_pod:
needs: publish_flipper_pod
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Install Dependences
run: pod repo update
- name: Pod Version
run: pod --version
- name: Push FlipperKit
run: |
# Retry publishing FlipperKit 5 times. Putting this hack unless we have cocoapods 1.10. More information related to the bug https://github.com/CocoaPods/CocoaPods/issues/9502#issuecomment-579486258
for i in {1..5}; do pod trunk push FlipperKit.podspec --use-libraries --allow-warnings --verbose --skip-import-validation && break || sleep 20; done
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}