Skip to content

Commit b15e8bd

Browse files
authored
Merge pull request #3470 from ann0see/autobuild/switchARM
Switch autobuild OS to ARM runner
2 parents b2e0776 + cc78e4c commit b15e8bd

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

.github/autobuild/linux_deb.sh

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ esac
5151
setup() {
5252
export DEBIAN_FRONTEND="noninteractive"
5353

54+
APT_ARCH="$(dpkg --print-architecture)"
55+
export APT_ARCH
56+
5457
setup_cross_compilation_apt_sources
5558

5659
echo "Installing dependencies..."
@@ -61,18 +64,22 @@ setup() {
6164
}
6265

6366
setup_cross_compilation_apt_sources() {
64-
if [[ "${TARGET_ARCH}" == amd64 ]]; then
67+
if [[ "${TARGET_ARCH}" == "${APT_ARCH}" ]]; then
6568
return
6669
fi
70+
echo "Building on ${APT_ARCH} for ${TARGET_ARCH}. Thus modifying apt..."
6771
sudo dpkg --add-architecture "${TARGET_ARCH}"
68-
# Duplicate the original Ubuntu sources and modify them to refer to the TARGET_ARCH:
69-
sed -rne "s|^deb.*/ ([^ -]+(-updates)?) main.*|deb [arch=${TARGET_ARCH}] http://ports.ubuntu.com/ubuntu-ports \1 main universe multiverse restricted|p" /etc/apt/sources.list | sudo dd of=/etc/apt/sources.list.d/"${TARGET_ARCH}".list
70-
# Now take the original Ubuntu sources and limit those to the build host (i.e. non-TARGET_ARCH) architectures:
71-
sudo sed -re 's/^deb /deb [arch=amd64,i386] /' -i /etc/apt/sources.list
72+
73+
if [[ "${APT_ARCH}" == "amd64" ]]; then
74+
# Duplicate the original Ubuntu sources and modify them to refer to the TARGET_ARCH:
75+
sed -rne "s|^deb.*/ ([^ -]+(-updates)?) main.*|deb [arch=${TARGET_ARCH}] http://ports.ubuntu.com/ubuntu-ports \1 main universe multiverse restricted|p" /etc/apt/sources.list | sudo dd of=/etc/apt/sources.list.d/"${TARGET_ARCH}".list
76+
# Now take the original Ubuntu sources and limit those to the build host (i.e. non-TARGET_ARCH) architectures:
77+
sudo sed -re 's/^deb /deb [arch=amd64,i386] /' -i /etc/apt/sources.list
78+
fi
7279
}
7380

7481
setup_cross_compiler() {
75-
if [[ "${TARGET_ARCH}" == amd64 ]]; then
82+
if [[ "${TARGET_ARCH}" == "${APT_ARCH}" ]]; then
7683
return
7784
fi
7885
local GCC_VERSION=9 # 9 is the default on 20.04, there is no reason not to update once 20.04 is out of support

.github/workflows/autobuild.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,14 +212,14 @@ jobs:
212212

213213
- config_name: Linux .deb armhf (artifacts)
214214
target_os: linux
215-
building_on_os: ubuntu-22.04
215+
building_on_os: ubuntu-22.04-arm
216216
building_container: ubuntu:20.04
217217
base_command: TARGET_ARCH=armhf ./.github/autobuild/linux_deb.sh
218218
run_codeql: false
219219

220220
- config_name: Linux .deb arm64 (artifacts)
221221
target_os: linux
222-
building_on_os: ubuntu-22.04
222+
building_on_os: ubuntu-22.04-arm
223223
building_container: ubuntu:20.04
224224
base_command: TARGET_ARCH=arm64 ./.github/autobuild/linux_deb.sh
225225
run_codeql: false

0 commit comments

Comments
 (0)