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 an entrypoint named msys2do.
- uses: numworks/setup-msys2@v1
- 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: numworks/setup-msys2@v1
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: numworks/setup-msys2@v1
with:
msystem: MSYS
- run: msys2do makepkg-mingw -sCLfc --noconfirm --noprogressbar
- run: msys2do 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: numworks/setup-msys2@v1
with:
path-type: inherit
- run: msys2do <command> - uses: numworks/setup-msys2@v1
- 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: numworks/setup-msys2@v1
with:
update: true