Anyone have any notes on publishing SPM to another...
# touchlab-tools
n
Anyone have any notes on publishing SPM to another repo using KMMBridge? Docs are currently being re-written: https://touchlab.co/kmmbridge/spm/otherrepo
k
The process is conceptually not complex. In practice, the access config between the repos is painful. CocoaPods always requires publishing to an external repo, which made that process much more difficult. In summary: • Add deploy token config to the KMP repo and the repo you want to publish to, which we'll refer to simply as "remote" here. • In the GA workflow, set the token config so the processes from the GA workflow can "talk" to the remote. • Pass the remote URL into the Gradle build task, and the release tag update Action. ◦ For the build task, pass in a Gradle param
-PGITHUB_REPO=[remote url]
◦ For the action, use the
remote
param (https://github.com/touchlab/ga-update-release-tag/blob/main/action.yml#L22) Manual setup for GitHub deploy keys can be found in the [CocoaPods docs](https://touchlab.co/kmmbridge/cocoapods/cocoapodsgithubpodspec#deploy-keys). The GA action that will set the token for the workflow would look [like this](https://github.com/touchlab/KMMBridgeGithubWorkflow/blob/main/.github/workflows/faktorybuildautoversion.yml#L96), with your specific params added. GitPortal has a command to automate the deploy key setup. That is part of the delay on drafting the unfinished doc you found. I'm on the fence whether the docs should just use that. The manual process is very error-prone, and has resulted in quite a few chats that suck up time, and ultimately turn out to be using the wrong repo in the comment or similar. OTOH, the automated version currently uses the GitHub CLI tool, which not everybody is comfortable with or wants to install.
For the GitPortal command, in this context, it would look something like this:
Copy code
gitportal deploykey -k [remote repo in "owner/repo" format] -a [app repo in "owner/repo" format]