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.
Find a file
Michael J. Manley 9b0c98b5be
All checks were successful
Test RAD Studio env Action / test32 (push) Successful in 8s
Test RAD Studio env Action / test64 (push) Successful in 3s
Fixed ReadMe
2025-10-01 09:49:00 -07:00
.forgejo/workflows Added Arch Function 2025-10-01 08:47:52 -07:00
action.yml Added Arch Function 2025-10-01 08:47:52 -07:00
README.md Fixed ReadMe 2025-10-01 09:49:00 -07:00

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 Studios 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.bat or %BASE_DIR%\bin64\rsvars64.bat in a cmd shell.
  • Extracts key environment variables (BDS, BDSINCLUDE, BDSCOMMONDIR, FrameworkDir, FrameworkVersion, FrameworkSDKDir, PATH, LANGDIR, PLATFORM, PlatformSDK).
  • Persists them to GITHUB_ENV so they are available in all later steps.

Notes

  • Windows-only: requires cmd.exe and RAD Studio installed.
  • If RAD Studio is not installed at the default path, set base-dir accordingly.