Skip to content

Commit e8b7183

Browse files
[llvm][release] Add links to commonly used release packages (#147719)
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.
1 parent b6a98b9 commit e8b7183

File tree

2 files changed

+83
-7
lines changed

2 files changed

+83
-7
lines changed

.github/workflows/release-tasks.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,31 @@ jobs:
111111
# Called workflows don't have access to secrets by default, so we need to explicitly pass secrets that we use.
112112
secrets:
113113
RELEASE_TASKS_USER_TOKEN: ${{ secrets.RELEASE_TASKS_USER_TOKEN }}
114+
115+
uncomment-download-links:
116+
name: Uncomment download links
117+
runs-on: ubuntu-24.04
118+
permissions:
119+
contents: write # For updating the release message.
120+
needs:
121+
- validate-tag
122+
- release-create
123+
- release-binaries
124+
125+
steps:
126+
- name: Install Dependencies
127+
run: |
128+
sudo apt-get update
129+
sudo apt-get install python3-github
130+
131+
- name: Checkout LLVM
132+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
133+
with:
134+
sparse-checkout: llvm/utils/release/github-upload-release.py
135+
sparse-checkout-cone-mode: false
136+
137+
- name: Uncomment Download Links
138+
env:
139+
GITHUB_TOKEN: ${{ github.token }}
140+
run: |
141+
./llvm/utils/release/./github-upload-release.py --token "$GITHUB_TOKEN" --release ${{ needs.validate-tag.outputs.release-version }} uncomment_download_links

llvm/utils/release/github-upload-release.py

Lines changed: 55 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,39 @@ def create_release(repo, release, tag=None, name=None, message=None):
4545
# Note that these lines are not length limited because if we do so, GitHub
4646
# assumes that should be how it is laid out on the page. We want GitHub to
4747
# do the reflowing for us instead.
48+
#
49+
# Once all the atuomatic binary builds have completed, the HTML comments
50+
# with UPPERCASE markers in them will be removed to reveal the download
51+
# links later. Other lines are surrounded in <!-- --> for release uploaders
52+
# to manually uncomment when they upload that package.
4853
message = dedent(
4954
"""\
50-
LLVM {release} Release
55+
## LLVM {release} Release
5156
52-
## Package Types
57+
<!-- AUTOMATIC_DOWNLOAD_LINKS_BEGIN
58+
* [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))
59+
* [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))
60+
AUTOMATIC_DOWNLOAD_LINKS_END -->
61+
<!-- * [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)) -->
5362
54-
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.
63+
<!-- AUTOMATIC_DOWNLOAD_LINKS_BEGIN
64+
* [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))
65+
* [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))
66+
AUTOMATIC_DOWNLOAD_LINKS_END -->
67+
68+
<!-- * 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)) -->
69+
<!-- * 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)) -->
70+
<!-- * 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)) -->
5571
56-
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-`.
72+
Download links will appear here once builds have completed. <!-- AUTOMATIC_DOWNLOAD_LINKS_PLACEHOLDER -->
73+
74+
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.
75+
76+
## Package Types
5777
58-
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.
78+
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.
5979
60-
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.
80+
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-`.
6181
6282
In addition, source archives are available:
6383
* `<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):
95115
print("Done")
96116

97117

118+
def uncomment_download_links(repo, release):
119+
release = repo.get_release("llvmorg-{}".format(release))
120+
121+
new_message = []
122+
to_remove = [
123+
"AUTOMATIC_DOWNLOAD_LINKS_BEGIN",
124+
"AUTOMATIC_DOWNLOAD_LINKS_END",
125+
"AUTOMATIC_DOWNLOAD_LINKS_PLACEHOLDER",
126+
]
127+
for line in release.body.splitlines():
128+
for comment in to_remove:
129+
if comment in line:
130+
break
131+
else:
132+
new_message.append(line)
133+
134+
release.update_release(
135+
name=release.title,
136+
message="\n".join(new_message),
137+
draft=release.draft,
138+
prerelease=release.prerelease,
139+
)
140+
141+
98142
parser = argparse.ArgumentParser()
99143
parser.add_argument(
100-
"command", type=str, choices=["create", "upload", "check-permissions"]
144+
"command",
145+
type=str,
146+
choices=["create", "upload", "check-permissions", "uncomment_download_links"],
101147
)
102148

103149
# All args
@@ -137,3 +183,5 @@ def upload_files(repo, release, files):
137183
create_release(llvm_repo, args.release)
138184
if args.command == "upload":
139185
upload_files(llvm_repo, args.release, args.files)
186+
if args.command == "uncomment_download_links":
187+
uncomment_download_links(llvm_repo, args.release)

0 commit comments

Comments
 (0)