Skip to content

Commit

Permalink
Merge pull request xotahal#30 from janziemba/feat/is-next-version-com…
Browse files Browse the repository at this point in the history
…patible-with-codepush

feat: add RELEASE_IS_NEXT_VERSION_COMPATIBLE_WITH_CODEPUSH variable
  • Loading branch information
xotahal authored Feb 14, 2021
2 parents bc5ee67 + 55cbde0 commit 79ca32c
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module Actions
module SharedValues
RELEASE_ANALYZED = :RELEASE_ANALYZED
RELEASE_IS_NEXT_VERSION_HIGHER = :RELEASE_IS_NEXT_VERSION_HIGHER
RELEASE_IS_NEXT_VERSION_COMPATIBLE_WITH_CODEPUSH = :RELEASE_IS_NEXT_VERSION_COMPATIBLE_WITH_CODEPUSH
RELEASE_LAST_TAG_HASH = :RELEASE_LAST_TAG_HASH
RELEASE_LAST_VERSION = :RELEASE_LAST_VERSION
RELEASE_NEXT_MAJOR_VERSION = :RELEASE_NEXT_MAJOR_VERSION
Expand Down Expand Up @@ -81,6 +82,8 @@ def self.is_releasable(params)
next_minor = (version.split('.')[1] || 0).to_i
next_patch = (version.split('.')[2] || 0).to_i

is_next_version_compatible_with_codepush = true

# Get commits log between last version and head
splitted = get_commits_from_hash(
hash: hash,
Expand Down Expand Up @@ -122,6 +125,10 @@ def self.is_releasable(params)
next_patch += 1
end

unless commit[:is_codepush_friendly]
is_next_version_compatible_with_codepush = false
end

next_version = "#{next_major}.#{next_minor}.#{next_patch}"
UI.message("#{next_version}: #{subject}") if params[:show_version_path]
end
Expand All @@ -132,6 +139,7 @@ def self.is_releasable(params)

Actions.lane_context[SharedValues::RELEASE_ANALYZED] = true
Actions.lane_context[SharedValues::RELEASE_IS_NEXT_VERSION_HIGHER] = is_next_version_releasable
Actions.lane_context[SharedValues::RELEASE_IS_NEXT_VERSION_COMPATIBLE_WITH_CODEPUSH] = is_next_version_compatible_with_codepush
# Last release analysis
Actions.lane_context[SharedValues::RELEASE_LAST_TAG_HASH] = hash
Actions.lane_context[SharedValues::RELEASE_LAST_VERSION] = version
Expand Down Expand Up @@ -303,6 +311,7 @@ def self.output
[
['RELEASE_ANALYZED', 'True if commits were analyzed.'],
['RELEASE_IS_NEXT_VERSION_HIGHER', 'True if next version is higher then last version'],
['RELEASE_IS_NEXT_VERSION_COMPATIBLE_WITH_CODEPUSH', 'True if next version is compatible with codepush'],
['RELEASE_LAST_TAG_HASH', 'Hash of commit that is tagged as a last version'],
['RELEASE_LAST_VERSION', 'Last version number - parsed from last tag.'],
['RELEASE_NEXT_MAJOR_VERSION', 'Major number of the next version'],
Expand Down

0 comments on commit 79ca32c

Please sign in to comment.