From f5655c826180dd865e25ff4350118bca72838c52 Mon Sep 17 00:00:00 2001 From: Andre Destro Date: Wed, 14 Jan 2026 15:24:57 +0000 Subject: [PATCH 1/2] feat(ci): add publish-pod job to invoke CocoaPods publish workflow --- .github/workflows/publish_pod.yml | 30 ++++++++++++++++++++++++++ .github/workflows/release_plugin.yml | 9 +++++++- packages/capacitor-plugin/package.json | 3 ++- 3 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/publish_pod.yml diff --git a/.github/workflows/publish_pod.yml b/.github/workflows/publish_pod.yml new file mode 100644 index 0000000..a14a916 --- /dev/null +++ b/.github/workflows/publish_pod.yml @@ -0,0 +1,30 @@ +name: Publish to Cocoapods + +on: + workflow_call: + secrets: + COCOAPODS_TRUNK_TOKEN: + required: true + +jobs: + publish-ios: + runs-on: macos-15 + timeout-minutes: 30 + steps: + - run: sudo xcode-select --switch /Applications/Xcode_26.2.app + - run: xcrun simctl list > /dev/null + - run: xcodebuild -downloadPlatform iOS + - uses: actions/setup-node@v6 + with: + node-version: 24 + - uses: actions/checkout@v5 + - name: Install Cocoapods + run: | + gem install cocoapods + - name: Deploy to Cocoapods + run: | + set -eo pipefail + npm run publish:cocoapod + env: + COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} + working-directory: ./packages/capacitor-plugin diff --git a/.github/workflows/release_plugin.yml b/.github/workflows/release_plugin.yml index 6a4ff28..103b168 100644 --- a/.github/workflows/release_plugin.yml +++ b/.github/workflows/release_plugin.yml @@ -47,4 +47,11 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.CAP_GH_RELEASE_TOKEN }} GH_TOKEN: ${{ secrets.CAP_GH_RELEASE_TOKEN }} - run: npx semantic-release \ No newline at end of file + run: npx semantic-release + + publish-pod: + needs: release + uses: ./.github/workflows/publish_pod.yml + secrets: + COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} + diff --git a/packages/capacitor-plugin/package.json b/packages/capacitor-plugin/package.json index 12a5e9f..00159a4 100644 --- a/packages/capacitor-plugin/package.json +++ b/packages/capacitor-plugin/package.json @@ -43,7 +43,8 @@ "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs", "clean": "rimraf ./dist", "watch": "tsc --watch", - "prepublishOnly": "npm run build" + "prepublishOnly": "npm run build", + "publish:cocoapod": "pod trunk push ./CapacitorGeolocation.podspec --allow-warnings" }, "dependencies": { "@capacitor/synapse": "^1.0.4" From 41dae39f0c07846beb050a333915582a937529e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Destro?= <254790+andredestro@users.noreply.github.com> Date: Thu, 15 Jan 2026 14:32:11 +0000 Subject: [PATCH 2/2] Update .github/workflows/publish_pod.yml Co-authored-by: Pedro Bilro --- .github/workflows/publish_pod.yml | 10 +++++++++- .github/workflows/release_plugin.yml | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish_pod.yml b/.github/workflows/publish_pod.yml index a14a916..2e2e949 100644 --- a/.github/workflows/publish_pod.yml +++ b/.github/workflows/publish_pod.yml @@ -1,14 +1,18 @@ -name: Publish to Cocoapods +name: Publish Capacitor Plugin to CocoaPods Trunk on: workflow_call: secrets: COCOAPODS_TRUNK_TOKEN: required: true + CAP_GH_RELEASE_TOKEN: + required: true + workflow_dispatch: jobs: publish-ios: runs-on: macos-15 + if: github.ref == 'refs/heads/main' timeout-minutes: 30 steps: - run: sudo xcode-select --switch /Applications/Xcode_26.2.app @@ -18,6 +22,10 @@ jobs: with: node-version: 24 - uses: actions/checkout@v5 + with: + fetch-depth: 0 + ref: ${{ github.ref_name }} # explicitly set ref to include commit from `semantic-release` + token: ${{ secrets.CAP_GH_RELEASE_TOKEN }} - name: Install Cocoapods run: | gem install cocoapods diff --git a/.github/workflows/release_plugin.yml b/.github/workflows/release_plugin.yml index 103b168..73815f4 100644 --- a/.github/workflows/release_plugin.yml +++ b/.github/workflows/release_plugin.yml @@ -54,4 +54,5 @@ jobs: uses: ./.github/workflows/publish_pod.yml secrets: COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} + CAP_GH_RELEASE_TOKEN: ${{ secrets.CAP_GH_RELEASE_TOKEN }}