Skip to content

Commit f9cd067

Browse files
committed
CI: Use LLVM repo of correct Ubuntu versions
The Clang build jobs in htop's CI now grabs the Ubuntu codename automatically from the /etc/os-release file of the Ubuntu image. This frees us the need to update the codenames when the "ubuntu-latest" image gets updated upstream (by GitHub). At the time of the writing, the "ubuntu-latest" image contains "ubuntu-24.04" (noble). Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
1 parent 90ef408 commit f9cd067

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

.github/workflows/ci.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ jobs:
3636
- uses: actions/checkout@v4
3737
- name: install clang repo
3838
run: |
39+
ubuntu_codename=`sed 's/^ *UBUNTU_CODENAME= *\([^ ]*\).*$/\1/p; d;' /etc/os-release`
3940
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key 2>/dev/null | sudo apt-key add -
40-
sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main' -y
41+
sudo add-apt-repository "deb http://apt.llvm.org/${ubuntu_codename}/ llvm-toolchain-${ubuntu_codename}-18 main" -y
4142
sudo apt-get update -q
4243
- name: Install Dependencies
4344
run: sudo apt-get install --no-install-recommends clang-18 libncursesw5-dev
@@ -77,8 +78,9 @@ jobs:
7778
- uses: actions/checkout@v4
7879
- name: install clang repo
7980
run: |
81+
ubuntu_codename=`sed 's/^ *UBUNTU_CODENAME= *\([^ ]*\).*$/\1/p; d;' /etc/os-release`
8082
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key 2>/dev/null | sudo apt-key add -
81-
sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main' -y
83+
sudo add-apt-repository "deb http://apt.llvm.org/${ubuntu_codename}/ llvm-toolchain-${ubuntu_codename}-18 main" -y
8284
sudo apt-get update -q
8385
- name: Install Dependencies
8486
run: sudo apt-get install --no-install-recommends clang-18 libncursesw5-dev libhwloc-dev libnl-3-dev libnl-genl-3-dev libsensors-dev libcap-dev
@@ -146,8 +148,9 @@ jobs:
146148
- uses: actions/checkout@v4
147149
- name: install clang repo
148150
run: |
151+
ubuntu_codename=`sed 's/^ *UBUNTU_CODENAME= *\([^ ]*\).*$/\1/p; d;' /etc/os-release`
149152
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key 2>/dev/null | sudo apt-key add -
150-
sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main' -y
153+
sudo add-apt-repository "deb http://apt.llvm.org/${ubuntu_codename}/ llvm-toolchain-${ubuntu_codename}-18 main" -y
151154
sudo apt-get update -q
152155
- name: Install Dependencies
153156
run: sudo apt-get install --no-install-recommends clang-18 clang-tools-18 libncursesw5-dev libnl-3-dev libnl-genl-3-dev libsensors-dev libcap-dev
@@ -172,8 +175,9 @@ jobs:
172175
- uses: actions/checkout@v4
173176
- name: install clang repo
174177
run: |
178+
ubuntu_codename=`sed 's/^ *UBUNTU_CODENAME= *\([^ ]*\).*$/\1/p; d;' /etc/os-release`
175179
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key 2>/dev/null | sudo apt-key add -
176-
sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main' -y
180+
sudo add-apt-repository "deb http://apt.llvm.org/${ubuntu_codename}/ llvm-toolchain-${ubuntu_codename}-18 main" -y
177181
sudo apt-get update -q
178182
- name: Install LLVM Toolchain
179183
run: sudo apt-get install --no-install-recommends clang-18 libclang-rt-18-dev llvm-18

0 commit comments

Comments
 (0)