Skip to content

Commit e678dd6

Browse files
committed
Try having special logic for snapshot publishing
1 parent 72518ba commit e678dd6

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

scripts/release_sdk.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,14 +153,19 @@ def get_asset_path(root_project_dir: str, module: Module) -> str:
153153
raise ValueError(f"Unknown module: {module}")
154154

155155

156-
def get_publish_task(module: Module) -> str:
156+
def get_publish_task(module: Module, is_snapshot: bool) -> str:
157157
if module == Module.SDK:
158-
return ":sdk:sdk-android:publishToSonatype"
158+
command = ":sdk:sdk-android:publishToSonatype"
159159
elif module == Module.CRYPTO:
160-
return ":crypto:crypto-android:publishToSonatype"
160+
command = ":crypto:crypto-android:publishToSonatype"
161161
else:
162162
raise ValueError(f"Unknown module: {module}")
163163

164+
if is_snapshot:
165+
return f"{command} -Psnapshot"
166+
else:
167+
return command
168+
164169

165170
def run_publish_close_and_release_tasks(root_project_dir, publish_task: str):
166171
gradle_command = f"./gradlew {publish_task} closeAndReleaseStagingRepository"
@@ -211,7 +216,7 @@ def main(args: argparse.Namespace):
211216
# First release on Maven
212217
run_publish_close_and_release_tasks(
213218
project_root,
214-
get_publish_task(args.module),
219+
get_publish_task(args.module, args.version.endswith("-SNAPSHOT")),
215220
)
216221

217222
if not args.version.endswith("-SNAPSHOT"):

0 commit comments

Comments
 (0)