Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Publish to CocoaPods #4

Publish to CocoaPods

Publish to CocoaPods #4

Workflow file for this run

name: Publish to CocoaPods
on:
push:
branches: [ main ]
paths:
- 'Roboflow.podspec'
workflow_dispatch:
inputs:
force_tag:
description: 'Allow republish of existing tag (use with caution)'
type: boolean
required: false
default: false
jobs:
publish:
runs-on: macos-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all tags
- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@v1.6.0
with:
xcode-version: 'latest-stable'
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
bundler-cache: false
- name: Install CocoaPods
run: |
gem install cocoapods
pod --version
- name: Extract version from podspec
id: get_version
run: |
VERSION=$(pod ipc spec Roboflow.podspec | jq -r '.version')
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
echo "Detected version: $VERSION"
- name: Validate podspec
run: |
echo "Setting up iOS simulator..."
xcrun simctl list devices
echo ""
echo "Linting pod..."
pod lib lint --allow-warnings
- name: Create and push tag
run: |
echo "Creating tag for version ${{ steps.get_version.outputs.VERSION }}..."
git config user.name github-actions
git config user.email github-actions@github.com
# Check if tag already exists remotely
if git ls-remote --tags origin | grep -q "refs/tags/${{ steps.get_version.outputs.VERSION }}$"; then
if [[ "${{ github.event.inputs.force_tag }}" == "true" ]]; then
echo "Tag ${{ steps.get_version.outputs.VERSION }} already exists. Force push enabled, overwriting..."
git tag -f "${{ steps.get_version.outputs.VERSION }}"
git push origin "${{ steps.get_version.outputs.VERSION }}" --force
echo "Force pushed tag: ${{ steps.get_version.outputs.VERSION }}"
else
echo "Error: Tag ${{ steps.get_version.outputs.VERSION }} already exists and force push is not enabled."
echo "To overwrite, run the workflow manually with 'Allow republish of existing tag' option checked."
exit 1
fi
else
git tag "${{ steps.get_version.outputs.VERSION }}"
git push origin "${{ steps.get_version.outputs.VERSION }}"
echo "Created and pushed new tag: ${{ steps.get_version.outputs.VERSION }}"
fi
- name: Publish to CocoaPods
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
run: |
echo "DRY RUN Publishing version ${{ steps.get_version.outputs.VERSION }} to CocoaPods..."
echo "pod trunk push"
echo "Successfully published to CocoaPods!"
Morty Proxy This is a proxified and sanitized view of the page, visit original site.