Skip to content

Make hotfixes not deploy with the latest tag nor update latest docs#937

Merged
tonidero merged 4 commits into
mainfrom
sdk-3280-avoid-hotfixes-from-deploying-as-latest-tag-in-npm
Mar 12, 2024
Merged

Make hotfixes not deploy with the latest tag nor update latest docs#937
tonidero merged 4 commits into
mainfrom
sdk-3280-avoid-hotfixes-from-deploying-as-latest-tag-in-npm

Conversation

@tonidero

Copy link
Copy Markdown
Contributor

When doing hotfixes, our automations don't work great since they may actually publish as the latest version, overriding the latest package + the default package our docs point to. This fixes that so if we detect that the current version is older than the version

@tonidero tonidero added the ci label Mar 11, 2024
Comment thread fastlane/Fastfile
lane :release do |options|
version_number = current_version_number
is_prerelease = Gem::Version.new(version_number).prerelease?
is_hotfix = !is_prerelease ? hotfix?(package_name) : false

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that I'm only checking the version for the base package, not for the paywalls package. So this assumes they will always have the same version and be deployed one after another.

Comment thread fastlane/Fastfile
'publish',
is_prerelease ? '--tag next' : nil
is_prerelease ? '--tag next' : nil,
is_hotfix ? '--tag hotfix' : nil,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about reusing the same tag (next) but didn't feel right...

@tonidero

Copy link
Copy Markdown
Contributor Author

What do you think about this approach? If we like it, I can move it to the other places we publish to npm/docs like this.

@tonidero tonidero marked this pull request as ready for review March 11, 2024 16:37
@tonidero tonidero requested a review from a team March 11, 2024 16:37

@vegaro vegaro left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing these!

Comment thread fastlane/Fastfile
def hotfix?(package_name)
last_published_version = sh("npm", "view", package_name, "version")
Gem::Version.new(current_version_number) < Gem::Version.new(last_published_version)
end

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:chefskiss:

@tonidero tonidero merged commit 31e77d1 into main Mar 12, 2024
@tonidero tonidero deleted the sdk-3280-avoid-hotfixes-from-deploying-as-latest-tag-in-npm branch March 12, 2024 08:41
This was referenced Mar 13, 2024
vegaro pushed a commit that referenced this pull request Mar 14, 2024
**This is an automatic release.**

### New Features
* Add `displayCloseButton` option to `PaywallView` (#913) via Cesar de
la Vega (@vegaro)
### Dependency Updates
* [AUTOMATIC BUMP] Updates purchases-hybrid-common to 10.2.0 (#940) via
RevenueCat Git Bot (@RCGitBot)
* [Android
7.7.2](https://github.com/RevenueCat/purchases-android/releases/tag/7.7.2)
* [iOS
4.39.0](https://github.com/RevenueCat/purchases-ios/releases/tag/4.39.0)
* [iOS
4.38.1](https://github.com/RevenueCat/purchases-ios/releases/tag/4.38.1)
* [iOS
4.38.0](https://github.com/RevenueCat/purchases-ios/releases/tag/4.38.0)
* [AUTOMATIC BUMP] Updates purchases-hybrid-common to 10.1.0 (#938) via
RevenueCat Git Bot (@RCGitBot)
* [Android
7.7.2](https://github.com/RevenueCat/purchases-android/releases/tag/7.7.2)
* [iOS
4.39.0](https://github.com/RevenueCat/purchases-ios/releases/tag/4.39.0)
* [iOS
4.38.1](https://github.com/RevenueCat/purchases-ios/releases/tag/4.38.1)
* [iOS
4.38.0](https://github.com/RevenueCat/purchases-ios/releases/tag/4.38.0)
### Other Changes
* Make hotfixes not deploy with the latest tag nor update latest docs
(#937) via Toni Rico (@tonidero)
* Update RELEASING.md (#936) via Cesar de la Vega (@vegaro)
* Add 6.7.2 to changelog (#935) via Cesar de la Vega (@vegaro)

---------

Co-authored-by: RevenueCat CI <dev+ci@revenuecat.com>
@vegaro vegaro added pr:other A code change that improves performance and removed pr:ci labels Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:other A code change that improves performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants