[llvm] [llvm][release] Reveal download links based on uploaded assets (PR #167688)

David Spickett via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 20 06:04:21 PST 2025


https://github.com/DavidSpickett updated https://github.com/llvm/llvm-project/pull/167688

>From 28cdf1f727e71cfda34b9625ffad71e8fdf04df6 Mon Sep 17 00:00:00 2001
From: David Spickett <david.spickett at linaro.org>
Date: Tue, 11 Nov 2025 15:19:31 +0000
Subject: [PATCH 01/10] [llvm][release] Reveal download links based on uploaded
 assets

For the 21.x release, download links were supposed to be revealed
once all the release builds had completed. In reality, MacOS never
had a succesfull build so I had to hand edit the release messages.

This PR fixes this by focusing instead on what is in the release
assets.

1. Links are now built from a format string, with the linked files
   being format arguments for that string. This is a balance
   between ease of editing the format, and having the file names
   for use later.

   (I tried regex-ing file names out of the final links, which
   can work but is error prone and will be hard to debug in
   production)

2. uncomment_download_links now looks at the release assets to
   decide whether to reveal a given link line. If all the files that
   line links to are present, it can be revealed.

   This means we can still run this at the end of release-tasks.yml,
   where it will be atomic.

   Intially I was going to accumulate the statuses from the release
   build matrix job, but this does not seem to be possible
   (https://github.com/orgs/community/discussions/17245).

   Workarounds for this often include uploading artefacts from each
   job, which is for us, the same as checking the release's assets.

This process is done for all assets we would like to link to, not
just the ones currently built in GitHub.

So if some become automatically built, they will "just work". If
we want to hand edit the links in, that's still an option because
the full links are in the release message, but hidden from view.

As we are looking for "<!-- SOME_TAG", the script can be run multiple
times on the same release and it will not try to edit anything already
revealed.

As it's possible no link lines have all their files, the text
immediately after the links has been updated to make sense
when there are no links.
---
 llvm/utils/release/github-upload-release.py | 185 +++++++++++++++-----
 1 file changed, 142 insertions(+), 43 deletions(-)

diff --git a/llvm/utils/release/github-upload-release.py b/llvm/utils/release/github-upload-release.py
index d58bb544e17dd..9dac8c6440fec 100755
--- a/llvm/utils/release/github-upload-release.py
+++ b/llvm/utils/release/github-upload-release.py
@@ -34,6 +34,103 @@
 from textwrap import dedent
 
 
+# This is a tuple of sections of download links. Each section then contains
+# an entry for each line in that section. Each line entry contains:
+# * A unique tag to go in "<!-- <tag>" so we can find it later in the release
+#   message.
+# * A format string for the line's content.
+# * Filenames to substitute into the format string. Before substitution into
+#   the format string, file names will have the base download URL prepended to
+#   them and 'release' replaced with the release version.
+#
+# Between each set of links, an empty line will be added.
+#
+# This data is used to generate the links for the release message, and by
+# uncomment_download_links to verify whether for any given link line, all files
+# linked to are present in the release's assets.
+release_links = (
+    (
+        (
+            "LINUX_X86",
+            "* [Linux x86_64]({0}) ([signature]({1}))",
+            "LLVM-{release}-Linux-X64.tar.xz",
+            "LLVM-{release}-Linux-X64.tar.xz.jsonl",
+        ),
+        (
+            "LINUX_ARM64",
+            "* [Linux Arm64]({0}) ([signature]({1}))",
+            "LLVM-{release}-Linux-ARM64.tar.xz",
+            "LLVM-{release}-Linux-ARM64.tar.xz.jsonl",
+        ),
+        (
+            "LINUX_ARMV7A",
+            "* [Linux Armv7-a]({0}) ([signature]({1}))",
+            "clang+llvm-{release}-armv7a-linux-gnueabihf.tar.gz",
+            "clang+llvm-{release}-armv7a-linux-gnueabihf.tar.gz.sig",
+        ),
+    ),
+    (
+        (
+            "MACOS_ARM64",
+            "* [macOS Apple Silicon]({0}) (ARM64) ([signature]({1}))",
+            "LLVM-{release}-macOS-ARM64.tar.xz",
+            "LLVM-{release}-macOS-ARM64.tar.xz.jsonl",
+        ),
+        (
+            "MACOS_X86",
+            "* [macOS Intel]({0}) (x86-64) ([signature]({1})])",
+            "LLVM-{release}-macOS-X64.tar.xz",
+            "LLVM-{release}-macOS-X64.tar.xz.jsonl",
+        ),
+    ),
+    (
+        (
+            "WINDOWS_X64",
+            "* Windows x64 (64-bit): [installer]({0}) ([signature]({1})), [archive]({2}) ([signature]({3}))",
+            "LLVM-{release}-win64.exe",
+            "LLVM-{release}-win64.exe.sig",
+            "clang+llvm-{release}-x86_64-pc-windows-msvc.tar.xz",
+            "clang+llvm-{release}-x86_64-pc-windows-msvc.tar.xz.sig",
+        ),
+        (
+            "WINDOWS_X86",
+            "* Windows x86 (32-bit): [installer]({0}) ([signature]({1}))",
+            "LLVM-{release}-win32.exe",
+            "LLVM-{release}-win32.exe.sig",
+        ),
+        (
+            "WINDOWS_ARM64",
+            "* Windows on Arm (ARM64): [installer]({0}) ([signature]({1})), [archive]({2}) ([signature]({3}))",
+            "LLVM-{release}-woa64.exe",
+            "LLVM-{release}-woa64.exe.sig",
+            "clang+llvm-{release}-aarch64-pc-windows-msvc.tar.xz",
+            "clang+llvm-{release}-aarch64-pc-windows-msvc.tar.xz.sig",
+        ),
+    ),
+)
+
+
+def generate_download_links(release):
+    base_url = (
+        f"https://github.com/llvm/llvm-project/releases/download/llvmorg-{release}/"
+    )
+    markdown_lines = []
+
+    for section in release_links:
+        for line in section:
+            comment_tag, format_string, *files = line
+            markdown_line = f"<!-- {comment_tag} "
+            files = [base_url + f.format(release=release) for f in files]
+            markdown_line += format_string.format(*files)
+            markdown_line += " -->"
+            markdown_lines.append(markdown_line)
+
+        # Blank line between each section.
+        markdown_lines.append("")
+
+    return "\n".join(markdown_lines)
+
+
 def create_release(repo, release, tag=None, name=None, message=None):
     if not tag:
         tag = "llvmorg-{}".format(release)
@@ -45,33 +142,15 @@ def create_release(repo, release, tag=None, name=None, message=None):
         # Note that these lines are not length limited because if we do so, GitHub
         # assumes that should be how it is laid out on the page. We want GitHub to
         # do the reflowing for us instead.
-        #
-        # Once all the atuomatic binary builds have completed, the HTML comments
-        # with UPPERCASE markers in them will be removed to reveal the download
-        # links later. Other lines are surrounded in <!-- --> for release uploaders
-        # to manually uncomment when they upload that package.
+        download_links = generate_download_links(release)
         message = dedent(
-            """\
+            f"""\
 ## LLVM {release} Release
 
-<!-- AUTOMATIC_DOWNLOAD_LINKS_BEGIN
-* [Linux x86_64](https://github.com/llvm/llvm-project/releases/download/llvmorg-{release}/LLVM-{release}-Linux-X64.tar.xz) ([signature](https://github.com/llvm/llvm-project/releases/download/llvmorg-{release}/LLVM-{release}-Linux-X64.tar.xz.jsonl))
-* [Linux Arm64](https://github.com/llvm/llvm-project/releases/download/llvmorg-{release}/LLVM-{release}-Linux-ARM64.tar.xz) ([signature](https://github.com/llvm/llvm-project/releases/download/llvmorg-{release}/LLVM-{release}-Linux-ARM64.tar.xz.jsonl))
-AUTOMATIC_DOWNLOAD_LINKS_END -->
-<!-- * [Linux Armv7-a](https://github.com/llvm/llvm-project/releases/download/llvmorg-{release}/clang+llvm-{release}-armv7a-linux-gnueabihf.tar.gz) ([signature](https://github.com/llvm/llvm-project/releases/download/llvmorg-{release}/clang+llvm-{release}-armv7a-linux-gnueabihf.tar.gz.sig)) -->
-
-<!-- AUTOMATIC_DOWNLOAD_LINKS_BEGIN
-* [macOS Apple Silicon](https://github.com/llvm/llvm-project/releases/download/llvmorg-{release}/LLVM-{release}-macOS-ARM64.tar.xz) (ARM64) ([signature](https://github.com/llvm/llvm-project/releases/download/llvmorg-{release}/LLVM-{release}-macOS-ARM64.tar.xz.jsonl))
-* [macOS Intel](https://github.com/llvm/llvm-project/releases/download/llvmorg-{release}/LLVM-{release}-macOS-X64.tar.xz) (x86-64) ([signature](https://github.com/llvm/llvm-project/releases/download/llvmorg-{release}/LLVM-{release}-macOS-X64.tar.xz.jsonl))
-AUTOMATIC_DOWNLOAD_LINKS_END -->
-
-<!-- * Windows x64 (64-bit): [installer](https://github.com/llvm/llvm-project/releases/download/llvmorg-{release}/LLVM-{release}-win64.exe) ([signature](https://github.com/llvm/llvm-project/releases/download/llvmorg-{release}/LLVM-{release}-win64.exe.sig)), [archive](https://github.com/llvm/llvm-project/releases/download/llvmorg-{release}/clang+llvm-{release}-x86_64-pc-windows-msvc.tar.xz) ([signature](https://github.com/llvm/llvm-project/releases/download/llvmorg-{release}/clang+llvm-{release}-x86_64-pc-windows-msvc.tar.xz.sig)) -->
-<!-- * Windows x86 (32-bit): [installer](https://github.com/llvm/llvm-project/releases/download/llvmorg-{release}/LLVM-{release}-win32.exe) ([signature](https://github.com/llvm/llvm-project/releases/download/llvmorg-{release}/LLVM-{release}-win32.exe.sig)) -->
-<!-- * Windows on Arm (ARM64): [installer](https://github.com/llvm/llvm-project/releases/download/llvmorg-{release}/LLVM-{release}-woa64.exe) ([signature](https://github.com/llvm/llvm-project/releases/download/llvmorg-{release}/LLVM-{release}-woa64.exe.sig)), [archive](https://github.com/llvm/llvm-project/releases/download/llvmorg-{release}/clang+llvm-{release}-aarch64-pc-windows-msvc.tar.xz) ([signature](https://github.com/llvm/llvm-project/releases/download/llvmorg-{release}/clang+llvm-{release}-aarch64-pc-windows-msvc.tar.xz.sig)) -->
+{download_links}
+Download links for common platforms will appear above, if they are available. Check the full list of release packages at the bottom of this release page if you do not find a link above.
 
-Download links will appear here once builds have completed. <!-- AUTOMATIC_DOWNLOAD_LINKS_PLACEHOLDER -->
-
-For any other variants of platform and architecture, check the full list of release packages at the bottom of this release page. If you do not find a release package for your platform, you may be able to find a community built package on the LLVM Discourse forum thread for this release. Remember that these are built by volunteers and may not always be available. If you rely on a platform or configuration that is not one of the defaults, we suggest you use the binaries that your platform provides, or build your own release packages.
+If you do not find a release package for your platform, you may be able to find a community built package on the LLVM Discourse forum thread for this release. Remember that these are built by volunteers and may not always be available. If you rely on a platform or configuration that is not one of the defaults, we suggest you use the binaries that your platform provides, or build your own release packages.
 
 ## Package Types
 
@@ -100,7 +179,7 @@ def create_release(repo, release, tag=None, name=None, message=None):
 $ gh attestation verify --repo llvm/llvm-project <package file name> --bundle <package file name>.jsonl
 (using attestation file on disk)
 ```"""
-        ).format(release=release)
+        )
 
     prerelease = True if "rc" in release else False
 
@@ -115,28 +194,48 @@ def upload_files(repo, release, files):
         print("Done")
 
 
-def uncomment_download_links(repo, release):
-    release = repo.get_release("llvmorg-{}".format(release))
+def uncomment_download_links(repo, release_version):
+    release = repo.get_release("llvmorg-{}".format(release_version))
+
+    # At this point any automatic builds have finished and if
+    # they succeeded, uploaded files to the release assets.
+    release_assets = set([a.name for a in release.assets])
+    print("Found release assets: ", release_assets)
 
     new_message = []
-    to_remove = [
-        "AUTOMATIC_DOWNLOAD_LINKS_BEGIN",
-        "AUTOMATIC_DOWNLOAD_LINKS_END",
-        "AUTOMATIC_DOWNLOAD_LINKS_PLACEHOLDER",
-    ]
+    modified = False
     for line in release.body.splitlines():
-        for comment in to_remove:
-            if comment in line:
-                break
-        else:
-            new_message.append(line)
-
-    release.update_release(
-        name=release.title,
-        message="\n".join(new_message),
-        draft=release.draft,
-        prerelease=release.prerelease,
-    )
+        # All hidden download links are of the form:
+        # <!-- <some unique tag> <markdown content> -->
+        if line.startswith("<!--"):
+            for section in release_links:
+                for comment_tag, _, *files in section:
+                    if comment_tag in line:
+                        print(f'Found link line "{comment_tag}":')
+                        files = set([f.format(release=release_version) for f in files])
+                        print("  Files required:", files)
+                        if files.issubset(release_assets):
+                            print("  All files present, revealing link line.")
+                            line.replace("<!--", "").replace(comment_tag, "").replace(
+                                "-->", ""
+                            ).strip()
+                            modified = True
+                        else:
+                            print(
+                                "  These files are not present:",
+                                files.difference(release_assets),
+                            )
+                            print("  Link line will remain hidden.")
+
+        new_message.append(line)
+
+    if modified:
+        release.update_release(
+            name=release.title,
+            message="\n".join(new_message),
+            draft=release.draft,
+            prerelease=release.prerelease,
+        )
 
 
 parser = argparse.ArgumentParser()

>From 8e9c7992da33d181d9562d87e3e7c6319fee93eb Mon Sep 17 00:00:00 2001
From: David Spickett <david.spickett at linaro.org>
Date: Thu, 13 Nov 2025 09:31:45 +0000
Subject: [PATCH 02/10] fix macos intel link syntax

---
 llvm/utils/release/github-upload-release.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/utils/release/github-upload-release.py b/llvm/utils/release/github-upload-release.py
index 9dac8c6440fec..958eba094dbde 100755
--- a/llvm/utils/release/github-upload-release.py
+++ b/llvm/utils/release/github-upload-release.py
@@ -78,7 +78,7 @@
         ),
         (
             "MACOS_X86",
-            "* [macOS Intel]({0}) (x86-64) ([signature]({1})])",
+            "* [macOS Intel]({0}) (x86-64) ([signature]({1}))",
             "LLVM-{release}-macOS-X64.tar.xz",
             "LLVM-{release}-macOS-X64.tar.xz.jsonl",
         ),

>From dd711a9c30d68cb10411286e7aa0e49e32a59ba1 Mon Sep 17 00:00:00 2001
From: David Spickett <david.spickett at linaro.org>
Date: Wed, 19 Nov 2025 10:06:37 +0000
Subject: [PATCH 03/10] Must run even if part of release-binaries fails

---
 .github/workflows/release-tasks.yml | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/.github/workflows/release-tasks.yml b/.github/workflows/release-tasks.yml
index d4c2a55fcc9d7..df6b04803bbf5 100644
--- a/.github/workflows/release-tasks.yml
+++ b/.github/workflows/release-tasks.yml
@@ -120,9 +120,8 @@ jobs:
     runs-on: ubuntu-24.04
     permissions:
       contents: write # For updating the release message.
+    if: always()
     needs:
-      - validate-tag
-      - release-create
       - release-binaries
 
     steps:

>From 47eca391fff3546713b7da919cf906b298b1862a Mon Sep 17 00:00:00 2001
From: David Spickett <david.spickett at linaro.org>
Date: Wed, 19 Nov 2025 10:08:38 +0000
Subject: [PATCH 04/10] On second thought, always run but not if someone
 cancelled the pipeline.

---
 .github/workflows/release-tasks.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/release-tasks.yml b/.github/workflows/release-tasks.yml
index df6b04803bbf5..0ce3fe903e627 100644
--- a/.github/workflows/release-tasks.yml
+++ b/.github/workflows/release-tasks.yml
@@ -120,7 +120,7 @@ jobs:
     runs-on: ubuntu-24.04
     permissions:
       contents: write # For updating the release message.
-    if: always()
+    if: '!cancelled()'
     needs:
       - release-binaries
 

>From 83a4c5c00a85a1c4818e7ed99fd15b23a25a4a68 Mon Sep 17 00:00:00 2001
From: David Spickett <david.spickett at linaro.org>
Date: Thu, 20 Nov 2025 13:44:13 +0000
Subject: [PATCH 05/10] use f string

---
 llvm/utils/release/github-upload-release.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/utils/release/github-upload-release.py b/llvm/utils/release/github-upload-release.py
index 958eba094dbde..0d0fe90fbb620 100755
--- a/llvm/utils/release/github-upload-release.py
+++ b/llvm/utils/release/github-upload-release.py
@@ -195,7 +195,7 @@ def upload_files(repo, release, files):
 
 
 def uncomment_download_links(repo, release_version):
-    release = repo.get_release("llvmorg-{}".format(release_version))
+    release = repo.get_release(f"llvmorg-{release_version}")
 
     # At this point any automatic builds have finished and if
     # they succeeded, uploaded files to the release assets.

>From 2e738a717295cabda9e55f656914480fd3df5336 Mon Sep 17 00:00:00 2001
From: David Spickett <david.spickett at linaro.org>
Date: Thu, 20 Nov 2025 13:47:21 +0000
Subject: [PATCH 06/10] early continue to reduce indentation

---
 llvm/utils/release/github-upload-release.py | 43 ++++++++++++---------
 1 file changed, 24 insertions(+), 19 deletions(-)

diff --git a/llvm/utils/release/github-upload-release.py b/llvm/utils/release/github-upload-release.py
index 0d0fe90fbb620..b34b94010119f 100755
--- a/llvm/utils/release/github-upload-release.py
+++ b/llvm/utils/release/github-upload-release.py
@@ -207,25 +207,30 @@ def uncomment_download_links(repo, release_version):
     for line in release.body.splitlines():
         # All hidden download links are of the form:
         # <!-- <some unique tag> <markdown content> -->
-        if line.startswith("<!--"):
-            for section in release_links:
-                for comment_tag, _, *files in section:
-                    if comment_tag in line:
-                        print(f'Found link line "{comment_tag}":')
-                        files = set([f.format(release=release_version) for f in files])
-                        print("  Files required:", files)
-                        if files.issubset(release_assets):
-                            print("  All files present, revealing link line.")
-                            line.replace("<!--", "").replace(comment_tag, "").replace(
-                                "-->", ""
-                            ).strip()
-                            modified = True
-                        else:
-                            print(
-                                "  These files are not present:",
-                                files.difference(release_assets),
-                            )
-                            print("  Link line will remain hidden.")
+        if not line.startswith("<!--"):
+            new_message.append(line)
+            continue
+
+        for section in release_links:
+            for comment_tag, _, *files in section:
+                if not comment_tag in line:
+                    continue
+
+                print(f'Found link line "{comment_tag}":')
+                files = set([f.format(release=release_version) for f in files])
+                print("  Files required:", files)
+                if files.issubset(release_assets):
+                    print("  All files present, revealing link line.")
+                    line.replace("<!--", "").replace(comment_tag, "").replace(
+                        "-->", ""
+                    ).strip()
+                    modified = True
+                else:
+                    print(
+                        "  These files are not present:",
+                        files.difference(release_assets),
+                    )
+                    print("  Link line will remain hidden.")
 
         new_message.append(line)
 

>From 4b9ee14074acad88f6c3f1b4507048026636d9f0 Mon Sep 17 00:00:00 2001
From: David Spickett <david.spickett at linaro.org>
Date: Thu, 20 Nov 2025 13:48:33 +0000
Subject: [PATCH 07/10] revise message

---
 llvm/utils/release/github-upload-release.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/utils/release/github-upload-release.py b/llvm/utils/release/github-upload-release.py
index b34b94010119f..6bc622b793e1c 100755
--- a/llvm/utils/release/github-upload-release.py
+++ b/llvm/utils/release/github-upload-release.py
@@ -148,7 +148,7 @@ def create_release(repo, release, tag=None, name=None, message=None):
 ## LLVM {release} Release
 
 {download_links}
-Download links for common platforms will appear above, if they are available. Check the full list of release packages at the bottom of this release page if you do not find a link above.
+Download links for common platforms will appear above once builds have completed, if they are available. Check the full list of release packages at the bottom of this release page if you do not find a link above.
 
 If you do not find a release package for your platform, you may be able to find a community built package on the LLVM Discourse forum thread for this release. Remember that these are built by volunteers and may not always be available. If you rely on a platform or configuration that is not one of the defaults, we suggest you use the binaries that your platform provides, or build your own release packages.
 

>From 51f3bf8cc2a6fa79594e94267fccb12d04112bc5 Mon Sep 17 00:00:00 2001
From: David Spickett <david.spickett at linaro.org>
Date: Thu, 20 Nov 2025 13:56:41 +0000
Subject: [PATCH 08/10] fix

---
 llvm/utils/release/github-upload-release.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/utils/release/github-upload-release.py b/llvm/utils/release/github-upload-release.py
index 6bc622b793e1c..8d50252571b0d 100755
--- a/llvm/utils/release/github-upload-release.py
+++ b/llvm/utils/release/github-upload-release.py
@@ -221,7 +221,7 @@ def uncomment_download_links(repo, release_version):
                 print("  Files required:", files)
                 if files.issubset(release_assets):
                     print("  All files present, revealing link line.")
-                    line.replace("<!--", "").replace(comment_tag, "").replace(
+                    line = line.replace("<!--", "").replace(comment_tag, "").replace(
                         "-->", ""
                     ).strip()
                     modified = True

>From 7d57b8a48822788fe1fd3225d01dd4740e467270 Mon Sep 17 00:00:00 2001
From: David Spickett <david.spickett at linaro.org>
Date: Thu, 20 Nov 2025 14:00:06 +0000
Subject: [PATCH 09/10] files as a list

---
 llvm/utils/release/github-upload-release.py | 38 ++++++++++-----------
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/llvm/utils/release/github-upload-release.py b/llvm/utils/release/github-upload-release.py
index 8d50252571b0d..0bdba37cbce45 100755
--- a/llvm/utils/release/github-upload-release.py
+++ b/llvm/utils/release/github-upload-release.py
@@ -39,7 +39,7 @@
 # * A unique tag to go in "<!-- <tag>" so we can find it later in the release
 #   message.
 # * A format string for the line's content.
-# * Filenames to substitute into the format string. Before substitution into
+# * A list of filenames to substitute into the format string. Before substitution into
 #   the format string, file names will have the base download URL prepended to
 #   them and 'release' replaced with the release version.
 #
@@ -53,58 +53,58 @@
         (
             "LINUX_X86",
             "* [Linux x86_64]({0}) ([signature]({1}))",
-            "LLVM-{release}-Linux-X64.tar.xz",
-            "LLVM-{release}-Linux-X64.tar.xz.jsonl",
+            ["LLVM-{release}-Linux-X64.tar.xz",
+            "LLVM-{release}-Linux-X64.tar.xz.jsonl"],
         ),
         (
             "LINUX_ARM64",
             "* [Linux Arm64]({0}) ([signature]({1}))",
-            "LLVM-{release}-Linux-ARM64.tar.xz",
-            "LLVM-{release}-Linux-ARM64.tar.xz.jsonl",
+            ["LLVM-{release}-Linux-ARM64.tar.xz",
+            "LLVM-{release}-Linux-ARM64.tar.xz.jsonl"],
         ),
         (
             "LINUX_ARMV7A",
             "* [Linux Armv7-a]({0}) ([signature]({1}))",
-            "clang+llvm-{release}-armv7a-linux-gnueabihf.tar.gz",
-            "clang+llvm-{release}-armv7a-linux-gnueabihf.tar.gz.sig",
+            ["clang+llvm-{release}-armv7a-linux-gnueabihf.tar.gz",
+            "clang+llvm-{release}-armv7a-linux-gnueabihf.tar.gz.sig"],
         ),
     ),
     (
         (
             "MACOS_ARM64",
             "* [macOS Apple Silicon]({0}) (ARM64) ([signature]({1}))",
-            "LLVM-{release}-macOS-ARM64.tar.xz",
-            "LLVM-{release}-macOS-ARM64.tar.xz.jsonl",
+            ["LLVM-{release}-macOS-ARM64.tar.xz",
+            "LLVM-{release}-macOS-ARM64.tar.xz.jsonl"],
         ),
         (
             "MACOS_X86",
             "* [macOS Intel]({0}) (x86-64) ([signature]({1}))",
-            "LLVM-{release}-macOS-X64.tar.xz",
-            "LLVM-{release}-macOS-X64.tar.xz.jsonl",
+            ["LLVM-{release}-macOS-X64.tar.xz",
+            "LLVM-{release}-macOS-X64.tar.xz.jsonl"],
         ),
     ),
     (
         (
             "WINDOWS_X64",
             "* Windows x64 (64-bit): [installer]({0}) ([signature]({1})), [archive]({2}) ([signature]({3}))",
-            "LLVM-{release}-win64.exe",
+            ["LLVM-{release}-win64.exe",
             "LLVM-{release}-win64.exe.sig",
             "clang+llvm-{release}-x86_64-pc-windows-msvc.tar.xz",
-            "clang+llvm-{release}-x86_64-pc-windows-msvc.tar.xz.sig",
+            "clang+llvm-{release}-x86_64-pc-windows-msvc.tar.xz.sig"],
         ),
         (
             "WINDOWS_X86",
             "* Windows x86 (32-bit): [installer]({0}) ([signature]({1}))",
-            "LLVM-{release}-win32.exe",
-            "LLVM-{release}-win32.exe.sig",
+            ["LLVM-{release}-win32.exe",
+            "LLVM-{release}-win32.exe.sig"],
         ),
         (
             "WINDOWS_ARM64",
             "* Windows on Arm (ARM64): [installer]({0}) ([signature]({1})), [archive]({2}) ([signature]({3}))",
-            "LLVM-{release}-woa64.exe",
+            ["LLVM-{release}-woa64.exe",
             "LLVM-{release}-woa64.exe.sig",
             "clang+llvm-{release}-aarch64-pc-windows-msvc.tar.xz",
-            "clang+llvm-{release}-aarch64-pc-windows-msvc.tar.xz.sig",
+            "clang+llvm-{release}-aarch64-pc-windows-msvc.tar.xz.sig"],
         ),
     ),
 )
@@ -118,7 +118,7 @@ def generate_download_links(release):
 
     for section in release_links:
         for line in section:
-            comment_tag, format_string, *files = line
+            comment_tag, format_string, files = line
             markdown_line = f"<!-- {comment_tag} "
             files = [base_url + f.format(release=release) for f in files]
             markdown_line += format_string.format(*files)
@@ -212,7 +212,7 @@ def uncomment_download_links(repo, release_version):
             continue
 
         for section in release_links:
-            for comment_tag, _, *files in section:
+            for comment_tag, _, files in section:
                 if not comment_tag in line:
                     continue
 

>From bd09d556389264a11d4a340ce7907a10cdad7df4 Mon Sep 17 00:00:00 2001
From: David Spickett <david.spickett at linaro.org>
Date: Thu, 20 Nov 2025 14:03:58 +0000
Subject: [PATCH 10/10] format

---
 llvm/utils/release/github-upload-release.py | 62 +++++++++++++--------
 1 file changed, 39 insertions(+), 23 deletions(-)

diff --git a/llvm/utils/release/github-upload-release.py b/llvm/utils/release/github-upload-release.py
index 0bdba37cbce45..3c0f806b7de67 100755
--- a/llvm/utils/release/github-upload-release.py
+++ b/llvm/utils/release/github-upload-release.py
@@ -53,58 +53,71 @@
         (
             "LINUX_X86",
             "* [Linux x86_64]({0}) ([signature]({1}))",
-            ["LLVM-{release}-Linux-X64.tar.xz",
-            "LLVM-{release}-Linux-X64.tar.xz.jsonl"],
+            [
+                "LLVM-{release}-Linux-X64.tar.xz",
+                "LLVM-{release}-Linux-X64.tar.xz.jsonl",
+            ],
         ),
         (
             "LINUX_ARM64",
             "* [Linux Arm64]({0}) ([signature]({1}))",
-            ["LLVM-{release}-Linux-ARM64.tar.xz",
-            "LLVM-{release}-Linux-ARM64.tar.xz.jsonl"],
+            [
+                "LLVM-{release}-Linux-ARM64.tar.xz",
+                "LLVM-{release}-Linux-ARM64.tar.xz.jsonl",
+            ],
         ),
         (
             "LINUX_ARMV7A",
             "* [Linux Armv7-a]({0}) ([signature]({1}))",
-            ["clang+llvm-{release}-armv7a-linux-gnueabihf.tar.gz",
-            "clang+llvm-{release}-armv7a-linux-gnueabihf.tar.gz.sig"],
+            [
+                "clang+llvm-{release}-armv7a-linux-gnueabihf.tar.gz",
+                "clang+llvm-{release}-armv7a-linux-gnueabihf.tar.gz.sig",
+            ],
         ),
     ),
     (
         (
             "MACOS_ARM64",
             "* [macOS Apple Silicon]({0}) (ARM64) ([signature]({1}))",
-            ["LLVM-{release}-macOS-ARM64.tar.xz",
-            "LLVM-{release}-macOS-ARM64.tar.xz.jsonl"],
+            [
+                "LLVM-{release}-macOS-ARM64.tar.xz",
+                "LLVM-{release}-macOS-ARM64.tar.xz.jsonl",
+            ],
         ),
         (
             "MACOS_X86",
             "* [macOS Intel]({0}) (x86-64) ([signature]({1}))",
-            ["LLVM-{release}-macOS-X64.tar.xz",
-            "LLVM-{release}-macOS-X64.tar.xz.jsonl"],
+            [
+                "LLVM-{release}-macOS-X64.tar.xz",
+                "LLVM-{release}-macOS-X64.tar.xz.jsonl",
+            ],
         ),
     ),
     (
         (
             "WINDOWS_X64",
             "* Windows x64 (64-bit): [installer]({0}) ([signature]({1})), [archive]({2}) ([signature]({3}))",
-            ["LLVM-{release}-win64.exe",
-            "LLVM-{release}-win64.exe.sig",
-            "clang+llvm-{release}-x86_64-pc-windows-msvc.tar.xz",
-            "clang+llvm-{release}-x86_64-pc-windows-msvc.tar.xz.sig"],
+            [
+                "LLVM-{release}-win64.exe",
+                "LLVM-{release}-win64.exe.sig",
+                "clang+llvm-{release}-x86_64-pc-windows-msvc.tar.xz",
+                "clang+llvm-{release}-x86_64-pc-windows-msvc.tar.xz.sig",
+            ],
         ),
         (
             "WINDOWS_X86",
             "* Windows x86 (32-bit): [installer]({0}) ([signature]({1}))",
-            ["LLVM-{release}-win32.exe",
-            "LLVM-{release}-win32.exe.sig"],
+            ["LLVM-{release}-win32.exe", "LLVM-{release}-win32.exe.sig"],
         ),
         (
             "WINDOWS_ARM64",
             "* Windows on Arm (ARM64): [installer]({0}) ([signature]({1})), [archive]({2}) ([signature]({3}))",
-            ["LLVM-{release}-woa64.exe",
-            "LLVM-{release}-woa64.exe.sig",
-            "clang+llvm-{release}-aarch64-pc-windows-msvc.tar.xz",
-            "clang+llvm-{release}-aarch64-pc-windows-msvc.tar.xz.sig"],
+            [
+                "LLVM-{release}-woa64.exe",
+                "LLVM-{release}-woa64.exe.sig",
+                "clang+llvm-{release}-aarch64-pc-windows-msvc.tar.xz",
+                "clang+llvm-{release}-aarch64-pc-windows-msvc.tar.xz.sig",
+            ],
         ),
     ),
 )
@@ -221,9 +234,12 @@ def uncomment_download_links(repo, release_version):
                 print("  Files required:", files)
                 if files.issubset(release_assets):
                     print("  All files present, revealing link line.")
-                    line = line.replace("<!--", "").replace(comment_tag, "").replace(
-                        "-->", ""
-                    ).strip()
+                    line = (
+                        line.replace("<!--", "")
+                        .replace(comment_tag, "")
+                        .replace("-->", "")
+                        .strip()
+                    )
                     modified = True
                 else:
                     print(



More information about the llvm-commits mailing list