Skip to content

Commit ba3d84e

Browse files
committed
Allow building snapshots with the default relase_sdk flow
1 parent e17a3ce commit ba3d84e

File tree

3 files changed

+26
-221
lines changed

3 files changed

+26
-221
lines changed

.github/workflows/snapshot.yml

Lines changed: 0 additions & 196 deletions
This file was deleted.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
object BuildVersionsSDK {
2-
const val majorVersion = 25
3-
const val minorVersion = 4
4-
const val patchVersion = 22
2+
const val majorVersion = "25"
3+
const val minorVersion = "4"
4+
const val patchVersion = "22"
55
}

scripts/release_sdk.py

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ def override_version_in_build_version_file(file_path: str, new_version: str):
2525
with open(file_path, 'r') as file:
2626
content = file.read()
2727

28-
new_major, new_minor, new_patch = map(int, new_version.split('.'))
28+
new_major, new_minor, new_patch = new_version.split('.')
2929

30-
content = re.sub(r"(majorVersion\s*=\s*)(\d+)", rf"\g<1>{new_major}", content)
31-
content = re.sub(r"(minorVersion\s*=\s*)(\d+)", rf"\g<1>{new_minor}", content)
32-
content = re.sub(r"(patchVersion\s*=\s*)(\d+)", rf"\g<1>{new_patch}", content)
30+
content = re.sub(r'(majorVersion\s*=\s*)"(.+)"', rf'\g<1>"{new_major}"', content)
31+
content = re.sub(r'(minorVersion\s*=\s*)"(.+)"', rf'\g<1>"{new_minor}"', content)
32+
content = re.sub(r'(patchVersion\s*=\s*)"(.+)"', rf'\g<1>"{new_patch}"', content)
3333

3434
with open(file_path, 'w') as file:
3535
file.write(content)
@@ -214,24 +214,25 @@ def main(args: argparse.Namespace):
214214
get_publish_task(args.module),
215215
)
216216

217-
# Success, commit and push changes, then create github release
218-
commit_message = f"Bump {args.module.name} version to {args.version} (matrix-rust-sdk to {args.linkable_ref})"
219-
print(f"Commit message: {commit_message}")
220-
commit_and_push_changes(project_root, commit_message)
221-
222-
release_name = f"{args.module.name.lower()}-v{args.version}"
223-
release_notes = f"https://github.com/matrix-org/matrix-rust-sdk/tree/{args.linkable_ref}"
224-
asset_path = get_asset_path(project_root, args.module)
225-
asset_name = get_asset_name(args.module)
226-
create_github_release(
227-
github_token,
228-
"https://api.github.com/repos/matrix-org/matrix-rust-components-kotlin",
229-
release_name,
230-
release_name,
231-
release_notes,
232-
asset_path,
233-
asset_name,
234-
)
217+
if not 'SNAPSHOT' in args.version:
218+
# Success, commit and push changes, then create github release
219+
commit_message = f"Bump {args.module.name} version to {args.version} (matrix-rust-sdk to {args.linkable_ref})"
220+
print(f"Commit message: {commit_message}")
221+
commit_and_push_changes(project_root, commit_message)
222+
223+
release_name = f"{args.module.name.lower()}-v{args.version}"
224+
release_notes = f"https://github.com/matrix-org/matrix-rust-sdk/tree/{args.linkable_ref}"
225+
asset_path = get_asset_path(project_root, args.module)
226+
asset_name = get_asset_name(args.module)
227+
create_github_release(
228+
github_token,
229+
"https://api.github.com/repos/matrix-org/matrix-rust-components-kotlin",
230+
release_name,
231+
release_name,
232+
release_notes,
233+
asset_path,
234+
asset_name,
235+
)
235236

236237

237238
parser = argparse.ArgumentParser()

0 commit comments

Comments
 (0)