{"id":13832134,"url":"https://github.com/msys2/setup-msys2","last_synced_at":"2025-05-14T02:04:57.642Z","repository":{"id":36977771,"uuid":"213203501","full_name":"msys2/setup-msys2","owner":"msys2","description":"GitHub Action to setup MSYS2","archived":false,"fork":false,"pushed_at":"2025-05-05T04:39:29.000Z","size":2747,"stargazers_count":338,"open_issues_count":24,"forks_count":43,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-05-10T17:41:16.540Z","etag":null,"topics":["actions","bash","ci","gha","mingw32","mingw64","msys2","windows","workflow"],"latest_commit_sha":null,"homepage":"https://github.com/marketplace/actions/setup-msys2","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/msys2.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-06T16:31:44.000Z","updated_at":"2025-04-29T09:15:15.000Z","dependencies_parsed_at":"2023-02-16T03:45:54.896Z","dependency_job_id":"eca16206-e563-43d1-9e79-e222346c0e61","html_url":"https://github.com/msys2/setup-msys2","commit_stats":{"total_commits":429,"total_committers":20,"mean_commits":21.45,"dds":0.6107226107226107,"last_synced_commit":"b8a8093f1b435a95e9ffe1d436149671f1f5bbc8"},"previous_names":[],"tags_count":63,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msys2%2Fsetup-msys2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msys2%2Fsetup-msys2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msys2%2Fsetup-msys2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msys2%2Fsetup-msys2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/msys2","download_url":"https://codeload.github.com/msys2/setup-msys2/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253910085,"owners_count":21982694,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["actions","bash","ci","gha","mingw32","mingw64","msys2","windows","workflow"],"created_at":"2024-08-04T10:01:52.290Z","updated_at":"2025-05-14T02:04:57.602Z","avatar_url":"https://github.com/msys2.png","language":"JavaScript","readme":"\u003cp align=\"center\"\u003e\n  \u003ca title=\"msys2.github.io\" href=\"https://msys2.github.io\"\u003e\u003cimg src=\"https://img.shields.io/website.svg?label=msys2.github.io\u0026longCache=true\u0026style=flat-square\u0026url=http%3A%2F%2Fmsys2.github.io%2Findex.html\u0026logo=github\"\u003e\u003c/a\u003e\u003c!--\n  --\u003e\n  \u003ca title=\"Join the chat at https://gitter.im/msys2/msys2\" href=\"https://gitter.im/msys2/msys2\"\u003e\u003cimg src=\"https://img.shields.io/badge/chat-on%20gitter-4db797.svg?longCache=true\u0026style=flat-square\u0026logo=gitter\u0026logoColor=e8ecef\u0026label=Chat\"\u003e\u003c/a\u003e\u003c!--\n  --\u003e\n  \u003ca title=\"'Test' workflow Status\" href=\"https://github.com/msys2/setup-msys2/actions/workflows/Test.yml\"\u003e\u003cimg alt=\"'Test' workflow Status\" src=\"https://img.shields.io/github/actions/workflow/status/msys2/setup-msys2/Test.yml?branch=main\u0026longCache=true\u0026style=flat-square\u0026label=Test\u0026logo=github\"\u003e\u003c/a\u003e\u003c!--\n  --\u003e\n  \u003ca title=\"'Example PKGBUILD' workflow Status\" href=\"https://github.com/msys2/setup-msys2/actions/workflows/Tool.yml\"\u003e\u003cimg alt=\"'Example PKGBUILD' workflow Status\" src=\"https://img.shields.io/github/actions/workflow/status/msys2/setup-msys2/Tool.yml?branch=main\u0026longCache=true\u0026style=flat-square\u0026label=Example%20PKGBUILD\u0026logo=github\"\u003e\u003c/a\u003e\u003c!--\n  --\u003e\n\u003c/p\u003e\n\n# Setup MSYS2\n\n**setup-msys2** is a GitHub Action (GHA) to setup an [MSYS2](https://www.msys2.org/) environment (i.e. MSYS,\nMINGW32, MINGW64, UCRT64, CLANG64 and/or CLANGARM64 shells)\n\nIt provides:\n\n* Easy installation and updates\n* Easy package installation including caching for faster re-runs\n* A shell helper for running your commands or your whole job in an MSYS2 environment\n\n## Usage\n\n```yaml\n  - uses: msys2/setup-msys2@v2\n```\n\nThen, for scripts:\n\n```yaml\n  - shell: msys2 {0}\n    run: |\n      uname -a\n```\n\nIt is also possible to execute specific commands from cmd/powershell scripts/snippets.\nIn order to do so, `-c` is required:\n\n```yaml\n  - shell: powershell\n    run: msys2 -c 'uname -a'\n```\n\n```yaml\n  - shell: cmd\n    run: msys2 -c 'uname -a'\n```\n\n### Default shell\n\nIn order to reduce verbosity, it is possible to set `msys2` as the default shell. For example:\n\n```yaml\n  defaults:\n    run:\n      shell: msys2 {0}\n  steps:\n  - uses: msys2/setup-msys2@v2\n    with:\n      update: true\n      install: \u003e-\n        curl\n        git\n  - uses: actions/checkout@v4\n```\n\n### Build matrix\n\nIt is common to test some package/tool on multiple environments, which typically requires installing different sets of\npackages through option `install`.\nGitHub Actions' `strategy` and `matrix` fields allow to do so, as explained in [docs.github.com: Running variations of jobs in a workflow](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/running-variations-of-jobs-in-a-workflow)\nand [docs.github.com: `jobs.\u003cjob_id\u003e.strategy.matrix`](https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#jobsjob_idstrategymatrix).\nSee, for instance:\n\n```yml\n  strategy:\n    matrix:\n      include:\n        - { sys: mingw64, env: x86_64 }\n        - { sys: mingw32, env: i686 }\n        - { sys: ucrt64,  env: ucrt-x86_64 }\n        - { sys: clang64, env: clang-x86_64 }\n  steps:\n    - uses: msys2/setup-msys2@v2\n      with:\n        msystem: ${{matrix.sys}}\n        install: mingw-w64-${{matrix.env}}-openssl\n```\n\nAlternatively, option `pacboy` allows using a single matrix variable:\n\n```yml\n  strategy:\n    matrix:\n      sys:\n        - mingw64\n        - mingw32\n        - ucrt64\n        - clang64\n  steps:\n    - uses: msys2/setup-msys2@v2\n      with:\n        msystem: ${{matrix.sys}}\n        pacboy: openssl:p\n```\n\nFurthermore, [.github/workflows/PKGBUILD.yml](.github/workflows/PKGBUILD.yml) is a [Reusable Workflow](https://docs.github.com/en/actions/sharing-automations/reusing-workflows)\nto build and test a package in GitHub Actions using a PKGBUILD recipe.\nIt can be used along with [matrix](./matrix) (a [Composite Action](https://docs.github.com/en/actions/sharing-automations/creating-actions/creating-a-composite-action)),\nas shown in [.github/workflows/Tool.yml](.github/workflows/Tool.yml).\n\nNote: By default, GitHub Actions terminates any running jobs if any job in matrix\nfails. This default behavior can be disabled by setting `fail-fast: false` in\nstrategy section. See\n[docs.github.com: `jobs.\u003cjob_id\u003e.strategy.fail-fast`](https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#jobsjob_idstrategyfail-fast)\nfor more details.\n\nFind similar patterns in the following workflows:\n\n- [examples/cmake.yml](examples/cmake.yml)\n- [msys2/MINGW-packages: .github/workflows/main.yml](https://github.com/msys2/MINGW-packages/blob/master/.github/workflows/main.yml)\n\nFind further details at [#171](https://github.com/msys2/setup-msys2/issues/171#issuecomment-961458598) and [#102](https://github.com/msys2/setup-msys2/issues/102).\n\n### Options\n\n#### msystem\n\n* Type: `string`\n* Allowed values: `MSYS | MINGW64 | MINGW32 | UCRT64 | CLANG64 | CLANGARM64`\n* Default: `MINGW64`\n\nThe default [environment](https://www.msys2.org/docs/environments/) that is used in the `msys2` command/shell provided by this action.\n\nMSYS2 recommends `UCRT64` nowadays as the default instead of `MINGW64`.\n\nFor example:\n\n```yaml\n  - uses: msys2/setup-msys2@v2\n    with:\n      msystem: UCRT64\n```\n\nThe environment can be later overridden using the `MSYSTEM` environment variable if needed.\nThis is useful when multiple commands need to be executed in different contexts.\nFor example, in order to build a PKGBUILD file and then test the installed artifact:\n\n```yaml\n  - uses: msys2/setup-msys2@v2\n    with:\n      msystem: MSYS\n  - shell: msys2 {0}\n    run: |\n      makepkg-mingw -sCLfc --noconfirm --noprogressbar\n      pacman --noconfirm -U mingw-w64-*-any.pkg.tar.xz\n  - run: |\n      set MSYSTEM=UCRT64\n      msys2 -c '\u003ccommand to test the package\u003e'\n```\n\n#### update\n\n* Type: `boolean`\n* Default: `false`\n\nBy default, the installation is not updated; hence package versions are those of the installation tarball.\nBy setting option `update` to `true`, the action will update the package database and all already installed packages.\n\n```yaml\n  - uses: msys2/setup-msys2@v2\n    with:\n      update: true\n```\n\n#### install\n\n* Type: `string`\n* Allowed values: a whitespace separated list of packages\n* Default: -\n\nInstalling additional packages after updating the system is supported through option `install`.\nThe package or list of packages are installed through `pacman --noconfirm -S --needed --overwrite *`.\n\n```yaml\n  - uses: msys2/setup-msys2@v2\n    with:\n      update: true\n      install: \u003e-\n        git\n        curl\n```\n\n#### pacboy\n\n* Type: `string`\n* Allowed values: s whitespace separated list of packages\n* Default: -\n\nInstalling additional packages with [pacboy](https://www.msys2.org/docs/package-naming/#avoiding-writing-long-package-names) after updating the system is supported through option `pacboy`.\nThe package or list of packages are installed through `pacboy --noconfirm -S --needed`.\n\n```yaml\n  strategy:\n    fail-fast: false\n    matrix:\n      sys: [ MINGW64, MINGW32, UCRT64, CLANG64 ]\n  steps:\n  - uses: msys2/setup-msys2@v2\n    with:\n      msystem: ${{matrix.sys}}\n      install: \u003e-\n        git\n        curl\n      pacboy: \u003e-\n        openssl:p\n```\n\n#### platform-check-severity\n\n* Type: `string`\n* Allowed values: `warn | fatal`\n* Default: `fatal`\n\nBy default (`fatal`), throw an error if the runner OS is not Windows.\nIf set to `warn`, simply log a message and skip the rest:\n\n```yaml\n  - uses: msys2/setup-msys2@v2\n    with:\n      platform-check-severity: warn\n```\n\n### Outputs\n\n#### msys2-location\n\nThe absolute path of the MSYS2 installation location. Example: `D:\\a\\_temp\\msys64` or `C:\\msys64`.\n\n```yaml\n  - uses: msys2/setup-msys2@v2\n    id: msys2\n  - env:\n      MSYS2_LOCATION: ${{ steps.msys2.outputs.msys2-location }}\n    run: echo \"$env:MSYS2_LOCATION\"\n```\n\nAvailable since v2.24.1\n\n### Advanced Options\n\nThese options are rarely needed and shouldn't be used unless there is a good reason.\n\n#### path-type\n\n* Type: `string`\n* Allowed values: `minimal | strict | inherit`\n* Default: `minimal`\n\nDefines which parts of the Windows `$env:PATH` environment variable leak into the MSYS2 environment.\nAllowed values:\n\n- `strict`: do not inherit anything from `$env:PATH`.\n- `minimal` *(default)*: only inherit the default Windows paths from `$env:PATH` (so that `cmd.exe` and `powershell.exe`\n  are available for example).\n- `inherit`: inherit everything; warning: this can lead to interference with other tools installed on the system.\n\n```yaml\n  - uses: msys2/setup-msys2@v2\n    with:\n      path-type: minimal\n```\n\nThis option corresponds to the `MSYS2_PATH_TYPE` setting in MSYS2; hence it can be overridden per step through `env`.\nSee [msys2/MSYS2-packages: filesystem/profile](https://github.com/msys2/MSYS2-packages/blob/915946a637e1f2b7e26e32782f3af322009293db/filesystem/profile#L28-L45)\nfor further details about the configuration of each option.\n\n#### cache\n\n* Type: `boolean`\n* Default: `true`\n\nBy default (`true`), caches various things between runs to make repeated runs faster.\n\n```yaml\n  - uses: msys2/setup-msys2@v2\n    with:\n      cache: false\n```\n\n#### location\n\n* Type: `string`\n* Default: -\n\nSpecify an alternate location where to install MSYS2 to.\n\n```yaml\n  - uses: msys2/setup-msys2@v2\n    with:\n      location: D:\\\n```\n\n#### release\n\n* Type: `boolean`\n* Default: `true`\n\nIf `true` (the default) it makes a fresh install of the latest MSYS2 installer release.\nIf `false` it will try to re-use the [existing MSYS2 installation](https://github.com/actions/runner-images/blob/main/images/windows/Windows2022-Readme.md#msys2) which is part of the official [GitHub Actions Runner Images](https://github.com/actions/runner-images).\n\n```yaml\n  - uses: msys2/setup-msys2@v2\n    with:\n      release: false\n```\n\n## Known Problems\n\n### actions/checkout and line endings\n\nIn case you use the [actions/checkout](https://github.com/actions/checkout) action in your workflow and haven't configured git attributes for line endings, then git might auto convert your text files in the git repo to Windows line endings, which might lead to problems with tools provided by MSYS2.\n\nTo work around this issue disable the auto conversion before running `actions/checkout`:\n\n```yaml\n  steps:\n  - run: git config --global core.autocrlf input\n  - uses: actions/checkout@v4\n```\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsys2%2Fsetup-msys2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmsys2%2Fsetup-msys2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsys2%2Fsetup-msys2/lists"}