llvmbot wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-github-workflow

Author: None (llvmbot)

<details>
<summary>Changes</summary>

Backport e8b7183d866f9d51511d5570f5f1f632046ef983

Requested by: @<!-- -->DavidSpickett

---
Full diff: https://github.com/llvm/llvm-project/pull/151129.diff


2 Files Affected:

- (modified) .github/workflows/release-tasks.yml (+28) 
- (modified) llvm/utils/release/github-upload-release.py (+55-7) 


``````````diff
diff --git a/.github/workflows/release-tasks.yml 
b/.github/workflows/release-tasks.yml
index d55098345d89e..c9ae7e1ce97c3 100644
--- a/.github/workflows/release-tasks.yml
+++ b/.github/workflows/release-tasks.yml
@@ -111,3 +111,31 @@ jobs:
     # Called workflows don't have access to secrets by default, so we need to 
explicitly pass secrets that we use.
     secrets:
       RELEASE_TASKS_USER_TOKEN: ${{ secrets.RELEASE_TASKS_USER_TOKEN }}
+
+  uncomment-download-links:
+    name: Uncomment download links
+    runs-on: ubuntu-24.04
+    permissions:
+      contents: write # For updating the release message.
+    needs:
+      - validate-tag
+      - release-create
+      - release-binaries
+
+    steps:
+      - name: Install Dependencies
+        run: |
+          sudo apt-get update
+          sudo apt-get install python3-github
+
+      - name: Checkout LLVM
+        uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # 
v4.1.1
+        with:
+          sparse-checkout: llvm/utils/release/github-upload-release.py
+          sparse-checkout-cone-mode: false
+
+      - name: Uncomment Download Links
+        env:
+          GITHUB_TOKEN: ${{ github.token }}
+        run: |
+          ./llvm/utils/release/./github-upload-release.py --token 
"$GITHUB_TOKEN" --release ${{ needs.validate-tag.outputs.release-version }} 
uncomment_download_links
diff --git a/llvm/utils/release/github-upload-release.py 
b/llvm/utils/release/github-upload-release.py
index 90c222d1175c7..5ed037ee9522a 100755
--- a/llvm/utils/release/github-upload-release.py
+++ b/llvm/utils/release/github-upload-release.py
@@ -45,19 +45,39 @@ 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.
         message = dedent(
             """\
-LLVM {release} Release
+## LLVM {release} Release
 
-## Package Types
+<!-- 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))
 -->
 
-Each platform has one binary release package. The file name starts with either 
`LLVM-` or `clang+llvm-` and ends with the platform's name. For example, 
`LLVM-{release}-Linux-ARM64.tar.xz` contains LLVM binaries for Arm64 Linux.
+<!-- 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}/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}/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))
 -->
 
-Except for Windows. Where `LLVM-*.exe` is an installer intended for using LLVM 
as a toolchain and `clang+llvm-` contains the contents of the installer, plus 
libraries and tools not normally used in a toolchain. You most likely want the 
`LLVM-` installer, unless you are developing software which itself uses LLVM, 
in which case choose `clang+llvm-`.
+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.
+
+## Package Types
 
-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.
+Each platform has one binary release package. The file name starts with either 
`LLVM-` or `clang+llvm-` and ends with the platform's name. For example, 
`LLVM-{release}-Linux-ARM64.tar.xz` contains LLVM binaries for Arm64 Linux.
 
-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.
+Except for Windows. Where `LLVM-*.exe` is an installer intended for using LLVM 
as a toolchain and the archive `clang+llvm-` contains the contents of the 
installer, plus libraries and tools not normally used in a toolchain. You most 
likely want the `LLVM-` installer, unless you are developing software which 
itself uses LLVM, in which case choose `clang+llvm-`.
 
 In addition, source archives are available:
 * `<sub-project>-{release}.src.tar.xz` are archives of the sources of specific 
sub-projects of `llvm-project` (except for `test-suite` which is an archive of 
the [LLVM Test Suite](https://github.com/llvm/llvm-test-suite)).
@@ -95,9 +115,35 @@ def upload_files(repo, release, files):
         print("Done")
 
 
+def uncomment_download_links(repo, release):
+    release = repo.get_release("llvmorg-{}".format(release))
+
+    new_message = []
+    to_remove = [
+        "AUTOMATIC_DOWNLOAD_LINKS_BEGIN",
+        "AUTOMATIC_DOWNLOAD_LINKS_END",
+        "AUTOMATIC_DOWNLOAD_LINKS_PLACEHOLDER",
+    ]
+    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,
+    )
+
+
 parser = argparse.ArgumentParser()
 parser.add_argument(
-    "command", type=str, choices=["create", "upload", "check-permissions"]
+    "command",
+    type=str,
+    choices=["create", "upload", "check-permissions", 
"uncomment_download_links"],
 )
 
 # All args
@@ -137,3 +183,5 @@ def upload_files(repo, release, files):
     create_release(llvm_repo, args.release)
 if args.command == "upload":
     upload_files(llvm_repo, args.release, args.files)
+if args.command == "uncomment_download_links":
+    uncomment_download_links(llvm_repo, args.release)

``````````

</details>


https://github.com/llvm/llvm-project/pull/151129
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to