From e66404843595706b4c384fa46177cfd32458ef99 Mon Sep 17 00:00:00 2001 From: Nickolas Dimitrakas Date: Wed, 8 Apr 2026 10:48:25 -0400 Subject: [PATCH 1/3] ci: add publish-cocoapods job to release-publish workflow Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/release-publish.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/release-publish.yml b/.github/workflows/release-publish.yml index 7c90a8c10..8c8543171 100644 --- a/.github/workflows/release-publish.yml +++ b/.github/workflows/release-publish.yml @@ -305,3 +305,20 @@ jobs: ### Release notes ${{ steps.release-notes.outputs.release_notes }} EOF + + # ────────────────────────────────────────────── + # CocoaPods: publish core SDK to trunk + # ────────────────────────────────────────────── + publish-cocoapods: + name: Publish to CocoaPods + needs: release-core-sdk + runs-on: macos-15 + if: ${{ !inputs.dry_run }} + steps: + - name: Checkout code + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Publish to CocoaPods + env: + COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} + run: pod trunk push mParticle-Apple-SDK.podspec --allow-warnings From 8bbbe4515481f3f7f1642c3b94ff07bcb1fc2861 Mon Sep 17 00:00:00 2001 From: Nickolas Dimitrakas Date: Wed, 8 Apr 2026 10:50:42 -0400 Subject: [PATCH 2/3] ci: publish each kit to CocoaPods in release-publish workflow Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/release-publish.yml | 21 +++++++++---- RELEASE.md | 43 ++++++++++++++++----------- Scripts/pod_publish.sh | 39 ------------------------ 3 files changed, 41 insertions(+), 62 deletions(-) delete mode 100755 Scripts/pod_publish.sh diff --git a/.github/workflows/release-publish.yml b/.github/workflows/release-publish.yml index 8c8543171..4d817ae0e 100644 --- a/.github/workflows/release-publish.yml +++ b/.github/workflows/release-publish.yml @@ -89,6 +89,12 @@ jobs: body: | ${{ steps.release-notes.outputs.release_notes }} + - name: Publish to CocoaPods + if: env.DRY_RUN != 'true' + env: + COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} + run: pod trunk push mParticle-Apple-SDK.podspec --allow-warnings --synchronous + - name: Summary run: | ARTIFACTS=$(ls *.zip 2>/dev/null | tr '\n' ', ' | sed 's/,$//') @@ -307,18 +313,23 @@ jobs: EOF # ────────────────────────────────────────────── - # CocoaPods: publish core SDK to trunk + # CocoaPods: publish each kit to trunk # ────────────────────────────────────────────── - publish-cocoapods: - name: Publish to CocoaPods - needs: release-core-sdk + publish-kit-cocoapods: + name: Publish ${{ matrix.kit.name }} to CocoaPods + needs: [load-matrix, mirror-and-release-kits, release-core-sdk] runs-on: macos-15 if: ${{ !inputs.dry_run }} + strategy: + fail-fast: false + matrix: + kit: ${{ fromJson(needs.load-matrix.outputs.matrix) }} steps: - name: Checkout code uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Publish to CocoaPods + if: matrix.kit.podspec != '' env: COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} - run: pod trunk push mParticle-Apple-SDK.podspec --allow-warnings + run: pod trunk push ${{ matrix.kit.podspec }} --allow-warnings --synchronous diff --git a/RELEASE.md b/RELEASE.md index 2671bb8a0..15f7abbef 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,35 +1,42 @@ # Release Process -## 1. Draft the release +## 1. Refresh the CocoaPods trunk token + +> [!IMPORTANT] +> The `COCOAPODS_TRUNK_TOKEN` secret in this repository expires after ~180 days. **Refresh it before every release.** + +1. Generate a new session token: + ```bash + pod trunk register developers@mparticle.com 'mParticle Developers' --description='CI release' + ``` + Confirm via the email link, then retrieve the token: + ```bash + grep -A2 'trunk.cocoapods.org' ~/.netrc | grep password | awk '{print $2}' + ``` +2. Update the `COCOAPODS_TRUNK_TOKEN` secret in **Settings → Secrets and variables → Actions** on this repository. + +## 2. Draft the release 1. Go to **Actions → Release – Draft** in GitHub 2. Select the bump type (`patch`, `minor`, or `major`) and run the workflow from `main` This bumps versions across podspecs, `Package.swift`, constants files, and `CHANGELOG.md`, then opens a release PR against `main`. -## 2. Merge the release PR +## 3. Merge the release PR Review and merge the PR. On merge, the **Release – Publish** workflow runs automatically: - Builds xcframeworks for every kit - Mirrors each kit subtree to its own repo under `mparticle-integrations/` - Creates GitHub releases and tags (used by SPM consumers) - -## 3. Publish to CocoaPods - -> [!IMPORTANT] -> This is a **manual** step. Wait for the Release – Publish workflow to finish before running — kit mirror repos and GitHub tags must exist first. - -```bash -# Register a trunk session if you don't have one (expires after ~3 days): -pod trunk register developers@mparticle.com 'mParticle Developers' --description='' -# (confirm via email link) - -# Publish everything: -./Scripts/pod_publish.sh -``` - -This pushes the Swift SDK and core SDK podspecs sequentially, then all kit podspecs in parallel. +- Publishes the core SDK and all kit podspecs to CocoaPods trunk + +> [!NOTE] +> The Swift SDK podspec (`mParticle-Apple-SDK-Swift`) is not yet published automatically — push it manually before the core SDK if required: +> +> ```bash +> pod trunk push mParticle-Apple-SDK-Swift/mParticle-Apple-SDK-Swift.podspec --allow-warnings +> ``` ## Post-release verification diff --git a/Scripts/pod_publish.sh b/Scripts/pod_publish.sh deleted file mode 100755 index 5cd9fa96f..000000000 --- a/Scripts/pod_publish.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -# Publish mParticle Apple SDK and all kit podspecs to CocoaPods trunk. -# -# Prerequisites: -# pod trunk register developers@mparticle.com 'mParticle Developers' --description='' -# (confirm via email link) - -cd "$(dirname "$0")/.." - -PUSH_FLAGS=(--allow-warnings --synchronous) - -echo "==> Publishing Swift SDK (dependency of core)..." -pod trunk push mParticle-Apple-SDK-Swift/mParticle-Apple-SDK-Swift.podspec "${PUSH_FLAGS[@]}" - -echo "==> Publishing core SDK..." -pod trunk push mParticle-Apple-SDK.podspec "${PUSH_FLAGS[@]}" - -echo "==> Publishing kit podspecs..." -# shellcheck disable=SC2312 -mapfile -t KIT_PODSPECS < <(jq -r '.[] | select(.podspec) | .podspec' Kits/matrix.json) -PIDS=() -for podspec in "${KIT_PODSPECS[@]}"; do - echo " - ${podspec}" - pod trunk push "${podspec}" "${PUSH_FLAGS[@]}" & - PIDS+=($!) -done - -FAILED=0 -for pid in "${PIDS[@]}"; do - wait "${pid}" || FAILED=1 -done - -if [[ ${FAILED} -ne 0 ]]; then - echo "==> ERROR: One or more kit podspec publishes failed" >&2 - exit 1 -fi -echo "==> Done" From 2d3e2738bcc93842db65fbdf04f7f36b40cd48ad Mon Sep 17 00:00:00 2001 From: Nickolas Dimitrakas Date: Wed, 8 Apr 2026 13:00:24 -0400 Subject: [PATCH 3/3] Change COCOAPODS_TRUNK_TOKEN expiration to 3 days Updated expiration notice for COCOAPODS_TRUNK_TOKEN. --- RELEASE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASE.md b/RELEASE.md index 15f7abbef..57d5fea7c 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -3,7 +3,7 @@ ## 1. Refresh the CocoaPods trunk token > [!IMPORTANT] -> The `COCOAPODS_TRUNK_TOKEN` secret in this repository expires after ~180 days. **Refresh it before every release.** +> The `COCOAPODS_TRUNK_TOKEN` secret in this repository expires after ~3 days. **Refresh it before every release.** 1. Generate a new session token: ```bash