Downloads/caches a portable MSYS2 install and installs a given pacman package list, via actions/tool-cache + actions/cache
  • TypeScript 100%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
techwritescode 433df770d5 Fix extractTar's wrong default compression flag; add a cache-hit output
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]>
2026-09-10 13:53:57 -05:00
dist Fix extractTar's wrong default compression flag; add a cache-hit output 2026-09-10 13:53:57 -05:00
src Fix extractTar's wrong default compression flag; add a cache-hit output 2026-09-10 13:53:57 -05:00
.gitignore Initial implementation: setup-msys2 action 2026-09-10 13:37:49 -05:00
action.yaml Fix extractTar's wrong default compression flag; add a cache-hit output 2026-09-10 13:53:57 -05:00
package-lock.json Initial implementation: setup-msys2 action 2026-09-10 13:37:49 -05:00
package.json Add a post step to clean up temp state, and fix the real destination-exists bug 2026-09-10 13:45:04 -05:00
README.md Initial implementation: setup-msys2 action 2026-09-10 13:37:49 -05:00
tsconfig.json Initial implementation: setup-msys2 action 2026-09-10 13:37:49 -05:00

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