Skip to content

Commit d64998a

Browse files
einelazka
authored andcommitted
v2.3.0 1dffee8
1 parent 74b2d84 commit d64998a

File tree

3 files changed

+44
-18
lines changed

3 files changed

+44
-18
lines changed

README.md

Lines changed: 42 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,16 @@
1010

1111
# Setup MSYS2
1212

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.
1416

1517
## Context
1618

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)):
1823

1924
- It is updated every ~10 days.
2025
- 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 @@
2328

2429
**setup-msys2** works around those constraints:
2530

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.
2836

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`.
3039

3140
## Usage
3241

@@ -42,7 +51,8 @@ Then, for scripts:
4251
uname -a
4352
```
4453
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:
4656

4757
```yaml
4858
- shell: powershell
@@ -75,11 +85,16 @@ In order to reduce verbosity, it is possible to set `msys2` as the default shell
7585
- run: git describe --dirty
7686
```
7787

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).
7990

8091
### Build matrix
8192

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).
97+
See, for example:
8398

8499
- [msys2/MINGW-packages: .github/workflows/main.yml](https://github.com/msys2/MINGW-packages/blob/master/.github/workflows/main.yml).
85100
- [ghdl/ghdl: .github/workflows/push.yml](https://github.com/ghdl/ghdl/blob/99b542c849311c92e87e2c70d283de133c9d4093/.github/workflows/push.yml#L56-L102).
@@ -90,15 +105,19 @@ Find further details at [#40](https://github.com/msys2/setup-msys2/issues/40) an
90105

91106
#### msystem
92107

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:
94111

95112
```yaml
96113
- uses: msys2/setup-msys2@v2
97114
with:
98115
msystem: MSYS
99116
```
100117

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:
102121

103122
```yaml
104123
- uses: msys2/setup-msys2@v2
@@ -115,10 +134,12 @@ Furthermore, the environment variable can be overridden. This is useful when mul
115134

116135
#### path-type
117136

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:
119139

120140
- `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).
122143
- `inherit`: inherit everything; warning: this can lead to interference with other tools installed on the system.
123144

124145
```yaml
@@ -127,11 +148,14 @@ Defines which parts of the Windows `$env:PATH` environment variable leak into th
127148
path-type: minimal
128149
```
129150

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.
131154

132155
#### release
133156

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:
135159

136160
```yaml
137161
- uses: msys2/setup-msys2@v2
@@ -141,7 +165,8 @@ By default (`true`), retrieve and extract base installation from upstream GitHub
141165

142166
#### update
143167

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:
145170

146171
```yaml
147172
- uses: msys2/setup-msys2@v2
@@ -151,7 +176,8 @@ By default, the installation is not updated; hence package versions are those of
151176

152177
#### install
153178

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`.
155181

156182
```yaml
157183
- uses: msys2/setup-msys2@v2

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ branding:
55
icon: terminal
66
inputs:
77
msystem:
8-
description: 'Variant of the environment to set by default: MSYS, MINGW32, MINGW64 or UCRT64'
8+
description: 'Variant of the environment to set by default: MSYS, MINGW32, MINGW64, UCRT64 or CLANG64'
99
required: false
1010
default: 'MINGW64'
1111
path-type:

index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)