-
Notifications
You must be signed in to change notification settings - Fork 14.7k
[llvm][release] Add links to commonly used release packages #147719
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[llvm][release] Add links to commonly used release packages #147719
Conversation
Putting this up now for quicker feedback, have not managed to run this yet. |
@llvm/pr-subscribers-github-workflow Author: David Spickett (DavidSpickett) ChangesThis adds links to the release packages that are automatically built using GitHub, so that users of those platforms can find them more easily. The approach taken:
I considered generating this using a lot of templates, but considering the small number of links and how useful it is to see the layout in the Python file, I prefer writing it out. Full diff: https://github.com/llvm/llvm-project/pull/147719.diff 2 Files Affected:
diff --git a/.github/workflows/release-tasks.yml b/.github/workflows/release-tasks.yml
index d55098345d89e..98e3f48391fa6 100644
--- a/.github/workflows/release-tasks.yml
+++ b/.github/workflows/release-tasks.yml
@@ -111,3 +111,29 @@ 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
+
+ - name: Uncomment Download Links
+ env:
+ GITHUB_TOKEN: ${{ github.token }}
+ USER_TOKEN: ${{ secrets.RELEASE_TASKS_USER_TOKEN }}
+ run: |
+ ./llvm/utils/release/./github-upload-release.py --token "$GITHUB_TOKEN" --release ${{ needs.validate-tag.outputs.release-version }} --user ${{ github.actor }} --user-token "$USER_TOKEN" uncomment_download_links
diff --git a/llvm/utils/release/github-upload-release.py b/llvm/utils/release/github-upload-release.py
index e9591b00e2b5a..f73b9927c9da9 100755
--- a/llvm/utils/release/github-upload-release.py
+++ b/llvm/utils/release/github-upload-release.py
@@ -45,9 +45,26 @@ 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 binaries are built, the HTML comments in the text below will be
+ # used to swap the placeholder text with the now valid download links.
message = dedent(
"""\
-LLVM {release} Release
+## LLVM {release} Release
+
+<!-- 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))
+* [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))
+
+**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))
+* [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))
+DOWNLOAD_LINKS_END -->
+
+Download links for Linux and macOS will appear above once builds complete. <!-- DOWNLOAD_LINKS_PLACEHOLDER -->
+
+For Windows, and any other variants of platform and architecture, check the full list of release packages at the bottom of this release page.
## Package Types
@@ -95,6 +112,29 @@ 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 = [
+ "DOWNLOAD_LINKS_BEGIN",
+ "DOWNLOAD_LINKS_END",
+ "DOWNLOAD_LINKS_PLACEHOLDER",
+ ]
+ for line in release.message.splitlines():
+ for comment in to_remove:
+ if comment in line:
+ continue
+ new_message.append(line)
+
+ release.update_release(
+ name=release.name,
+ 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"]
@@ -137,3 +177,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.commands == "uncomment_download_links":
+ uncomment_download_links(llvm_repo, args.release)
|
This is like #147021 but the links are initially hidden and are revealed by a workflow step updating the release text. |
✅ With the latest revision this PR passed the Python code formatter. |
I've tested this on my fork and it works. I did manually run the workflow, so there's a small chance it has permissions issues in reality. The version of PyGitHub available in apt has some differences from the current one on GitHub so you'll notice some parameter names swapped like "name" and "title". They mean the same things. |
Here's the release I tested on - https://github.com/DavidSpickett/llvm-project/releases/tag/vX.Y.Z-1, so you can see how it renders (I did not create the release using the script, so it still has Removing the lines leaves more empty lines than you'd usually want but Markdown will normalise it them to 1 blank line anyway. So I didn't go to any effort to tidy that up. |
…page This adds links to the release packages that are automatically built using GitHub, so that users of those platforms can find them more easily. The approach taken: * "LLVM x.y.z Release" becomes the title for this links section. * No hand built files are linked to because we can't be sure when or if they will appear. It's better that users check the full file list if they need those. * This means no Windows links, but I've specifically mentioned Windows just below the links to mitigate this. * I have tried to use the vendor names for the architectures, that casual users would recognise. * Their signature file is linked as well. I expect most will ignore this but better to show it to remind people it exists. * I called it "signature" as a generic term to cover the .jsonl and .sig files, but we're not linking to any .sig files yet. * Links are initially commented out and there is a placeholder string. Once all binaries are built, the placeholder is removed and the download links revelealed (we wait for them all so we don't have many jobs racing to update the release text). I considered generating this using a lot of templates, but considering the small number of links and how useful it is to see the layout in the Python file, I prefer writing it out.
451e71b
to
58b89c8
Compare
ping! Would be cool to get this (or #147021 which is a more limited version) into 21.x if possible, but of course up to you whether the risk with that is acceptable. I thought that the release candidate stage would be a good time to try this out before the first proper release. |
|
||
Download links for Linux and macOS will appear here when all the builds have completed. <!-- DOWNLOAD_LINKS_PLACEHOLDER --> | ||
|
||
For Windows, and any other variants of platform and architecture, check the full list of release packages at the bottom of this release page. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was there a reason we couldn't make neat links for windows?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can make neat links but I was being conservative and only adding the things we build automatically. As we know that those links will always become valid, and we know when because there is a workflow handling that.
I can add links that release uploaders to manually reveal, and change this disclaimer text to just be "any other variants".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also I didn't want to give release uploaders more jobs without asking, but the worst that happens is the links remain hidden.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll add the links and you can see what you think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added links for the hand built packages, to be uncommented once they're uploaded.
I discovered that nesting HTML comments isn't a great idea, so I've changed the formatting to repeat the platform name on each line like "Linux x86", "Linux AArch64" etc. This means you can reveal just one line and it still makes sense.
I moved the pointer to the forum up higher, because I think people should know that earlier.
Removed the note about installers vs. archives for Windows because it was a pain to fit in, and the actual text it refers to is only a few lines below anyway. If people are still not finding it, we can improve that later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the comment below is the final links after all comments get removed. So this would be once automatic builds are done and all the release uploaders have done their bits. I've checked that it renders the same here in a comment as on the release page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LLVM {release} Release
-
macOS Apple Silicon (ARM64) (signature)
-
macOS Intel (x86-64) (signature)
-
Windows x64 (64-bit): installer (signature), archive (signature)
-
Windows on Arm (ARM64): installer (signature), archive (signature)
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.
In theory we could modify the release audit job to find any hidden links and see if their files have been uploaded yet. If you would like me to pursue that, I can, but I'll do it as an add on to this as there's already a lot here. |
ping! @tru |
LGTM thanks! |
/cherry-pick e8b7183 |
/pull-request #151129 |
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/18/builds/19710 Here is the relevant piece of the build log for the reference
|
) This adds download links to the GitHub release pages for common platforms. The automatically built packages' links are automatically revealed once the builds are complete. For packages built by hand, hidden links are included in the text for release uploaders to reveal later. The approach taken: * "LLVM x.y.z Release" becomes the title for this links section. * Automatically built packages are commented out with special markers so we can find them to uncomment them later. * There is placeholder text for the time between release creation and release tasks finishing. * Hand built packages have release links but these will need to be un-commented by release uploaders. * I have used vendor names for the architectures, that casual users would recognise. * Their signature file is linked as well. I expect most will ignore this but better to show it to remind people it exists. * I called it "signature" as a generic term to cover the .jsonl and .sig files. Instructions to use these were added to the text in a previous change. (cherry picked from commit e8b7183)
This adds download links to the GitHub release pages for common platforms. The automatically built packages' links are automatically revealed once the builds are complete. For packages built by hand, hidden links are included in the text for release uploaders to reveal later.
The approach taken: