Skip to content

Commit a7bc4d1

Browse files
ci: add publish-cocoapods job to release-publish workflow (#723)
* ci: add publish-cocoapods job to release-publish workflow Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * ci: publish each kit to CocoaPods in release-publish workflow Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Change COCOAPODS_TRUNK_TOKEN expiration to 3 days Updated expiration notice for COCOAPODS_TRUNK_TOKEN. --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 41a8153 commit a7bc4d1

3 files changed

Lines changed: 53 additions & 57 deletions

File tree

.github/workflows/release-publish.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,12 @@ jobs:
8989
body: |
9090
${{ steps.release-notes.outputs.release_notes }}
9191
92+
- name: Publish to CocoaPods
93+
if: env.DRY_RUN != 'true'
94+
env:
95+
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
96+
run: pod trunk push mParticle-Apple-SDK.podspec --allow-warnings --synchronous
97+
9298
- name: Summary
9399
run: |
94100
ARTIFACTS=$(ls *.zip 2>/dev/null | tr '\n' ', ' | sed 's/,$//')
@@ -305,3 +311,25 @@ jobs:
305311
### Release notes
306312
${{ steps.release-notes.outputs.release_notes }}
307313
EOF
314+
315+
# ──────────────────────────────────────────────
316+
# CocoaPods: publish each kit to trunk
317+
# ──────────────────────────────────────────────
318+
publish-kit-cocoapods:
319+
name: Publish ${{ matrix.kit.name }} to CocoaPods
320+
needs: [load-matrix, mirror-and-release-kits, release-core-sdk]
321+
runs-on: macos-15
322+
if: ${{ !inputs.dry_run }}
323+
strategy:
324+
fail-fast: false
325+
matrix:
326+
kit: ${{ fromJson(needs.load-matrix.outputs.matrix) }}
327+
steps:
328+
- name: Checkout code
329+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
330+
331+
- name: Publish to CocoaPods
332+
if: matrix.kit.podspec != ''
333+
env:
334+
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
335+
run: pod trunk push ${{ matrix.kit.podspec }} --allow-warnings --synchronous

RELEASE.md

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,42 @@
11
# Release Process
22

3-
## 1. Draft the release
3+
## 1. Refresh the CocoaPods trunk token
4+
5+
> [!IMPORTANT]
6+
> The `COCOAPODS_TRUNK_TOKEN` secret in this repository expires after ~3 days. **Refresh it before every release.**
7+
8+
1. Generate a new session token:
9+
```bash
10+
pod trunk register developers@mparticle.com 'mParticle Developers' --description='CI release'
11+
```
12+
Confirm via the email link, then retrieve the token:
13+
```bash
14+
grep -A2 'trunk.cocoapods.org' ~/.netrc | grep password | awk '{print $2}'
15+
```
16+
2. Update the `COCOAPODS_TRUNK_TOKEN` secret in **Settings → Secrets and variables → Actions** on this repository.
17+
18+
## 2. Draft the release
419

520
1. Go to **Actions → Release – Draft** in GitHub
621
2. Select the bump type (`patch`, `minor`, or `major`) and run the workflow from `main`
722

823
This bumps versions across podspecs, `Package.swift`, constants files, and `CHANGELOG.md`, then opens a release PR against `main`.
924

10-
## 2. Merge the release PR
25+
## 3. Merge the release PR
1126

1227
Review and merge the PR. On merge, the **Release – Publish** workflow runs automatically:
1328

1429
- Builds xcframeworks for every kit
1530
- Mirrors each kit subtree to its own repo under `mparticle-integrations/`
1631
- Creates GitHub releases and tags (used by SPM consumers)
17-
18-
## 3. Publish to CocoaPods
19-
20-
> [!IMPORTANT]
21-
> This is a **manual** step. Wait for the Release – Publish workflow to finish before running — kit mirror repos and GitHub tags must exist first.
22-
23-
```bash
24-
# Register a trunk session if you don't have one (expires after ~3 days):
25-
pod trunk register developers@mparticle.com 'mParticle Developers' --description='<your machine>'
26-
# (confirm via email link)
27-
28-
# Publish everything:
29-
./Scripts/pod_publish.sh
30-
```
31-
32-
This pushes the Swift SDK and core SDK podspecs sequentially, then all kit podspecs in parallel.
32+
- Publishes the core SDK and all kit podspecs to CocoaPods trunk
33+
34+
> [!NOTE]
35+
> The Swift SDK podspec (`mParticle-Apple-SDK-Swift`) is not yet published automatically — push it manually before the core SDK if required:
36+
>
37+
> ```bash
38+
> pod trunk push mParticle-Apple-SDK-Swift/mParticle-Apple-SDK-Swift.podspec --allow-warnings
39+
> ```
3340
3441
## Post-release verification
3542

Scripts/pod_publish.sh

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)