TelemetryDeck / SwiftSDK

Swift SDK for TelemetryDeck, a privacy-conscious analytics service for apps and websites.
https://telemetrydeck.com/
Other
149 stars 30 forks source link

Add tag-release.sh script for bumping version & tagging #72

Closed Jeehut closed 1 year ago

Jeehut commented 1 year ago

I put all in a shell script so you could invoke it from anywhere if you decide to further automate things (locally or on the CI).

The script takes the new version as an argument and does 4 things:

  1. Check that there are no uncommitted changes (otherwise fails).
  2. Replace the version String in the SDK.
  3. Commit the changes.
  4. Tag the new commit.

I decided against a lint check because such a check would require the tag to be already available but you created the latest tag after merging https://github.com/TelemetryDeck/SwiftClient/pull/70, so a lint check would run when it's already too late. The same problem exists with pre-commit hooks, as a tag can only be created after the commit is made.

Fixes #57.

Jeehut commented 1 year ago

@winsmith I forgot to mention that it should be easy to adjust this script to your needs. For example, if you wanted to first push a PR before making a release to see the CI results, you could also split it up to two parts: The first (e.g. start-release.sh) creating a new branch named after the version (e.g. release/1.3.0) and committing the version bump and all changes you might need. And a second (e.g. finish-release.sh) merging that branch to main and creating the tag for you using the branch name and removing the prefix "release/" from it. Or any other process you prefer. I didn't know what you would like best, so I opted for a very simple version that just does a commit and tags it locally.

winsmith commented 1 year ago

That's just awesome. Thank you very much!