diff --git a/.github/actions/publish-observability/action.yml b/.github/actions/publish-observability/action.yml new file mode 100644 index 00000000..2f582660 --- /dev/null +++ b/.github/actions/publish-observability/action.yml @@ -0,0 +1,15 @@ +name: "Publish LaunchDarklyObservability" +description: "Publish LaunchDarklyObservability.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 LaunchDarklyObservability to CocoaPods + if: ${{ inputs.dry_run == 'false' }} + shell: bash + run: pod trunk push LaunchDarklyObservability.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 new file mode 100644 index 00000000..88db54d1 --- /dev/null +++ b/.github/workflows/manual-publish.yml @@ -0,0 +1,43 @@ +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 + required: true + +jobs: + publish: + runs-on: macos-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 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 495ecbb9..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. @@ -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,4 +29,23 @@ 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 + 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 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 0294524e..34f0b19c 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,4 @@ { - ".": "0.26.1" + ".": "0.26.1", + "Sources/LaunchDarklySessionReplay": "0.26.1" } 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" ] }