KMMBridgeciGitHub Actions

GitHub Actions

To simplify your workflow files, KMMBridge leverages some custom github actions to facilitate the release process. These should be used to help publish your artifacts using KMMBridge.

Update Release Tags

ga-update-release-tag

Usage:

- uses: touchlab/ga-update-release-tag@v1
  id: update-release-tag
  with:
    commitMessage: "KMP SPM package release for ${{ steps.versionPropertyValue.outputs.propVal }}"
    tagMessage: "KMP release version ${{ steps.versionPropertyValue.outputs.propVal }}"
    tagVersion: ${{ steps.versionPropertyValue.outputs.propVal }}

Description: Updates the git release tag associated with your GitHub release, which is referenced in your Package.swift. When publishing SPM binaries for KMP, you need a Package.swift file pointing at your binary, and that needs to be referenced by a git tag. This action is performed after kmmBridgePublish, and updates the tag to point to the newly published release.

This action assumes you want to support a local-dev workflow for testing the KMP code. As such, the tagged commit created for the SPM release is not pushed to any specific branch. The commit referenced by the tag exists, but is not part of any branch in the repo.

Options: commitMessage - Message for the commit which updates the Package.swift file tagVersion - Version string to use in the tag. Should follow semver rules tagMessage (optional ) - Message for the release tag. Defaults to “Version $tagVersion” branchName (optional ) - Branch to create and build with. Safe to ignore this remote (optional ) - Remote to push to. Default to “origin”

Push Remote Swift Package

ga-push-remote-swift-package

Usage:

- uses: touchlab/ga-push-remote-swift-package@v1
  id: push-remote-swift-package
  with:
    commitMessage: "KMP SPM package release for ${{ steps.versionPropertyValue.outputs.propVal }}"
    remoteRepo: owner/publishrepo
    remoteBranch: main
    tagVersion: ${{ steps.versionPropertyValue.outputs.propVal }}
    tagMessage: "KMP release version ${{ steps.versionPropertyValue.outputs.propVal }}"

Description: This action takes the Package.swift from your local repo and pushes it to a remote repo. It will also add a tag for versioning purposes. To support using GitHub Releases, the tag will overwrite the release tag if it already exists. Can be used to publish SPM to Another GitHub Repo.

Options:

  • commitMessage - Message for the commit which updates the Package.swift file
  • remoteRepo - Repo we are publishing to in [org]/[repo] format
  • remoteBranch - Branch we are pushing to. If using a branch-based dev flow, the remote branch should match or at least be distinct.
  • tagVersion (optional ) - Version string to use in the tag, implying this is a versioned release. Should follow semver rules. Leave blank for branch dev flow.
  • tagMessage(optional )- Message for the version tag commit. Defaults to “Version $tagVersion”
  • remoteRepoUrl(optional )- Full url for the repo we are publishing to. Defaults to ”https://github.com/${remoteRepo}.git
  • localPackagePath(optional )- Local path to the Package.swift file. This is usually the repo root. The default for this argument is an empty string. Internally, we expand the argument with the following: “.$localPackagePath/Package.swift”. If you provide a value for this argument, leave out the . prefix and the /Package.swift suffix. For example, if your Package.swift is for some reason at [repo root]/mylibrary/Package.swift, the argument would be /mylibrary.
  • remotePackagePath(optional )- Remote path to Package.swift. Similar to localPackagePath, we assume repo root. If not, follow the same convention.
  • packageFileOnly(optional ) - Set to “true” if you only want to share the Package.swift file.