Skip to content

Latest commit

 

History

History
122 lines (98 loc) · 4.85 KB

CONTRIBUTING.md

File metadata and controls

122 lines (98 loc) · 4.85 KB

Contributing

Build, run the tests, and validate the pod on macOS with Xcode and CocoaPods installed:

swift build
swift test
pod lib lint Transloadit.podspec --allow-warnings

--allow-warnings is used only to accept deployment-target warnings from TUSKit 3.6.0's published podspec (iOS 10.0 / macOS 10.11), until TUSKit publishes newer minimums or TransloaditKit leaves CocoaPods. Xcode 27 rejects those targets with build errors, so the flag alone does not make lint pass on that toolchain; see CocoaPods publication.

Releasing

Release preparation and publication are separate steps. Prepare a PR that:

  • Updates s.version in Transloadit.podspec.
  • Updates TransloaditAPI.clientHeader in Sources/TransloaditKit/TransloaditAPI.swift to the same version.
  • Moves the release notes from ## Next into a ## VERSION section in CHANGELOG.md, leaving ## Next for future changes.

Merge the preparation PR into main and confirm its build and tests pass before publishing. For 3.6.0, the preparation PR was #47 and the merged commit was d6628f3d7fe5b90bc8271f4912d7cadb25360a27.

Tag and GitHub release

The commands below show 3.6.0. For a new release, replace the version and commit with those from its merged preparation PR. From the repository checkout, create an annotated tag and use the matching changelog section, including its heading, as the GitHub release body. Continue only after each command block succeeds.

(
  set -e
  RELEASE_VERSION=3.6.0
  RELEASE_COMMIT=d6628f3d7fe5b90bc8271f4912d7cadb25360a27
  git fetch origin main --tags
  git merge-base --is-ancestor "$RELEASE_COMMIT" origin/main
  git tag -a "$RELEASE_VERSION" "$RELEASE_COMMIT" -m "$RELEASE_VERSION"
  git push origin "refs/tags/$RELEASE_VERSION"

  RELEASE_NOTES="$(mktemp)"
  trap 'rm -f "$RELEASE_NOTES"' EXIT
  git show "$RELEASE_COMMIT:CHANGELOG.md" | awk -v version="$RELEASE_VERSION" '
    /^## / {
      if (release) exit
      release = ($0 == "## " version)
    }
    release { print }
  ' > "$RELEASE_NOTES"
  test -s "$RELEASE_NOTES"
  gh release create "$RELEASE_VERSION" --repo transloadit/TransloaditKit \
    --verify-tag --title "$RELEASE_VERSION" --notes-file "$RELEASE_NOTES"
)

Confirm the published release has the expected notes and that the tag points to the merged preparation commit.

If the tag was pushed but GitHub release creation failed, fetch the tags and confirm git rev-parse 3.6.0^{commit} matches the preparation commit. Rerun the block with the git tag -a line omitted. If the release already exists, inspect it with gh release view 3.6.0 instead of recreating it.

CocoaPods publication

Publication requires Kevin's approval after the release preparation PR is merged.

Use a macOS machine with Xcode and CocoaPods installed. A pod owner must run pod trunk register with their pod-owner email address on that machine and confirm the session through the verification email. Run pod trunk me to confirm the session is verified and lists Transloadit before pushing.

The 3.6.0 release on trunk was published with CocoaPods 1.17.0 and Xcode 27.0. That release predates the license and deployment-target fixes. Future releases declare iOS 15.0 and macOS 12.0 as their minimum supported versions.

TUSKit 3.6.0 is the latest release on CocoaPods; 3.7.0 removed CocoaPods support. The --allow-warnings exception applies only to its published podspec's obsolete iOS 10.0 / macOS 10.11 deployment targets, until TUSKit publishes newer minimums or TransloaditKit leaves CocoaPods. Xcode 27 treats those targets as build errors, so publication still needs a compatible toolchain or a dependency fix; accepting the limitation for merging PR #50 does not authorize publication.

For a new release, replace both placeholders below with the version and commit from its merged preparation PR. Use a clean repository checkout on a macOS machine with Xcode and CocoaPods, and continue only if validation succeeds:

cd ~/code/TransloaditKit && (
  set -e
  pod trunk me
  RELEASE_VERSION=REPLACE_WITH_RELEASE_VERSION
  RELEASE_COMMIT=REPLACE_WITH_RELEASE_COMMIT
  test -z "$(git status --porcelain=v1)"
  git fetch origin main --tags
  git checkout --detach "$RELEASE_VERSION"
  test "$(git rev-parse HEAD)" = "$RELEASE_COMMIT"
  pod lib lint Transloadit.podspec --allow-warnings
  pod trunk push Transloadit.podspec --allow-warnings
)

The 3.6.0 push returned GitHub commit API timeouts despite completing publication. Run pod trunk info Transloadit and confirm the version is absent before retrying an interrupted push.

After a successful push, confirm the version is listed on trunk:

pod trunk info Transloadit
git switch main

A release is complete when its tag, GitHub release, and CocoaPods trunk version are all published.