Skip to content

Commit ef40b12

Browse files
authored
Build action runner for .NET 8 (#22)
* .github/workflows/build.yml - Use ubuntu 24:10 - Add sdk8 branch * Dockerfile.almalinux - Use combined runner patch - Always use SDK 8 * Dockerfile.ubuntu - Use 24:10 and SDK 8 * build-files/build-image.sh - Remove RPM download and conversion * build-files/convert-rpm.sh - No longer needed - deleted * build-files/runner-sdk-8.patch - Combined patch for s390x/ppc64le using .NET 8 * build-files/runner-s390x.patch build-files/runner-ppc64le.patch - Replaced by combined patch - deleted * build-selfhosted.sh - Use SDK 8 - Remove opensuse as a build option * setup-build-env.sh - Use Ubuntu 24:10 - Use combined patch
1 parent d04dd68 commit ef40b12

10 files changed

+177
-939
lines changed

.github/workflows/build.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ name: CI
44
on:
55
# Triggers the workflow on push or pull request events but only for the "main" branch
66
push:
7-
branches: [ "main", "testflow" ]
7+
branches: [ "main", "testflow", "sdk8" ]
88
pull_request:
9-
branches: [ "main", "testflow" ]
9+
branches: [ "main", "testflow", "sdk8" ]
1010

1111
# Allows you to run this workflow manually from the Actions tab
1212
workflow_dispatch:
@@ -16,7 +16,7 @@ jobs:
1616
# This workflow contains a single job called "build"
1717
build:
1818
# The type of runner that the job will run on
19-
runs-on: ubuntu-22.04-s390x
19+
runs-on: ubuntu-24.10-s390x
2020

2121
# Steps represent a sequence of tasks that will be executed as part of the job
2222
steps:

Dockerfile.almalinux

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM almalinux:9
22

3-
ARG RUNNERREPO="https://github.com/actions/runner" RUNNERPATCH SDK ARCH
3+
ARG RUNNERREPO="https://github.com/actions/runner" RUNNERPATCH ARCH
44

55
RUN dnf update -y -q && \
66
dnf install -y -q wget git which langpacks-en glibc-all-langpacks sudo
@@ -14,7 +14,7 @@ RUN cd /tmp && \
1414
git clone -q ${RUNNERREPO} && \
1515
cd runner && \
1616
git checkout $(git describe --tags $(git rev-list --tags --max-count=1)) -b build && \
17-
sed -i'' -e /version/s/6......\"$/${SDK}.0.100\"/ src/global.json && \
17+
sed -i'' -e /version/s/8......\"$/${SDK}.0.100\"/ src/global.json && \
1818
git apply /tmp/runner.patch
1919

2020
RUN cd /tmp/runner/src && \

Dockerfile.opensuse

-49
This file was deleted.

Dockerfile.ubuntu

+6-14
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,13 @@
1-
FROM ubuntu:22.04
1+
FROM ubuntu:24.10
22

3-
ARG RUNNERREPO="https://github.com/actions/runner" RUNNERPATCH SDK ARCH
3+
ARG RUNNERREPO="https://github.com/actions/runner" RUNNERPATCH SDK=8 ARCH
44

55
ENV DEBIAN_FRONTEND=noninteractive
66

77
RUN apt-get -qq update -y && \
8-
apt-get -qq -y install wget git sudo alien curl libicu70 sudo && \
9-
apt-get -qq -y install cpio rpm2cpio && \
8+
apt-get -qq -y install wget git sudo alien curl dotnet-sdk-8.0 && \
109
apt autoclean
1110

12-
COPY build-files/convert-rpm.sh /tmp
13-
14-
RUN sed "s/--no-absolute-filenames//" /usr/share/perl5/Alien/Package/Rpm.pm > /tmp/Rpm.pm
15-
RUN cp /tmp/Rpm.pm /usr/share/perl5/Alien/Package/Rpm.pm
16-
17-
RUN /tmp/convert-rpm.sh ${SDK}
18-
1911
RUN dpkg --install /tmp/*.deb && \
2012
rm -rf /tmp/*.deb && \
2113
echo "Using SDK - `dotnet --version`"
@@ -25,8 +17,8 @@ ADD ${RUNNERPATCH} /tmp/runner.patch
2517
RUN cd /tmp && \
2618
git clone -q ${RUNNERREPO} && \
2719
cd runner && \
28-
git checkout $(git describe --tags $(git rev-list --tags --max-count=1)) -b build && \
29-
sed -i'' -e /version/s/6......\"$/${SDK}.0.100\"/ src/global.json && \
20+
git checkout main -b build && \
21+
sed -i'' -e /version/s/8......\"$/${SDK}.0.100\"/ src/global.json && \
3022
git apply /tmp/runner.patch
3123

3224
RUN cd /tmp/runner/src && \
@@ -46,7 +38,7 @@ RUN mkdir -p /opt/runner && \
4638

4739
RUN apt-get -qq -y install cmake make automake autoconf m4 gcc-12-base libtool
4840

49-
RUN rm -rf /tmp/runner /tmp/runner.patch /tmp/convert-rpm.sh
41+
RUN rm -rf /tmp/runner /tmp/runner.patch
5042

5143
USER ubuntu
5244

build-files/build-image.sh

+16-66
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
11
#!/bin/bash
22

3+
header() {
4+
echo "+--------------------------------------------+"
5+
echo "| $*"
6+
echo "+--------------------------------------------+"
7+
echo
8+
}
9+
310
update_fresh_container() {
4-
echo "Upgrading and installing packages"
5-
sudo DEBIAN_FRONTEND=noninteractive apt-get -qq update -y
6-
sudo DEBIAN_FRONTEND=noninteractive apt-get -qq install alien libicu70 -y
11+
header "Upgrading and installing packages"
12+
sudo DEBIAN_FRONTEND=noninteractive apt-get -qq update -y >/dev/null
13+
sudo DEBIAN_FRONTEND=noninteractive apt-get -qq install dotnet-sdk-8.0 -y >/dev/null
714

815
if [ $? -ne 0 ]; then
916
exit 32
1017
fi
1118
sudo apt autoclean
1219

13-
sudo sed "s/--no-absolute-filenames//" /usr/share/perl5/Alien/Package/Rpm.pm > /tmp/Rpm.pm
14-
sudo cp /tmp/Rpm.pm /usr/share/perl5/Alien/Package/Rpm.pm
15-
1620
echo "Initializing LXD environment"
1721
sudo lxd init --preseed </tmp/lxd-preseed.yaml
1822

@@ -21,60 +25,6 @@ update_fresh_container() {
2125
}
2226

2327
setup_dotnet_sdk() {
24-
MIRROR="https://mirror.lchs.network/pub/almalinux/9/AppStream/${ARCH}/os/Packages"
25-
case "${SDK}" in
26-
8)
27-
PKGS="dotnet-apphost-pack-8.0-8.0.5-1.el9_4 dotnet-host-8.0.5-1.el9_4"
28-
PKGS="${PKGS} dotnet-hostfxr-8.0-8.0.5-1.el9_4 dotnet-targeting-pack-8.0-8.0.5-1.el9_4"
29-
PKGS="${PKGS} dotnet-templates-8.0-8.0.105-1.el9_4 dotnet-runtime-8.0-8.0.5-1.el9_4"
30-
PKGS="${PKGS} dotnet-sdk-8.0-8.0.105-1.el9_4 aspnetcore-runtime-8.0-8.0.5-1.el9_4"
31-
PKGS="${PKGS} aspnetcore-targeting-pack-8.0-8.0.5-1.el9_4 netstandard-targeting-pack-2.1-8.0.105-1.el9_4"
32-
PKGS="${PKGS} dotnet-runtime-dbg-8.0-8.0.5-1.el9_4 dotnet-sdk-dbg-8.0-8.0.105-1.el9_4 aspnetcore-runtime-dbg-8.0-8.0.5-1.el9_4"
33-
;;
34-
7)
35-
PKGS="dotnet-apphost-pack-7.0-7.0.19-1.el9_4 dotnet-host-8.0.5-1.el9_4"
36-
PKGS="${PKGS} dotnet-hostfxr-7.0-7.0.19-1.el9_4 dotnet-targeting-pack-7.0-7.0.19-1.el9_4"
37-
PKGS="${PKGS} dotnet-templates-7.0-7.0.119-1.el9_4 dotnet-runtime-7.0-7.0.19-1.el9_4"
38-
PKGS="${PKGS} dotnet-sdk-7.0-7.0.119-1.el9_4 aspnetcore-runtime-7.0-7.0.19-1.el9_4"
39-
PKGS="${PKGS} aspnetcore-targeting-pack-7.0-7.0.19-1.el9_4 netstandard-targeting-pack-2.1-8.0.105-1.el9_4"
40-
;;
41-
*)
42-
echo "Unsupported architecture ${ARCH}" >&2
43-
return 1
44-
;;
45-
esac
46-
echo "Retrieving dotnet packages"
47-
sudo sed -i'' -e 's/--no-absolute-filenames//' /usr/share/perl5/Alien/Package/Rpm.pm
48-
pushd /tmp >/dev/null
49-
for pkg in ${PKGS}
50-
do
51-
RPM="${pkg}.${ARCH}.rpm"
52-
wget -q ${MIRROR}/${RPM}
53-
echo -n "Converting ${RPM}... "
54-
sudo alien -d ${RPM} |& grep -v ^warning
55-
if [ $? -ne 0 ]; then
56-
return 2
57-
fi
58-
rm -f ${RPM}
59-
done
60-
61-
echo "Installing dotnet"
62-
sudo DEBIAN_FRONTEND=noninteractive dpkg --install /tmp/*.deb
63-
if [ $? -ne 0 ]; then
64-
return 3
65-
fi
66-
sudo rm -f /tmp/*.deb
67-
popd >/dev/null
68-
69-
if [ ${SDK} -ne 6 ]; then
70-
pushd /usr/lib64/dotnet/packs >/dev/null
71-
sudo ln -s Microsoft.AspNetCore.App.Ref Microsoft.AspNetCore.App.Runtime.linux-${ARCH}
72-
sudo ln -s Microsoft.AspNetCore.App.Ref Microsoft.AspNetCore.App.linux-${ARCH}
73-
sudo ln -s Microsoft.NETCore.App.Host.rhel.9-${ARCH} Microsoft.NETCore.App.Host.linux-${ARCH}
74-
sudo ln -s Microsoft.NETCore.App.Ref Microsoft.NETCore.App.Runtime.linux-${ARCH}
75-
popd >/dev/null
76-
fi
77-
7828
echo "Using SDK - `dotnet --version`"
7929

8030
# fix ownership
@@ -87,19 +37,19 @@ setup_dotnet_sdk() {
8737
}
8838

8939
patch_runner() {
90-
echo "Patching runner"
40+
header "Cloning repo and Patching runner"
9141
cd /tmp
9242
git clone -q ${RUNNERREPO}
9343
cd runner
94-
git checkout $(git describe --tags $(git rev-list --tags --max-count=1)) -b ${ARCH}
95-
git apply /home/ubuntu/runner-${ARCH}.patch
96-
sed -i'' -e /version/s/6......\"$/${SDK}.0.100\"/ src/global.json
44+
git checkout main -b build
45+
git apply /home/ubuntu/runner-sdk-8.patch
46+
sed -i'' -e /version/s/8......\"$/8.0.100\"/ src/global.json
9747
return $?
9848
}
9949

10050
build_runner() {
10151
export DOTNET_NUGET_SIGNATURE_VERIFICATION=false
102-
echo "Building runner binary"
52+
header "Building runner binary"
10353
cd src
10454

10555
echo "dev layout"
@@ -121,7 +71,7 @@ build_runner() {
12171
}
12272

12373
install_runner() {
124-
echo "Installing runner"
74+
header "Installing runner"
12575
sudo mkdir -p /opt/runner
12676
sudo tar -xf /tmp/runner/_package/*.tar.gz -C /opt/runner
12777
if [ $? -eq 0 ]; then

build-files/convert-rpm.sh

-58
This file was deleted.

0 commit comments

Comments
 (0)