You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+42-16Lines changed: 42 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -10,11 +10,16 @@
10
10
11
11
# Setup MSYS2
12
12
13
-
**setup-msys2** is a JavaScript GitHub Action (GHA) to setup an [MSYS2](https://www.msys2.org/) environment (i.e. MSYS, MINGW32, MINGW64 and/or UCRT64 shells) using the GHA [toolkit](https://github.com/actions/toolkit) for automatic caching.
13
+
**setup-msys2** is a JavaScript GitHub Action (GHA) to setup an [MSYS2](https://www.msys2.org/) environment (i.e. MSYS,
14
+
MINGW32, MINGW64, UCRT64 and/or CLANG64 shells) using the GHA [toolkit](https://github.com/actions/toolkit) for
15
+
automatic caching.
14
16
15
17
## Context
16
18
17
-
[MSYS2](https://www.msys2.org/) is available by default in [windows-latest](https://github.com/actions/virtual-environments/blob/master/images/win/Windows2019-Readme.md#msys2)[virtual environment](https://github.com/actions/virtual-environments) for GitHub Actions, located at `C:\msys64`. Moreover, there is work in progress for making `bash` default to MSYS2 (see [actions/virtual-environments#1525](https://github.com/actions/virtual-environments/issues/1525)). However, the default installation has some caveats at the moment (see [actions/virtual-environments#1572](https://github.com/actions/virtual-environments/issues/1572)):
19
+
[MSYS2](https://www.msys2.org/) is available by default in [windows-latest](https://github.com/actions/virtual-environments/blob/master/images/win/Windows2019-Readme.md#msys2)
20
+
[virtual environment](https://github.com/actions/virtual-environments) for GitHub Actions, located at `C:\msys64`.
21
+
Moreover, there is work in progress for making `bash` default to MSYS2 (see [actions/virtual-environments#1525](https://github.com/actions/virtual-environments/issues/1525)).
22
+
However, the default installation has some caveats at the moment (see [actions/virtual-environments#1572](https://github.com/actions/virtual-environments/issues/1572)):
18
23
19
24
- It is updated every ~10 days.
20
25
- It includes a non-negligible set of pre-installed packages. As a result, update time can be up to 10 min.
@@ -23,10 +28,14 @@
23
28
24
29
**setup-msys2** works around those constraints:
25
30
26
-
- Using option `release: false`, the default installation is used, but automatic caching is supported and a custom entrypoint is provided.
27
-
- By default (`release: true`), **setup-msys2** downloads and extracts the latest tarball available at [repo.msys2.org/distrib/x86_64](http://repo.msys2.org/distrib/x86_64/), a clean and up-to-date environment is set up in a temporary location, and a custom entrypoint (`msys2`) is provided. Hence, the overhead of updating pre-installed but unnecessary packages is avoided.
31
+
- Using option `release: false`, the default installation is used, but automatic caching is supported and a custom
32
+
entrypoint is provided.
33
+
- By default (`release: true`), **setup-msys2** downloads and extracts the latest tarball available at [repo.msys2.org/distrib/x86_64](http://repo.msys2.org/distrib/x86_64/),
34
+
a clean and up-to-date environment is set up in a temporary location, and a custom entrypoint (`msys2`) is provided.
35
+
Hence, the overhead of updating pre-installed but unnecessary packages is avoided.
28
36
29
-
Therefore, usage of this Action is recommended to all MSYS2 users of GitHub Actions, since caching and the custom entrypoint are provided regardless of option `release`.
37
+
Therefore, usage of this Action is recommended to all MSYS2 users of GitHub Actions, since caching and the custom
38
+
entrypoint are provided regardless of option `release`.
30
39
31
40
## Usage
32
41
@@ -42,7 +51,8 @@ Then, for scripts:
42
51
uname -a
43
52
```
44
53
45
-
It is also possible to execute specific commands from cmd/powershell scripts/snippets. In order to do so, `-c` is required:
54
+
It is also possible to execute specific commands from cmd/powershell scripts/snippets.
55
+
In order to do so, `-c` is required:
46
56
47
57
```yaml
48
58
- shell: powershell
@@ -75,11 +85,16 @@ In order to reduce verbosity, it is possible to set `msys2` as the default shell
75
85
- run: git describe --dirty
76
86
```
77
87
78
-
Note that setting `autocrlf` is required in specific use cases only. See [actions/checkout#250](https://github.com/actions/checkout/issues/250).
88
+
Note that setting `autocrlf` is required in specific use cases only.
89
+
See [actions/checkout#250](https://github.com/actions/checkout/issues/250).
79
90
80
91
### Build matrix
81
92
82
-
It is common to test some package/tool on MINGW32 (32 bit) and MINGW64 (64 bit), which typically requires installing different sets of packages through option `install`. GitHub Actions' `strategy` and `matrix` fields allow to do so, as explained in [docs.github.com: Configuring a build matrix](https://docs.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#configuring-a-build-matrix) and [docs.github.com: `jobs.<job_id>.strategy.matrix`](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstrategymatrix). See, for example:
93
+
It is common to test some package/tool on MINGW32 (32 bit) and MINGW64 (64 bit), which typically requires installing
94
+
different sets of packages through option `install`.
95
+
GitHub Actions' `strategy` and `matrix` fields allow to do so, as explained in [docs.github.com: Configuring a build matrix](https://docs.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#configuring-a-build-matrix)
96
+
and [docs.github.com: `jobs.<job_id>.strategy.matrix`](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstrategymatrix).
@@ -90,15 +105,19 @@ Find further details at [#40](https://github.com/msys2/setup-msys2/issues/40) an
90
105
91
106
#### msystem
92
107
93
-
By default, `MSYSTEM` is set to `MINGW64`. However, an optional parameter named `msystem` is supported, which expects `MSYS`, `MINGW64`, `MINGW32` or `UCRT64`. For example:
108
+
By default, `MSYSTEM` is set to `MINGW64`. However, an optional parameter named `msystem` is supported, which expects
109
+
`MSYS`, `MINGW64`, `MINGW32`, `UCRT64` or `CLANG64`.
110
+
For example:
94
111
95
112
```yaml
96
113
- uses: msys2/setup-msys2@v2
97
114
with:
98
115
msystem: MSYS
99
116
```
100
117
101
-
Furthermore, the environment variable can be overridden. 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:
118
+
Furthermore, the environment variable can be overridden.
119
+
This is useful when multiple commands need to be executed in different contexts.
120
+
For example, in order to build a PKGBUILD file and then test the installed artifact:
102
121
103
122
```yaml
104
123
- uses: msys2/setup-msys2@v2
@@ -115,10 +134,12 @@ Furthermore, the environment variable can be overridden. This is useful when mul
115
134
116
135
#### path-type
117
136
118
-
Defines which parts of the Windows `$env:PATH` environment variable leak into the MSYS2 environment. Allowed values:
137
+
Defines which parts of the Windows `$env:PATH` environment variable leak into the MSYS2 environment.
138
+
Allowed values:
119
139
120
140
- `strict`: do not inherit anything from `$env:PATH`.
121
-
- `minimal` *(default)*: only inherit the default Windows paths from `$env:PATH` (so that `cmd.exe` and `powershell.exe` are available for example).
141
+
- `minimal` *(default)*: only inherit the default Windows paths from `$env:PATH` (so that `cmd.exe` and `powershell.exe`
142
+
are available for example).
122
143
- `inherit`: inherit everything; warning: this can lead to interference with other tools installed on the system.
123
144
124
145
```yaml
@@ -127,11 +148,14 @@ Defines which parts of the Windows `$env:PATH` environment variable leak into th
127
148
path-type: minimal
128
149
```
129
150
130
-
This option corresponds to the `MSYS2_PATH_TYPE` setting in MSYS2; hence it can be set per step through `env`. See [msys2/MSYS2-packages: filesystem/profile](https://github.com/msys2/MSYS2-packages/blob/915946a637e1f2b7e26e32782f3af322009293db/filesystem/profile#L28-L45) for further details about the configuration of each option.
151
+
This option corresponds to the `MSYS2_PATH_TYPE` setting in MSYS2; hence it can be set per step through `env`.
152
+
See [msys2/MSYS2-packages: filesystem/profile](https://github.com/msys2/MSYS2-packages/blob/915946a637e1f2b7e26e32782f3af322009293db/filesystem/profile#L28-L45)
153
+
for further details about the configuration of each option.
131
154
132
155
#### release
133
156
134
-
By default (`true`), retrieve and extract base installation from upstream GitHub Releases. If set to `false`, the installation available in the virtual environment is used:
157
+
By default (`true`), retrieve and extract base installation from upstream GitHub Releases.
158
+
If set to `false`, the installation available in the virtual environment is used:
135
159
136
160
```yaml
137
161
- uses: msys2/setup-msys2@v2
@@ -141,7 +165,8 @@ By default (`true`), retrieve and extract base installation from upstream GitHub
141
165
142
166
#### update
143
167
144
-
By default, the installation is not updated; hence package versions are those of the installation tarball. By setting option `update` to `true`, the action will try to update the runtime and packages cleanly:
168
+
By default, the installation is not updated; hence package versions are those of the installation tarball.
169
+
By setting option `update` to `true`, the action will try to update the runtime and packages cleanly:
145
170
146
171
```yaml
147
172
- uses: msys2/setup-msys2@v2
@@ -151,7 +176,8 @@ By default, the installation is not updated; hence package versions are those of
151
176
152
177
#### install
153
178
154
-
Installing additional packages after updating the system is supported through option `install`. The package or list of packages are installed through `pacman --noconfirm -S --needed`.
179
+
Installing additional packages after updating the system is supported through option `install`.
180
+
The package or list of packages are installed through `pacman --noconfirm -S --needed`.
0 commit comments