Skip to content
Draft
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
69 changes: 69 additions & 0 deletions .github/release-note-canonical.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,72 @@ 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 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. Once a native
Ubuntu 24.04 RISC-V builder with the self-hosted labels `noble`, `generic` and
`riscv64` is available, 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`. 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. Enabled releases run the
RISC-V L0 tests and package smoke test, 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.
68 changes: 62 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,48 @@ jobs:
runs_on: s390x
patch_tag: s390x

runs-on: [ self-hosted, noble, generic, "${{ matrix.runs_on }}" ]
runs-on: [ self-hosted, noble, generic, "${{ matrix.runs_on || 'riscv64' }}" ]
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

- name: Install community RISC-V DotNet SDK
if: matrix.runtime == 'linux-riscv64'
run: |
# riscv64-dotnet-setup:start
set -euo pipefail

version=10.0.115
sha256=f06bcd3f7cff2781711150ae817190ce67d630b075be0b0aedeb021049c8a0d4
archive="${RUNNER_TEMP:?}/dotnet-sdk-${version}-linux-riscv64.tar.gz"
sdk_dir="${RUNNER_TEMP}/dotnet-riscv64-${version}"

curl -fsSL --retry 3 -o "$archive" \
"https://github.com/filipnavara/dotnet-riscv/releases/download/${version}/dotnet-sdk-${version}-linux-riscv64.tar.gz"
printf '%s %s\n' "$sha256" "$archive" | sha256sum --check
mkdir -p "$sdk_dir"
tar -xzf "$archive" -C "$sdk_dir"
rm "$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 @@ -77,7 +106,34 @@ jobs:

# 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
if: matrix.runtime == 'linux-x64' || matrix.runtime == 'linux-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 +143,7 @@ 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'
if: matrix.runtime == 'linux-x64' || matrix.runtime == 'linux-riscv64'


# L0 uses DEBUG-only test hooks; keep Release layout/package validation separate.
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")
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
55 changes: 50 additions & 5 deletions .github/workflows/patch_update_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,56 @@ jobs:
- name: Process architectures
if: steps.get-tags.outputs.PREVIOUS_TAG != '' && steps.get-tags.outputs.PREVIOUS_TAG != steps.get-tags.outputs.LATEST_TAG
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")
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-tags.outputs.PREVIOUS_TAG }}" "patches/runner-sdk8-$arch.patch" release)
if [[ -z "$patch_baseline" ]]; then
echo "Skipping $arch while RISC-V builds are disabled"
continue
fi
echo "Processing $arch..."
cd upstream-runner

Expand All @@ -96,16 +141,16 @@ jobs:

# Check if previous patch exists
if [ ! -f "../patches/runner-sdk8-$arch.patch" ] || \
! grep -q "${{ steps.get-tags.outputs.PREVIOUS_TAG }}" "../patches/runner-sdk8-$arch.patch"; then
echo "::error::No valid previous patch for $arch — patch file missing or does not reference ${{ steps.get-tags.outputs.PREVIOUS_TAG }}"
! grep -Fq -- "$patch_baseline" "../patches/runner-sdk8-$arch.patch"; then
echo "::error::No valid previous patch for $arch — patch file missing or does not reference $patch_baseline"
cd ..
exit 1
fi

# Apply previous patch to previous release
git checkout ${{ steps.get-tags.outputs.PREVIOUS_TAG }}
git checkout "$patch_baseline"
if ! git apply --check --whitespace=nowarn "../patches/runner-sdk8-$arch.patch"; then
echo "::error::Previous patch application failed for $arch — patch does not apply cleanly to ${{ steps.get-tags.outputs.PREVIOUS_TAG }}"
echo "::error::Previous patch application failed for $arch — patch does not apply cleanly to $patch_baseline"
cd ..
exit 1
fi
Expand Down
Loading
Loading