setup-msys2 is a JavaScript GitHub Action (GHA) to setup a full-featured MSYS2 environment, using the GHA toolkit.
The latest tarball available at repo.msys2.org/distrib/x86_64 is cached. Using the action extracts it and provides two entrypoints named msys2 and msys2do.
- uses: stalkerg/setup-msys2@v2
- shell: msys2 {0}
run: uname -a - uses: stalkerg/setup-msys2@v2
- run: msys2do uname -aBy default, MSYSTEM is set to MINGW64. However, an optional parameter named msystem is supported, which expects MSYS, MINGW64 or MING32. For example:
- uses: stalkerg/setup-msys2@v2
with:
msystem: MSYSFurthermore, the environment variable can be overriden. This is useful when multiple commands need to be executed in different contexts. For example, in order to build a PKGBUILD file and then test the installed artifact:
- uses: stalkerg/setup-msys2@v2
with:
msystem: MSYS
- shell: msys2
run: |
makepkg-mingw -sCLfc --noconfirm --noprogressbar
pacman --noconfirm -U mingw-w64-*-any.pkg.tar.xz
- run: |
set MSYSTEM=MINGW64
msys2do <command to test the package>By default, MSYS2_PATH_TYPE is set to strict by msys2do. It is possible to override it either using an option or setting the environment variable explicitly:
- uses: stalkerg/setup-msys2@v2
with:
path-type: inherit
- run: msys2do <command> - uses: stalkerg/setup-msys2@v2
- run: msys2do <command>
env:
MSYS2_PATH_TYPE: inheritBy default, the installation is not updated; hence package versions are those of the installation tarball. By setting option update to true, the action will execute pacman -Syu --no-confirm:
- uses: stalkerg/setup-msys2@v2
with:
update: true