Skip to content

Deploy to Cocoapods

Deploy to Cocoapods #6

Workflow file for this run

name: Deploy to Cocoapods
on:
push:
branches:
- prod
workflow_run:
workflows: ["Run Tests"]
types:
- completed
workflow_dispatch:
jobs:
deploy:
if: ${{ github.event.workflow_run.conclusion == 'success' }} # Only deploy if tests were successful
name: Deploy KhipuClientIOS to Cocoapods # https://cocoapods.org/pods/KhipuClientIOS
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Cocoapods
run: pod install --project-directory=Example
- name: Create and Push Tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -eo pipefail
VERSION=$(grep -oE "s.version.*= *'[^']*'" KhipuClientIOS.podspec | grep -oE "'[^']*'" | tr -d "'")
echo "Detected version: $VERSION"
git tag $VERSION
git push origin $VERSION
- name: Deploy to Cocoapods
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
run: |
set -eo pipefail
pod lib lint --allow-warnings
pod trunk push --allow-warnings