Skip to content

Commit

Permalink
Adding c-core release automation workflow (#163) (#165)
Browse files Browse the repository at this point in the history
  • Loading branch information
dennycd committed Oct 19, 2022
1 parent 2831fdf commit 9a2e905
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 3 deletions.
39 changes: 38 additions & 1 deletion .github/workflows/prod_release_cocoapod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,43 @@ concurrency:
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
jobs:
release-cocoapod-gRPC-Core:
runs-on: macos-latest
steps:
- name: Repo checkout
uses: actions/checkout@v3
with:
ref: ${{ github.ref }}

- name: Prepare environment
run: scripts/prepare_env.sh

- name: Pod release
run: scripts/release_cocoapod.sh native/gRPC-Core.podspec

- name: Wait for pod avaialble
run: |
version=$(cat VERSION)
timeout 1h scripts/wait_for_pod_release.sh gRPC-Core $version
release-cocoapod-gRPC-Cpp:
runs-on: macos-latest
needs: [release-cocoapod-gRPC-Core]
steps:
- name: Repo checkout
uses: actions/checkout@v3
with:
ref: ${{ github.ref }}

- name: Prepare environment
run: scripts/prepare_env.sh

- name: Pod release
run: scripts/release_cocoapod.sh native/gRPC-C++.podspec

- name: Wait for pod avaialble
run: |
version=$(cat VERSION)
timeout 1h scripts/wait_for_pod_release.sh gRPC-C++ $version
release-cocoapod-gRPC-RxLibrary:
runs-on: macos-latest
steps:
Expand All @@ -29,7 +66,7 @@ jobs:
release-cocoapod-gRPC:
runs-on: macos-latest
needs: release-cocoapod-gRPC-RxLibrary
needs: [release-cocoapod-gRPC-RxLibrary, release-cocoapod-gRPC-Core]
steps:
- name: Repo checkout
uses: actions/checkout@v3
Expand Down
7 changes: 5 additions & 2 deletions scripts/release_cocoapod.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ set -ex
# Usage: ./release_cocoapod.sh [PODSPEC_FILE]

TARGET_PODSPEC=$1
TARGET_DIR=$(dirname $TARGET_PODSPEC)
TARGET_FILE=$(basename $TARGET_PODSPEC)

if [ -z "$TARGET_PODSPEC" ]; then
echo "ERROR: please specify podspec"
Expand All @@ -16,11 +18,12 @@ fi

echo "Publishing podspec $TARGET_PODSPEC"

time pod trunk push $TARGET_PODSPEC \
pushd ${TARGET_DIR}
time pod trunk push $TARGET_FILE \
--allow-warnings \
--use-libraries \
--skip-tests \
--skip-import-validation \
--synchronous \
--verbose

popd

0 comments on commit 9a2e905

Please sign in to comment.