Out of the box support
The Rwx alias, which returns an IRwxProvider instance, can be used to interact with the RWX environment. RWX exposes a documented environment variable contract that Cake maps to run, task, actor, git, and runtime metadata.
The following example prints the current RWX run id and title when the build runs on RWX:
if (BuildSystem.Rwx.IsRunningOnRwx)
{
Information(
"RWX run {0}: {1}",
BuildSystem.Rwx.Environment.Run.Id,
BuildSystem.Rwx.Environment.Run.Title);
}
else
{
Information("Not running on RWX");
}
Use BuildSystem.Rwx.Commands to write output values, export environment variables for downstream tasks,
and upload artifacts from your Cake script. See
RWX output values,
environment variables, and
artifacts for platform details.
See IRwxProvider for details and available members to interact with RWX.
Running Cake
RWX pipelines are defined in YAML. A typical flow clones your repository, installs .NET from global.json,
then runs Cake in a run step.
The recommended way to run the Cake .NET Tool on RWX is by using a tool manifest:
- key: build
use: install-dotnet
run: |
dotnet tool restore
dotnet cake
If you are using Cake.Sdk with a file-based script:
- key: build
use: install-dotnet
run: |
dotnet cake.cs
If you are using Cake.Sdk with a project, or Cake Frosting:
- key: build
use: install-dotnet
run: |
dotnet run --project cake.csproj
The following minimal pipeline checks out a commit, installs .NET, and runs all three Cake runners in one task (useful for validating multiple entry points in the same repository):
on:
github:
pull_request:
init:
commit-sha: ${{ event.git.sha }}
push:
- if: ${{ event.git.branch == 'develop' || event.git.branch == 'main' || starts-with(event.git.branch, 'hotfix/') }}
init:
commit-sha: ${{ event.git.sha }}
cli:
init:
commit-sha: ${{ event.git.sha }}
base:
image: ubuntu:26.04
config: rwx/base 1.1.1
tasks:
- key: code
call: git/clone 2.0.7
with:
repository: https://github.com/your-org/your-repo.git
ref: ${{ init.commit-sha }}
fetch-full-depth: true
preserve-git-dir: true
- key: install-dotnet
use: code
call: dotnet/install 1.0.0
with:
global-json-file: global.json
filter:
- global.json
- key: build
use: [code, install-dotnet]
run: |
# Cake Sdk
dotnet cake.cs
# Cake Tool
dotnet tool restore
dotnet cake
# Cake Frosting
dotnet run --project cake.csproj
Replace repository with your Git URL and keep only the run commands you need for your chosen runner.
Available 3rd party extensions
No extensions found
