Downloads/caches a portable MSYS2 install and installs a given pacman package list, via actions/tool-cache + actions/cache
- TypeScript 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
Real bug found via an actual test run: extractTar's own default flags
("xz", meaning -x -z i.e. gzip) happened to work only because Windows'
built-in tar.exe (bsdtar) auto-detects real compression and ignores
that wrong hint - a real GNU tar (this action's own earlier addPath
put MSYS2's own tar ahead of it on PATH for a second same-job
invocation) takes -z literally and fails on actual xz content
("gzip: stdin: not in gzip format"). Explicit -x -J now, correct on
both.
cache-hit output added (matching actions/cache's own convention) so a
caller can assert hit-vs-miss directly instead of inferring it from
logs - also revealed that a saved cache isn't restorable within the
same job that saved it (real actions/cache semantics), which the test
workflow's original two-calls-in-one-job design didn't account for.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
|
||
| dist | ||
| src | ||
| .gitignore | ||
| action.yaml | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
setup-msys2
Installs a portable MSYS2 environment and a given
pacman package list, then caches the fully-installed directory (base
system + packages) via @actions/cache - a cache hit skips the download,
extraction, and package install entirely. Download/extraction uses
@actions/tool-cache.
Usage
- uses: https://git.techwritescode.dev/techwritescode/setup-msys2@master
with:
destination: build\msys2
packages: |
base-devel
git
mingw-w64-x86_64-toolchain
mingw-w64-x86_64-cmake
Inputs
| Input | Required | Description |
|---|---|---|
packages |
yes | Pacman packages to install, space- or newline-separated |
destination |
no | Directory to install MSYS2 into (defaults to a path under RUNNER_TEMP) |
version |
no | MSYS2 base-tarball release tag (msys2/msys2-installer) - default nightly-x86_64 |
Outputs
| Output | Description |
|---|---|
msys2-root |
Absolute path to the installed MSYS2 root |
bash-path |
Absolute path to usr/bin/bash.exe under the installed root |
usr/bin is also added to PATH.
Development
npm install
npm run build # writes dist/main/index.js - commit it, this is what actually runs