A GitHub Action that loads the Embarcadero RAD Studio environment (
rsvars.bat) and persists the variables (such as BDS, PATH, FrameworkDir, etc.) for all subsequent steps in your workflow.
| .forgejo/workflows | ||
| action.yml | ||
| README.md | ||
setup-radstudio
A GitHub Action that loads the Embarcadero RAD Studio environment (rsvars.bat) and persists the variables (such as BDS, PATH, FrameworkDir, etc.) for all subsequent steps in your workflow.
Why?
RAD Studio’s rsvars.bat sets up compiler and SDK paths required for building Delphi/C++Builder projects. This action calls that batch file and writes the relevant environment variables into GITHUB_ENV, so they are available to later steps in the job.
Usage
jobs:
build:
runs-on: windows-2022 # Or a self-hosted Windows runner with RAD Studio installed
steps:
- uses: actions/checkout@v4
# Use default install path (C:\Program Files (x86)\Embarcadero\Studio\37.0)
- name: Setup RAD Studio environment
uses: actions/setup-radstudio@v1
# Or override with a custom base directory
- name: Setup RAD Studio (custom install)
uses: actions/setup-radstudio@v1
with:
base-dir: 'D:\RAD\Studio\37.0'
# Or use the 64 environment
- name: Setup RAD Studio (custom install)
uses: actions/setup-radstudio@v1
with:
arch: "64"
- name: Verify environment
shell: cmd
run: |
echo BDS=%BDS%
echo PATH=%PATH%
- name: Build
shell: cmd
run: msbuild MyProject.sln
Inputs
| Name | Description | Default |
|---|---|---|
base-dir |
Base RAD Studio directory. The action will look for bin\rsvars.bat under this path. |
C:\Program Files (x86)\Embarcadero\Studio\37.0 |
arch |
Architecture. The action will look for bin\rsvars.bat on 32-bit bin64\rsvars64.bat on 64-bit |
32 |
How it works
- Calls
%BASE_DIR%\bin\rsvars.bator%BASE_DIR%\bin64\rsvars64.batin acmdshell. - Extracts key environment variables (
BDS,BDSINCLUDE,BDSCOMMONDIR,FrameworkDir,FrameworkVersion,FrameworkSDKDir,PATH,LANGDIR,PLATFORM,PlatformSDK). - Persists them to
GITHUB_ENVso they are available in all later steps.
Notes
- Windows-only: requires
cmd.exeand RAD Studio installed. - If RAD Studio is not installed at the default path, set
base-diraccordingly.