Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 86 additions & 0 deletions .github/release-note-canonical.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,89 @@ The ARM32 runner build retains the local `RUNNER_IGNORE_ARM32_KILL_SWITCH` envir
## Runner package contents

Package validation now checks that published bundles contain the expected Node runtime and version. Linux ARM32 bundles use Node 22; other Linux bundles use Node 24.

## Linux RISC-V 64 runner (experimental)

**The RISC-V package is experimental and provided as is, without any guarantee
that it works. It is best-effort and may lag behind or be dropped from a release
if its build breaks. Do not rely on it for production workloads.**

The RISC-V runner is an unofficial build using the community
[.NET 10 SDK](https://github.com/filipnavara/dotnet-riscv) and
[Node.js RISC-V builds](https://unofficial-builds.nodejs.org/). Neither is an
official Microsoft-supported RISC-V runner runtime. Track their security
updates and update the SDK version, archive checksum, Node versions and Node
checksums together when upgrading.

Only Node 24 is bundled. Actions requesting Node 12, 16 or 20 use Node 24 on
RISC-V, even when Node 20 is explicitly enabled. Older actions may need to be
updated for Node 24. Individual actions, container images and tools also need
RISC-V support; JavaScript actions in Alpine job containers are not supported
on non-x64 runners.

### Build on RISC-V

Apply `patches/runner-main-sdk8-riscv64.patch` for the current main source, or
`patches/runner-sdk8-riscv64.patch` for the corresponding upstream release
source. The patch names follow the existing architecture-patch convention;
the RISC-V target uses .NET 10, not .NET 8. Apply the workflow-test patch
separately before running L0 tests.

Install the community SDK and its included runtime packs in a separate
directory, then put its `dotnet` on `PATH`:

```sh
version=10.0.115
archive="dotnet-sdk-${version}-linux-riscv64.tar.gz"
curl -fLO "https://github.com/filipnavara/dotnet-riscv/releases/download/${version}/${archive}"
echo "f06bcd3f7cff2781711150ae817190ce67d630b075be0b0aedeb021049c8a0d4 ${archive}" | sha256sum --check
mkdir -p "$HOME/dotnet-riscv64"
tar -xzf "$archive" -C "$HOME/dotnet-riscv64"
export DOTNET_ROOT="$HOME/dotnet-riscv64"
export PATH="$DOTNET_ROOT:$PATH"
# Use runner-sdk8-riscv64.patch instead for the corresponding release.
git apply patches/runner-main-sdk8-riscv64.patch
git apply patches/patch-sync-l0.patch
cd src
./dev.sh layout Release linux-riscv64
../.github/scripts/strip-bundled-npm.sh ../_layout linux-riscv64
./dev.sh test
./dev.sh package Release linux-riscv64
```

Keep the SDK separate from .NET 8 so the RISC-V build does not select the
.NET 8 SDK. Node archives are checksum-verified before extraction. The
resulting archive is `_package/actions-runner-linux-riscv64-<version>.tar.gz`.
Refresh `patches/patch-sync-l0.patch` if its upstream test file changes. While
RISC-V is disabled, x64 CI warns and skips those workflow tests if the patch is
stale; when RISC-V is enabled, CI requires the patch to apply.

### Enable CI and releases

CI and releases do not schedule RISC-V builds by default. Refresh and check
both RISC-V patches against the current main source and latest upstream release
before setting the repository variable `ENABLE_RISCV64_BUILDS` to `true`.

Until native RISC-V runners are available (as of 2026-12-03), CI and releases
cross-build the RISC-V package on the x64 builder: the official x64 .NET SDK
plus the community SDK's riscv64 runtime packs, both checksum-pinned. The RISC-V L0 tests are
skipped, because running them would require emulation. Instead, the package is
smoke-tested under qemu-user, and CI fails if any bundled ELF file is not
RISC-V. Once a native Ubuntu 24.04 RISC-V builder is available, change the
`linux-riscv64` build host in `runs-on` to it and replace the cross-build SDK
setup in `build.yml` and `release.yml` with a plain install of the community
SDK (as in "Build on RISC-V" above). The RISC-V L0 steps then run again
automatically on the RISC-V runner.

Patch synchronization skips RISC-V
while disabled and uses each RISC-V patch's own source marker when enabled.
Enabling the variable does not itself refresh stale patches; update the pinned
Node checksum when porting to a new Node version. The RISC-V patches set
`NODE24_VERSION` to at least 24.23.0, because Node 24.22.x crashes in V8's
Sparkplug JIT on riscv64; do not lower it to match upstream. Enabled releases
run the RISC-V package checks, then publish the archive and its SHA-256
checksum.

Configure RISC-V runners with `--disableupdate` and maintain timely upgrades
from this repository's releases; GitHub's official runner download service
does not provide this fork's RISC-V package.
126 changes: 120 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
strategy:
fail-fast: false
matrix:
runtime: [ linux-s390x, linux-ppc64le, linux-x64, linux-arm64, linux-arm ]
runtime: ${{ fromJSON(vars.ENABLE_RISCV64_BUILDS == 'true' && '["linux-s390x","linux-ppc64le","linux-x64","linux-arm64","linux-arm","linux-riscv64"]' || '["linux-s390x","linux-ppc64le","linux-x64","linux-arm64","linux-arm"]') }}
include:

- runtime: linux-x64
Expand All @@ -44,19 +44,68 @@ jobs:
runs_on: s390x
patch_tag: s390x

runs-on: [ self-hosted, noble, generic, "${{ matrix.runs_on }}" ]
# linux-riscv64 has no include entry: an unmatched include would add the job
# even when RISC-V builds are disabled. Temporary (added 2026-12-03) until native RISC-V runners
# are available: it falls back to the x64 builder for a cross-build.
runs-on: [ self-hosted, noble, generic, "${{ matrix.runs_on || 'amd64' }}" ]
Comment thread
cbartz marked this conversation as resolved.
Resolved
steps:
- uses: actions/checkout@v7

- name: Install DotNet SDK
if: matrix.runtime != 'linux-riscv64'
run: sudo apt-get update && sudo apt-get install -y dotnet-sdk-8.0

# Temporary (added 2026-12-03) until native RISC-V runners are available: linux-riscv64 is
# cross-built on x64 because no RISC-V builder exists yet. The RISC-V L0
# tests are skipped, since running them would require emulation; the
# package is smoke-tested under qemu-user instead.
- name: Install RISC-V cross-build DotNet SDK
if: matrix.runtime == 'linux-riscv64'
run: |
# riscv64-dotnet-setup:start
set -euo pipefail

# The official x64 SDK builds for linux-riscv64 once it has the community
# riscv64 runtime packs. Those packs are symlinks into the community SDK's
# shared/ and host/ directories, so copy them dereferenced: copying the
# links would package the x64 runtime instead.
version=10.0.115
x64_sha256=a2c56c69422f28995196290c068d0e670206f7f873cd0079500774bae8ce3ea4
Comment thread
cbartz marked this conversation as resolved.
Resolved
riscv64_sha256=f06bcd3f7cff2781711150ae817190ce67d630b075be0b0aedeb021049c8a0d4
x64_archive="${RUNNER_TEMP:?}/dotnet-sdk-${version}-linux-x64.tar.gz"
riscv64_archive="${RUNNER_TEMP}/dotnet-sdk-${version}-linux-riscv64.tar.gz"
sdk_dir="${RUNNER_TEMP}/dotnet-riscv64-cross-${version}"
riscv64_sdk_dir="${RUNNER_TEMP}/dotnet-riscv64-community-${version}"

curl -fsSL --retry 3 --connect-timeout 30 --max-time 600 -o "$x64_archive" \
"https://builds.dotnet.microsoft.com/dotnet/Sdk/${version}/dotnet-sdk-${version}-linux-x64.tar.gz"
curl -fsSL --retry 3 --connect-timeout 30 --max-time 600 -o "$riscv64_archive" \
"https://github.com/filipnavara/dotnet-riscv/releases/download/${version}/dotnet-sdk-${version}-linux-riscv64.tar.gz"
printf '%s %s\n' "$x64_sha256" "$x64_archive" "$riscv64_sha256" "$riscv64_archive" | sha256sum --check
mkdir -p "$sdk_dir" "$riscv64_sdk_dir"
tar -xzf "$x64_archive" -C "$sdk_dir"
tar -xzf "$riscv64_archive" -C "$riscv64_sdk_dir"
for pack in Microsoft.NETCore.App.Runtime Microsoft.NETCore.App.Host Microsoft.AspNetCore.App.Runtime; do
cp -rL "$riscv64_sdk_dir/packs/${pack}.linux-riscv64" "$sdk_dir/packs/"
Comment thread
cbartz marked this conversation as resolved.
Resolved
done
rm -rf "$riscv64_sdk_dir" "$x64_archive" "$riscv64_archive"

"$sdk_dir/dotnet" --version
echo "$sdk_dir" >> "${GITHUB_PATH:?}"
echo "DOTNET_ROOT=$sdk_dir" >> "${GITHUB_ENV:?}"
# riscv64-dotnet-setup:end

- name: Apply patches
if: matrix.runtime == 'linux-s390x' || matrix.runtime == 'linux-ppc64le' || matrix.runtime == 'linux-arm'
if: matrix.runtime == 'linux-s390x' || matrix.runtime == 'linux-ppc64le' || matrix.runtime == 'linux-arm' || matrix.runtime == 'linux-riscv64'
run: |
git apply patches/runner-main-sdk8-${{ matrix.patch_tag }}.patch
if [[ "${{ matrix.runtime }}" == "linux-riscv64" && ( "$GITHUB_REF" == refs/heads/releases/* || "$GITHUB_BASE_REF" == releases/* ) ]]; then
git apply patches/runner-sdk8-riscv64.patch
else
git apply patches/runner-main-sdk8-${{ matrix.patch_tag || 'riscv64' }}.patch
fi

- name: Update DotNet required version pin
if: matrix.runtime != 'linux-riscv64'
run: |
current_version=$( cat src/global.json | jq -r '.sdk.version' )
if [ "${{ matrix.runtime }}" = "linux-arm" ]; then
Expand All @@ -75,9 +124,51 @@ jobs:
./dev.sh layout Release ${{ matrix.runtime }}
working-directory: src

# Temporary (added 2026-12-03) until native RISC-V runners are available: lets the x64 builder
# run the riscv64 Node and runner binaries for the steps below. Invariant
# globalization avoids needing a riscv64 libicu on the host.
- name: Set up RISC-V user-mode emulation
Comment thread
cbartz marked this conversation as resolved.
Resolved
if: matrix.runtime == 'linux-riscv64'
run: |
sudo apt-get update
sudo apt-get install -y qemu-user qemu-user-binfmt libc6-riscv64-cross libstdc++6-riscv64-cross
if [[ ! -e /proc/sys/fs/binfmt_misc/qemu-riscv64 ]]; then
echo "::error::No binfmt_misc handler for riscv64; cannot run the cross-built package."
exit 1
fi
echo "QEMU_LD_PREFIX=/usr/riscv64-linux-gnu" >> "$GITHUB_ENV"
echo "DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1" >> "$GITHUB_ENV"

# Fork-only: see .github/scripts/strip-bundled-npm.sh.
- name: Strip bundled npm and corepack
run: .github/scripts/strip-bundled-npm.sh _layout ${{ matrix.runtime }}
run: |
if [[ "${{ matrix.runtime }}" == "linux-riscv64" ]] && compgen -G '_layout/externals/node20*' > /dev/null; then
echo "::error::RISC-V runner must not bundle Node 20."
exit 1
fi
.github/scripts/strip-bundled-npm.sh _layout ${{ matrix.runtime }}

- name: Apply workflow test patch
Comment thread
cbartz marked this conversation as resolved.
Resolved
if: matrix.runtime == 'linux-x64' || (matrix.runtime == 'linux-riscv64' && runner.arch == 'RISCV64')
env:
ENABLE_RISCV64_BUILDS: ${{ vars.ENABLE_RISCV64_BUILDS }}
run: |
# workflow-test-patch:start
apply_workflow_test_patch() {
local enabled="$1" patch="$2"

if git apply --check "$patch" >/dev/null 2>&1; then
git apply "$patch"
elif [[ "${enabled,,}" == "true" ]]; then
echo "::error::Workflow test patch is stale; refresh it before enabling RISC-V."
return 1
else
echo "::warning::Workflow test patch is stale; skipping its tests while RISC-V is disabled."
fi
}
# workflow-test-patch:end

apply_workflow_test_patch "${ENABLE_RISCV64_BUILDS:-}" patches/patch-sync-l0.patch

# Run tests
- name: L0
Expand All @@ -87,7 +178,9 @@ jobs:
# 2026/11/25 - ProcessExtensionL0.SuccessReadProcessEnv may be flaky; retrigger this job once before investigating a failure.
./dev.sh test
working-directory: src
if: matrix.runtime == 'linux-x64'
# linux-riscv64 runs L0 only on a native RISC-V runner; the temporary x64
# cross-build skips it (see the SDK setup step).
if: matrix.runtime == 'linux-x64' || (matrix.runtime == 'linux-riscv64' && runner.arch == 'RISCV64')


# L0 uses DEBUG-only test hooks; keep Release layout/package validation separate.
Expand Down Expand Up @@ -127,6 +220,27 @@ jobs:
test "$(package_test/externals/node24/bin/node --version)" = "v$NODE24_VERSION"
working-directory: src

# Temporary (added 2026-12-03) until native RISC-V runners are available.
- name: Test package (RISC-V cross-build)
Comment thread
cbartz marked this conversation as resolved.
Resolved
if: github.event_name != 'pull_request' && matrix.runtime == 'linux-riscv64'
run: |
# A cross-build can silently bundle x64 libraries (see the SDK setup step),
# so require every ELF file in the package to target RISC-V (e_machine 243).
bad=0
while IFS= read -r -d '' file; do
[[ "$(od -An -tx1 -N4 "$file" | tr -d ' \n')" == 7f454c46 ]] || continue
machine=$(od -An -tu2 -j18 -N2 "$file" | tr -d ' ')
if [[ "$machine" != 243 ]]; then
echo "::error::$file is not a RISC-V ELF (e_machine $machine)"
bad=1
fi
done < <(find package_test -type f -print0)
test "$bad" -eq 0
# `node --version` exits before V8's JIT tiers up; a hot loop exercises it
# (Node 24.22.x crashed here on riscv64).
package_test/externals/node24/bin/node -e 'let s=0; for (let i=0; i<5e6; i++) s+=i; if (s !== 12499997500000) process.exit(1)'
working-directory: src

# linux-arm produces armv7l (32-bit) binaries that cannot execute on the
# arm64 build host directly, so smoke-test the package inside a 32-bit arm container.
# On arm64 hosts with native AArch32 support this runs natively; if binfmt/qemu-user
Expand Down
51 changes: 48 additions & 3 deletions .github/workflows/patch_update_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,56 @@ jobs:
- name: Process architectures
if: steps.get-commits.outputs.PREVIOUS_COMMIT != '' && steps.get-commits.outputs.PREVIOUS_COMMIT != steps.get-commits.outputs.LATEST_COMMIT
id: process-arches
env:
ENABLE_RISCV64_BUILDS: ${{ vars.ENABLE_RISCV64_BUILDS }}
run: |
# patch-sync-baseline:start
patch_sync_baseline() {
local architecture="$1" enabled="$2" shared_baseline="$3" patch="$4" kind="$5"
local prefix marker baseline

if [[ "$architecture" != "riscv64" ]]; then
printf '%s\n' "$shared_baseline"
return 0
fi

if [[ "${enabled,,}" != "true" ]]; then
return 0
fi

case "$kind" in
commit) prefix="# From upstream commit: " ;;
release) prefix="# From upstream release: " ;;
*) echo "Invalid RISC-V patch marker type: $kind" >&2; return 1 ;;
esac

if [[ ! -f "$patch" ]]; then
echo "Invalid RISC-V patch marker: missing $patch" >&2
return 1
fi

marker=$(tail -n 1 "$patch")
Comment thread
cbartz marked this conversation as resolved.
Resolved
baseline=${marker#"$prefix"}
if [[ "$marker" != "$prefix"* || -z "$baseline" ]] ||
[[ "$kind" == "commit" && ! "$baseline" =~ ^([0-9a-f]{40}|[0-9a-f]{64})$ ]] ||
[[ "$kind" == "release" && ! "$baseline" =~ ^v[0-9][0-9A-Za-z.+_-]*$ ]]; then
echo "Invalid RISC-V patch marker in $patch" >&2
return 1
fi

printf '%s\n' "$baseline"
}
# patch-sync-baseline:end

mkdir -p patches
touch successful_arches.txt

for arch in ppc64le s390x arm; do
for arch in ppc64le s390x arm riscv64; do
patch_baseline=$(patch_sync_baseline "$arch" "${ENABLE_RISCV64_BUILDS:-}" "${{ steps.get-commits.outputs.PREVIOUS_COMMIT }}" "patches/runner-main-sdk8-$arch.patch" commit)
if [[ -z "$patch_baseline" ]]; then
echo "Skipping $arch while RISC-V builds are disabled"
continue
fi
echo "Processing $arch..."
cd upstream-runner

Expand All @@ -82,13 +127,13 @@ jobs:

# Check if previous patch exists
if [ ! -f "../patches/runner-main-sdk8-$arch.patch" ] || \
! grep -q "${{ steps.get-commits.outputs.PREVIOUS_COMMIT }}" "../patches/runner-main-sdk8-$arch.patch"; then
! grep -Fq -- "$patch_baseline" "../patches/runner-main-sdk8-$arch.patch"; then
echo "::error::No valid previous patch for $arch"
exit 1
fi

# Apply previous patch to previous commit
git checkout ${{ steps.get-commits.outputs.PREVIOUS_COMMIT }}
git checkout "$patch_baseline"
if ! git apply --check --whitespace=nowarn "../patches/runner-main-sdk8-$arch.patch"; then
echo "::error::Previous patch application failed for $arch"
exit 1
Expand Down
Loading
Loading