From 42696eb31dc00f1b345551e5c9d2441c1df7b57b Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 9 Jan 2024 14:04:08 +0100 Subject: [PATCH 1/2] Fix parsing after artifact url change on GitHub --- tools/release/download_github_artifacts.py | 27 +++++++++++----------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/tools/release/download_github_artifacts.py b/tools/release/download_github_artifacts.py index 4424c0e009..8bc0c2d9c9 100755 --- a/tools/release/download_github_artifacts.py +++ b/tools/release/download_github_artifacts.py @@ -16,11 +16,12 @@ # import argparse -import hashlib import json import os # Run `pip3 install requests` if not installed yet import requests +# Run `pip3 install re` if not installed yet +import re # This script downloads artifacts from GitHub. # Ref: https://docs.github.com/en/rest/actions/artifacts#get-an-artifact @@ -65,22 +66,20 @@ if args.verbose: print(args) # Split the artifact URL to get information -# Ex: https://github.com/element-hq/element-android/suites/9293388174/artifacts/435942121 +# Ex: https://github.com/element-hq/element-android/actions/runs/7460386865/artifacts/1156548729 artifactUrl = args.artifactUrl -if not artifactUrl.startswith('https://github.com/'): - print("❌ Invalid parameter --artifactUrl %s. Must start with 'https://github.com/'" % artifactUrl) - exit(1) -if "/artifacts/" not in artifactUrl: - print("❌ Invalid parameter --artifactUrl %s. Must contain '/artifacts/'" % artifactUrl) - exit(1) -artifactItems = artifactUrl.split("/") -if len(artifactItems) != 9: - print("❌ Invalid parameter --artifactUrl %s. Please check the format." % (artifactUrl)) + +url_regex = r"https://github.com/(.+?)/(.+?)/actions/runs/.+?/artifacts/(.+)" +result = re.search(url_regex, artifactUrl) + +if result is None: + print( + "❌ Invalid parameter --artifactUrl '%s'. Please check the format.\nIt should be something like: %s" % + (artifactUrl, 'https://github.com/element-hq/element-android/actions/runs/7460386865/artifacts/1156548729') + ) exit(1) -gitHubRepoOwner = artifactItems[3] -gitHubRepo = artifactItems[4] -artifactId = artifactItems[8] +(gitHubRepoOwner, gitHubRepo, artifactId) = result.groups() if args.verbose: print("gitHubRepoOwner: %s, gitHubRepo: %s, artifactId: %s" % (gitHubRepoOwner, gitHubRepo, artifactId)) From 122018dd7b37c478cc2c905debf5c9223ecf5d50 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Mon, 15 Jan 2024 10:55:42 +0100 Subject: [PATCH 2/2] fix typo --- fastlane/metadata/android/en-US/changelogs/40106100.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastlane/metadata/android/en-US/changelogs/40106100.txt b/fastlane/metadata/android/en-US/changelogs/40106100.txt index 778f0b40c5..f9df252025 100644 --- a/fastlane/metadata/android/en-US/changelogs/40106100.txt +++ b/fastlane/metadata/android/en-US/changelogs/40106100.txt @@ -1,2 +1,2 @@ -Main changes in this version: add Mobile Device Managament and functional members support. +Main changes in this version: add Mobile Device Management and functional members support. Full changelog: https://github.com/element-hq/element-android/releases