From 3daa6084d9aee1981683317d6a2b682e32b9c2d3 Mon Sep 17 00:00:00 2001 From: reeshika-h Date: Wed, 4 Feb 2026 14:40:59 +0530 Subject: [PATCH 1/3] Update podspec version to 2.3.3-beta.1, add CocoaPods publish workflow, --- .github/workflows/publish-cocoapods.yml | 69 +++++++++++++++++++++++++ ContentstackSwift.podspec | 4 +- 2 files changed, 71 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/publish-cocoapods.yml diff --git a/.github/workflows/publish-cocoapods.yml b/.github/workflows/publish-cocoapods.yml new file mode 100644 index 0000000..22257d2 --- /dev/null +++ b/.github/workflows/publish-cocoapods.yml @@ -0,0 +1,69 @@ +name: Publish to CocoaPods + +# NOTE: CocoaPods Trunk is planned to become read-only by end of 2025. +# This automation will work only until then. SPM is the primary distribution channel. +# This workflow serves as a short-term sync for legacy CocoaPods users. + +on: + push: + tags: + - 'v*' # Triggers when you push a version tag (e.g. v2.0.1, v2.4.0-beta.1) + branches: + - fix/DX-2918-cocoapods-fix # Trigger on branch push to test workflow (lint only; no publish) + release: + types: [published] # Also triggers when a GitHub Release is published + +jobs: + publish: + name: Publish Podspec to CocoaPods + runs-on: macos-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 # Fetch all history for tags + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.0' + bundler-cache: false # We're installing CocoaPods directly + + - name: Install CocoaPods + run: gem install cocoapods + + - name: Extract version from tag or podspec + id: get_version + run: | + if [ "${{ github.event_name }}" == "release" ]; then + VERSION="${{ github.event.release.tag_name }}" + VERSION=${VERSION#v} + elif [[ "${{ github.ref }}" == refs/tags/* ]]; then + VERSION="${GITHUB_REF#refs/tags/}" + VERSION=${VERSION#v} + else + # Branch push: use version from podspec (for testing workflow) + VERSION=$(grep -E "s\.version\s*=" ContentstackSwift.podspec | sed -E "s/.*['\"]([^'\"]+)['\"].*/\1/") + fi + echo "version=$VERSION" >> $GITHUB_OUTPUT + echo "Extracted version: $VERSION" + + - name: Verify podspec version matches tag + run: | + PODSPEC_VERSION=$(grep -E "s\.version\s*=" ContentstackSwift.podspec | sed -E "s/.*['\"]([^'\"]+)['\"].*/\1/") + TAG_VERSION="${{ steps.get_version.outputs.version }}" + if [ "$PODSPEC_VERSION" != "$TAG_VERSION" ]; then + echo "Error: Podspec version ($PODSPEC_VERSION) does not match tag version ($TAG_VERSION)" + exit 1 + fi + echo "✓ Podspec version matches tag: $PODSPEC_VERSION" + + - name: Lint Podspec + run: pod lib lint ContentstackSwift.podspec --allow-warnings + + - name: Publish to CocoaPods + if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'release' + run: pod trunk push ContentstackSwift.podspec --allow-warnings + env: + COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} + diff --git a/ContentstackSwift.podspec b/ContentstackSwift.podspec index f91ff17..5ed20cc 100644 --- a/ContentstackSwift.podspec +++ b/ContentstackSwift.podspec @@ -10,7 +10,7 @@ Pod::Spec.new do |s| s.name = 'ContentstackSwift' - s.version = '2.0.1' + s.version = '2.3.3-beta.1' s.summary = 'Contentstack is a headless CMS with an API-first approach that puts content at the centre.' s.description = <<-DESC @@ -28,7 +28,7 @@ Pod::Spec.new do |s| 'uttamukkoji' => 'uttamukkoji@gmail.com', 'Contentstack' => 'support@contentstack.io' } - s.source = { :git => 'https://github.com/contentstack/contentstack-swift.git', :tag => s.version } + s.source = { :git => 'https://github.com/contentstack/contentstack-swift.git', :tag => "v#{s.version}" } s.social_media_url = 'https://x.com/Contentstack' s.swift_version = '5.6' From f028327786ba8e3c845a00af61c6f5d8df7c0b2d Mon Sep 17 00:00:00 2001 From: reeshika-h Date: Wed, 4 Feb 2026 14:53:28 +0530 Subject: [PATCH 2/3] Release 2.3.2 for CocoaPods sync --- ContentstackSwift.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ContentstackSwift.podspec b/ContentstackSwift.podspec index 5ed20cc..66931c8 100644 --- a/ContentstackSwift.podspec +++ b/ContentstackSwift.podspec @@ -10,7 +10,7 @@ Pod::Spec.new do |s| s.name = 'ContentstackSwift' - s.version = '2.3.3-beta.1' + s.version = '2.3.2' s.summary = 'Contentstack is a headless CMS with an API-first approach that puts content at the centre.' s.description = <<-DESC From 4a433bc8095fc9d67da32e51a6f85c81c5411b49 Mon Sep 17 00:00:00 2001 From: reeshika-h Date: Wed, 4 Feb 2026 15:05:55 +0530 Subject: [PATCH 3/3] Remove branch trigger from CocoaPods publish workflow to streamline version tag deployments. --- .github/workflows/publish-cocoapods.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/publish-cocoapods.yml b/.github/workflows/publish-cocoapods.yml index 22257d2..8d0384d 100644 --- a/.github/workflows/publish-cocoapods.yml +++ b/.github/workflows/publish-cocoapods.yml @@ -8,8 +8,6 @@ on: push: tags: - 'v*' # Triggers when you push a version tag (e.g. v2.0.1, v2.4.0-beta.1) - branches: - - fix/DX-2918-cocoapods-fix # Trigger on branch push to test workflow (lint only; no publish) release: types: [published] # Also triggers when a GitHub Release is published