TelemetryDeck / SwiftSDK

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

Use CI to update Version String #57

Closed Jeehut closed 2 years ago

Jeehut commented 2 years ago

While skimming through the code, I noticed this line stating the current version of the client to be 1.1.5, but 1.1.6 seems to be already released. Could it be that this version String is manually updated?

Maybe we should think about a solution to ensure it can never be outdated either by making it dynamic or adding some checks (in the build process or CI) to prevent such a thing from happening again. I imagine it could be hard to debug issues if you're searching in the wrong commit. :)

winsmith commented 2 years ago

Oh yes, this string is currently updated by hand, and it sucks! We definitely need to use CI to update this instead, or find another better process.

Jeehut commented 2 years ago

@winsmith What CI are you using? I can't find any CI config files in the project. We could set up a GitHub Actions lint check, but I guess you tag things manually on a local machine and push that up. If that's the case, the easiest solution would be to simply add a Shell script that you could invoke whenever you make a new release that automates the tagging, the Version update and the push for you.

Something as simple as this file that I invoke as a pre-commit hook, for example. But in your case you would use git commands and sed to replace the existing version with a new one. That way you could later reuse the same script on CI as well, which could be a next step to automate it. Just an idea.

winsmith commented 2 years ago

We're using GitHub actions for all our repos, but right now the process for this SDK is completely manual. A lint check sounds like a great idea, as does the sed thing. If you feel like another PR, that would be amazing, otherwise I'll add it to my way too long list of things to do 😂

Jeehut commented 2 years ago

Sure, no worries. Let me see if I can find some time soon to set something up. You would be okay if I introduced GitHub Actions for a CI here with a simple workflow for the lint check, right? I think that would be the easiest solution.

winsmith commented 2 years ago

Totally, I use GH actions a lot!

winsmith commented 2 years ago

@Jeehut btw I added CI actions to main, since those were long overdue. What's your strategy for checking or increasing the version number on release?

Jeehut commented 2 years ago

I'm currently on vacation, but once I have time to tackle this my plan was to go the easy route and simply add a lint check that makes the CI fail when the version Strings are different from the latest released tag, I think. Haven't thought this through, but that would be my starting point.

winsmith commented 2 years ago

Sounds like a very good idea -- enjoy your vacation :D~