Skip to content

Commit

Permalink
Fix version release task (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
tom-quiltt authored Mar 16, 2024
1 parent 0cbf0eb commit a768e89
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ default_platform :android

REPO_NAME = 'quiltt/quiltt-android'.freeze
GITHUB_TOKEN = ENV['GITHUB_TOKEN']
GRADLE_FILE_PATH = '../connector/build.gradle.kts'
SDK_VERSION_FILE_PATH = "../connector/src/main/java/app/quiltt/connector/QuilttSdkVersion.kt"

def release(new_version)
Expand All @@ -17,7 +18,7 @@ def release(new_version)
name: new_version.to_s,
tag_name: new_version.to_s,
is_generate_release_notes: true,
commitish: 'main'
commitish: new_branch
)

create_pull_request(
Expand All @@ -44,12 +45,12 @@ def bump_version_file(level)
end

def generate_new_connector_build_gradle(new_version)
connector_build_gradle = File.read('../connector/build.gradle.kts')
connector_build_gradle = File.read(GRADLE_FILE_PATH)
new_connector_build_gradle = connector_build_gradle.gsub(
/version = "(\d+.\d+.\d+)"/,
"version = \"#{new_version}\""
)
File.write('../connector/build.gradle.kts', new_connector_build_gradle)
File.write(GRADLE_FILE_PATH, new_connector_build_gradle)
end

def generate_release_version_file(version)
Expand All @@ -58,6 +59,7 @@ end

def push_to_git_remote(branch)
sh("git checkout -b #{branch}")
sh("git add #{GRADLE_FILE_PATH}")
sh("git add #{SDK_VERSION_FILE_PATH}")
sh('git commit -m "Bump version"')
sh("git push origin #{branch}")
Expand Down

0 comments on commit a768e89

Please sign in to comment.