Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automate publishing podspecs to CocoaPods #313

Merged
merged 6 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 5 additions & 16 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading