diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 06a21e34..27d18c4e 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -173,23 +173,12 @@ To update dependencies such as `SwiftProtobuf` in this repository: Releases should be tagged in `x.y.z` SemVer format. -1. Create a new GitHub release. -2. Update both [`Connect-Swift.podspec`](../Connect-Swift.podspec) and +1. Update both [`Connect-Swift.podspec`](../Connect-Swift.podspec) and [`Connect-Swift-Mocks.podspec`](../Connect-Swift-Mocks.podspec) to reflect - the newly tagged version. -3. Run `cd Examples/ElizaCocoaPodsApp && pod update` to update the example CocoaPods app. -4. Submit a PR with these changes. -5. Push both specs to CocoaPods: - -```sh -pod trunk push Connect-Swift.podspec -pod repo update -pod trunk push Connect-Swift-Mocks.podspec -``` - -Note: If pushing the mocks podspec fails because CocoaPods cannot find the new -`Connect-Swift` podspec in the specs repo, you may have to wait ~30 min -for it to populate before trying again. + the upcoming version on `main`. In the same PR, update the example CocoaPods + app by running `cd Examples/ElizaCocoaPodsApp && pod install`. +2. Create a new GitHub release/tag after merging these changes. +3. CI will automatically push the updated specs to CocoaPods in its [release job](./workflows/release.yml). [dco]: https://developercertificate.org [commit-message]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ca584a8b..89a41598 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -36,3 +36,17 @@ jobs: append_body: true files: | ./.tmp/bin/artifacts/* + publish-podspecs: + runs-on: macos-14 + steps: + - uses: actions/checkout@v4 + - name: Select Xcode version + # https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md#xcode + run: sudo xcode-select --switch /Applications/Xcode_16.app + - name: Publish podspecs to CocoaPods + env: + COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} + # Note that --synchronous is used since Mocks depends on the primary spec. + run: | + pod trunk push Connect-Swift.podspec --allow-warnings --synchronous + pod trunk push Connect-Swift-Mocks.podspec --allow-warnings --synchronous