From 1e412b4f029ba8f529cabae66453cf936d9af947 Mon Sep 17 00:00:00 2001 From: mario-launchdarkly Date: Tue, 17 Mar 2026 17:02:00 -0600 Subject: [PATCH 1/3] feat: automate cocopods releases --- .github/actions/publish/action.yml | 20 +++++++++++++++++++ .github/workflows/manual-publish.yml | 29 ++++++++++++++++++++++++++++ .github/workflows/release-please.yml | 13 +++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 .github/actions/publish/action.yml create mode 100644 .github/workflows/manual-publish.yml diff --git a/.github/actions/publish/action.yml b/.github/actions/publish/action.yml new file mode 100644 index 00000000..273fa5ae --- /dev/null +++ b/.github/actions/publish/action.yml @@ -0,0 +1,20 @@ +name: "Publish Podspecs" +description: "Publish both podspecs to CocoaPods trunk" + +inputs: + dry_run: + description: "Is this a dry run. If so no package will be published." + required: true + +runs: + using: composite + steps: + - name: Push LaunchDarklyObservability to CocoaPods + if: ${{ inputs.dry_run == 'false' }} + shell: bash + run: pod trunk push LaunchDarklyObservability.podspec --allow-warnings --verbose + + - name: Push LaunchDarklySessionReplay to CocoaPods + if: ${{ inputs.dry_run == 'false' }} + shell: bash + run: pod trunk push LaunchDarklySessionReplay.podspec --allow-warnings --verbose diff --git a/.github/workflows/manual-publish.yml b/.github/workflows/manual-publish.yml new file mode 100644 index 00000000..d008ac50 --- /dev/null +++ b/.github/workflows/manual-publish.yml @@ -0,0 +1,29 @@ +name: Manual Publish + +on: + workflow_dispatch: + inputs: + dry_run: + description: "Is this a dry run. If so no package will be published." + type: boolean + required: true + +jobs: + publish: + runs-on: ubuntu-latest + permissions: + id-token: write + contents: read + steps: + - uses: actions/checkout@v4 + + - name: Get CocoaPods token + uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets-v1.2.0 + with: + aws_assume_role: ${{ vars.AWS_ROLE_ARN }} + ssm_parameter_pairs: '/production/common/releasing/cocoapods/token = COCOAPODS_TRUNK_TOKEN' + + - name: Publish to CocoaPods + uses: ./.github/actions/publish + with: + dry_run: ${{ inputs.dry_run }} diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 495ecbb9..d0236737 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -29,3 +29,16 @@ jobs: if: ${{ steps.release.outputs.releases_created == 'true' }} with: fetch-depth: 0 # If you only need the current version keep this. + + - name: Get CocoaPods token + uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets-v1.2.0 + if: ${{ steps.release.outputs.releases_created == 'true' }} + with: + aws_assume_role: ${{ vars.AWS_ROLE_ARN }} + ssm_parameter_pairs: '/production/common/releasing/cocoapods/token = COCOAPODS_TRUNK_TOKEN' + + - name: Publish to CocoaPods + uses: ./.github/actions/publish + if: ${{ steps.release.outputs.releases_created == 'true' }} + with: + dry_run: 'false' From 1d933b336acd15f1116eef23a5b30de88ffa79cf Mon Sep 17 00:00:00 2001 From: mario-launchdarkly Date: Wed, 18 Mar 2026 14:48:34 -0600 Subject: [PATCH 2/3] chore: split the pod pushes into two separate publish actions --- .../action.yml | 9 ++------- .../actions/publish-session-replay/action.yml | 15 +++++++++++++++ .github/workflows/manual-publish.yml | 18 ++++++++++++++++-- .github/workflows/release-please.yml | 15 +++++++++++---- .release-please-manifest.json | 3 ++- release-please-config.json | 12 ++++++++++-- 6 files changed, 56 insertions(+), 16 deletions(-) rename .github/actions/{publish => publish-observability}/action.yml (55%) create mode 100644 .github/actions/publish-session-replay/action.yml diff --git a/.github/actions/publish/action.yml b/.github/actions/publish-observability/action.yml similarity index 55% rename from .github/actions/publish/action.yml rename to .github/actions/publish-observability/action.yml index 273fa5ae..2f582660 100644 --- a/.github/actions/publish/action.yml +++ b/.github/actions/publish-observability/action.yml @@ -1,5 +1,5 @@ -name: "Publish Podspecs" -description: "Publish both podspecs to CocoaPods trunk" +name: "Publish LaunchDarklyObservability" +description: "Publish LaunchDarklyObservability.podspec to CocoaPods trunk" inputs: dry_run: @@ -13,8 +13,3 @@ runs: if: ${{ inputs.dry_run == 'false' }} shell: bash run: pod trunk push LaunchDarklyObservability.podspec --allow-warnings --verbose - - - name: Push LaunchDarklySessionReplay to CocoaPods - if: ${{ inputs.dry_run == 'false' }} - shell: bash - run: pod trunk push LaunchDarklySessionReplay.podspec --allow-warnings --verbose diff --git a/.github/actions/publish-session-replay/action.yml b/.github/actions/publish-session-replay/action.yml new file mode 100644 index 00000000..36417d1f --- /dev/null +++ b/.github/actions/publish-session-replay/action.yml @@ -0,0 +1,15 @@ +name: "Publish LaunchDarklySessionReplay" +description: "Publish LaunchDarklySessionReplay.podspec to CocoaPods trunk" + +inputs: + dry_run: + description: "Is this a dry run. If so no package will be published." + required: true + +runs: + using: composite + steps: + - name: Push LaunchDarklySessionReplay to CocoaPods + if: ${{ inputs.dry_run == 'false' }} + shell: bash + run: pod trunk push LaunchDarklySessionReplay.podspec --allow-warnings --verbose diff --git a/.github/workflows/manual-publish.yml b/.github/workflows/manual-publish.yml index d008ac50..4ea6c24f 100644 --- a/.github/workflows/manual-publish.yml +++ b/.github/workflows/manual-publish.yml @@ -3,6 +3,13 @@ name: Manual Publish on: workflow_dispatch: inputs: + package: + description: "Which package to publish" + type: choice + required: true + options: + - LaunchDarklyObservability + - LaunchDarklySessionReplay dry_run: description: "Is this a dry run. If so no package will be published." type: boolean @@ -23,7 +30,14 @@ jobs: aws_assume_role: ${{ vars.AWS_ROLE_ARN }} ssm_parameter_pairs: '/production/common/releasing/cocoapods/token = COCOAPODS_TRUNK_TOKEN' - - name: Publish to CocoaPods - uses: ./.github/actions/publish + - name: Publish LaunchDarklyObservability + uses: ./.github/actions/publish-observability + if: ${{ inputs.package == 'LaunchDarklyObservability' }} + with: + dry_run: ${{ inputs.dry_run }} + + - name: Publish LaunchDarklySessionReplay + uses: ./.github/actions/publish-session-replay + if: ${{ inputs.package == 'LaunchDarklySessionReplay' }} with: dry_run: ${{ inputs.dry_run }} diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index d0236737..37ba1e2e 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -20,6 +20,7 @@ jobs: with: aws_assume_role: ${{ vars.AWS_ROLE_ARN }} ssm_parameter_pairs: '/production/common/releasing/o11y_gh_pat = GITHUB_PAT' + - uses: googleapis/release-please-action@a02a34c4d625f9be7cb89156071d8567266a2445 id: release with: @@ -28,7 +29,7 @@ jobs: - uses: actions/checkout@v4 if: ${{ steps.release.outputs.releases_created == 'true' }} with: - fetch-depth: 0 # If you only need the current version keep this. + fetch-depth: 0 - name: Get CocoaPods token uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets-v1.2.0 @@ -37,8 +38,14 @@ jobs: aws_assume_role: ${{ vars.AWS_ROLE_ARN }} ssm_parameter_pairs: '/production/common/releasing/cocoapods/token = COCOAPODS_TRUNK_TOKEN' - - name: Publish to CocoaPods - uses: ./.github/actions/publish - if: ${{ steps.release.outputs.releases_created == 'true' }} + - name: Publish LaunchDarklyObservability + uses: ./.github/actions/publish-observability + if: ${{ steps.release.outputs['.--release_created'] == 'true' }} + with: + dry_run: 'false' + + - name: Publish LaunchDarklySessionReplay + uses: ./.github/actions/publish-session-replay + if: ${{ steps.release.outputs['Sources/LaunchDarklySessionReplay--release_created'] == 'true' }} with: dry_run: 'false' diff --git a/.release-please-manifest.json b/.release-please-manifest.json index cee962e8..a16f08e5 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,4 @@ { - ".": "0.26.0" + ".": "0.26.0", + "Sources/LaunchDarklySessionReplay": "0.26.0" } diff --git a/release-please-config.json b/release-please-config.json index 94404252..c08f6274 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -3,13 +3,21 @@ "include-v-in-tag": false, "packages": { ".": { - "package-name": "swift-launchdarkly-observability", + "package-name": "LaunchDarklyObservability", "release-type": "simple", "versioning": "default", "bump-minor-pre-major": true, "extra-files": [ "Sources/LaunchDarklyObservability/Version.swift", - "LaunchDarklyObservability.podspec", + "LaunchDarklyObservability.podspec" + ] + }, + "Sources/LaunchDarklySessionReplay": { + "package-name": "LaunchDarklySessionReplay", + "release-type": "simple", + "versioning": "default", + "bump-minor-pre-major": true, + "extra-files": [ "LaunchDarklySessionReplay.podspec" ] } From 5f5cf30821613b35f2c87eb813e9b856fad52489 Mon Sep 17 00:00:00 2001 From: mario-launchdarkly Date: Wed, 18 Mar 2026 14:50:05 -0600 Subject: [PATCH 3/3] chore: update CI workflows to use macOS for publishing and release jobs --- .github/workflows/manual-publish.yml | 2 +- .github/workflows/release-please.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/manual-publish.yml b/.github/workflows/manual-publish.yml index 4ea6c24f..88db54d1 100644 --- a/.github/workflows/manual-publish.yml +++ b/.github/workflows/manual-publish.yml @@ -17,7 +17,7 @@ on: jobs: publish: - runs-on: ubuntu-latest + runs-on: macos-latest permissions: id-token: write contents: read diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 37ba1e2e..9dd677de 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -6,7 +6,7 @@ on: jobs: release-package: - runs-on: ubuntu-latest + runs-on: macos-latest permissions: id-token: write contents: write # Contents and pull-requests are for release-please to make releases.