Skip to content

Releasing Turf swift

Roman Gardukevich edited this page Aug 30, 2023 · 9 revisions

The following guide will include version names to illustrate releasing version v0.4.0.

Tag the release

Takes 10–15 minutes

  1. Decide on a semver-compliant version number according to these guidelines. The version number should be of the form 9.8.7-alpha.1, 9.8.7-beta.1, 9.8.7-rc.1 (for a release candidate), or 9.8.7 (for a final release).
  2. Create a new branch, such as myname-v9.8.7.
  3. Run ./scripts/update-version.sh v9.8.7, where 9.8.7 is the semver-compliant version you chose in step
  4. Commit the resulting changes with a commit message like v9.8.7 and open a PR to get it reviewed and merged.
  5. Once the PR is merged, switch back to main and pull the latest changes from origin/main.
  6. Create a tag using git tag v9.8.7, where 9.8.7 is the semver-compliant version you chose in step
  7. Push the tag by running git push origin v9.8.7.

Publish the release

Takes 10–15 minutes

You can carry out some of these steps parallel to the previous section while you wait for a PR approval:

  1. Draft a new release.
  2. Title the release v9.8.7 (where 9.8.7 is the new version).
  3. In the tag version dropdown, select the tag you pushed in the previous section.
  4. If this is a prerelease, add release notes based on changes since the previous prerelease. Otherwise, list the changes compared to the previous final release. Start each breaking change with ⚠️, and end each change with a link to the PR. (Unlike the changelog, release notes accept #123 syntax for linking to PRs.)
  5. Prepend the prologue (substituting the old, new, old, and old release, respectively):
    [Changes](https://github.com/mapbox/turf-swift/compare/v9.8.7...v9.9.0) since [v9.8.7](https://github.com/mapbox/turf-swift/releases/tag/v9.8.7):
  6. Append the epilogue:
    Documentation is [available online](https://mapbox.github.io/turf-swift/) or within Xcode.
  7. Check “This is a pre-release” if applicable, then click “Publish release”.

Update the documentation

Takes less than 5 minutes

Publish the new release’s docset by running the following commands (substituting #.#.# for the version number):

SEMVER_VERSION=#.#.#
git checkout v${SEMVER_VERSION}
OUTPUT=${SEMVER_VERSION} ./scripts/document.sh && git add ${SEMVER_VERSION}
git checkout gh-pages && git pull
echo "<meta http-equiv='refresh' content='0; url=${SEMVER_VERSION}' />" > index.html && git add index.html
git commit -m v${SEMVER_VERSION} && git push
git checkout -

Distribute the release (final releases only)

Takes less than 5 minutes

If you aren’t personally listed as an owner of the Turf pod, you can log in using the shared Mapbox account.

CocoaPods trunk release should be triggered automatically in the cocoapods-release workflow as soon as you push tag with a v prefix. Double-check that it passed successfully.

If the pod trunk push command fails due to warnings, open an issue about the warnings. If the warnings are benign, then rerun the rest of the commands passing --allow-warnings.

Finally

  1. (Final releases only.) Move unfinished tickets and open PRs off of the milestone corresponding to this release and onto an upcoming milestone, and close the current milestone.
  2. (Final releases only.) Upgrade MapboxMaps to require the new version in its Package.swift and podspec.
  3. (Final releases only.) Upgrade MapboxDirections to require the new version in its Package.swift, podspec, and Cartfile.