Update pod push script to handle multiple edge cases (#2511)

Summary:
This PR adds a script to publish pods. It handles different edge cases like:
- The version was already pushed but still you are trying to push it, it will skip in that case and give a proper message.
- This also makes sure that the same version Flipper pod exists before pushing FlipperKit.
- It also has the retry mechanism in place if at all the pod trunk push fails to push.

## Changelog

Updated the workflow to push pods

Pull Request resolved: https://github.com/facebook/flipper/pull/2511

Test Plan:
While pushing already published release:
https://github.com/facebook/flipper/actions/runs/974346766

While pushing new release:

https://github.com/facebook/flipper/actions/runs/978707041

Reviewed By: passy

Differential Revision: D29415078

Pulled By: priteshrnandgaonkar

fbshipit-source-id: f0fb68a2e399802e5719d7be4216d4a5ed6ef782
This commit is contained in:
Pritesh Nandgaonkar
2021-06-30 07:20:49 -07:00
committed by Facebook GitHub Bot
parent 10c6a25aad
commit 8ef5a62010
2 changed files with 99 additions and 4 deletions

View File

@@ -21,7 +21,7 @@ jobs:
run: ./scripts/update-pod-versions.sh ./ ./Flipper.podspec
- name: Push Flipper
run: pod trunk push Flipper.podspec --use-libraries --allow-warnings --verbose --skip-import-validation
run: ./scripts/publish-flipper-pods.sh ./ Flipper
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
@@ -41,9 +41,7 @@ jobs:
run: ./scripts/update-pod-versions.sh ./ ./FlipperKit.podspec
- name: Push FlipperKit
run: |
# Retry publishing FlipperKit 20 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..20}; do pod trunk push FlipperKit.podspec --use-libraries --allow-warnings --verbose --skip-import-validation --synchronous && break || sleep 30; done
run: ./scripts/publish-flipper-pods.sh ./ FlipperKit
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}