Sets the environment to the proper C++ Build Environment for Wise GCC Toolset.
- PowerShell 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| action.yml | ||
| README.md | ||
| Set-BuildVars.ps1 | ||
setvars action
Sources C:/build/setvars64.bat (or setvars32.bat) and pushes every variable it
sets into the job environment, so all later steps inherit the toolchain.
A batch file runs in its own cmd.exe; its set calls vanish when that process
exits. This action dumps the environment before and after calling the script
inside a single cmd.exe, diffs the two, and republishes the delta through
$GITHUB_ENV (which Forgejo's runner honours).
Usage
- uses: actions/checkout@v4
- uses: ./.forgejo/actions/setvars
with:
arch: '64'
Requires a self-hosted Windows runner running jobs on the host (not in a
container), since it reads C:/build.
Inputs
| Input | Default | Description |
|---|---|---|
arch |
64 |
64 or 32. x64/amd64/x86/win32 also accepted. |
root |
C:/build |
Directory containing setvars64.bat / setvars32.bat. |
script |
(empty) | Full path to a specific vars script; overrides arch/root. |
path-mode |
env |
env writes the full resolved PATH to GITHUB_ENV. github-path appends only the newly added entries to GITHUB_PATH. |
Outputs
| Output | Description |
|---|---|
script-path |
Absolute path of the script that was sourced. |
changed-vars |
Comma-separated names of the exported variables. |
Notes
- Values are written using the
NAME<<delimiterheredoc form, so multi-line and quote-containing values survive intact. PATHdefaults topath-mode: envbecause that reproduces the script's ordering exactly.github-pathis the more idiomatic mechanism, but runners differ on the order in which they prepend multipleGITHUB_PATHlines — only use it if you don't care about the relative order of the added directories.- Variables the script unsets cannot be removed via
GITHUB_ENV; the action emits a warning if that happens. - Nothing about it is toolchain-specific — point
scriptatvcvars64.bator any other batch file and it behaves the same way.
Using it from other repos
Move this directory into its own Forgejo repo (with action.yml at the root) and
reference it as uses: your-org/setvars-action@v1.