|
10 | 10 |
|
11 | 11 | # Setup MSYS2
|
12 | 12 |
|
13 |
| -[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 for GitHub Actions. However, the default installation is updated every ~10 days, and it includes some pre-installed packages. As a result, startup time can be up to 10 min. Moreover, MSYS2/MINGW are neither added to the PATH nor available as a custom `shell` option. |
| 13 | +**setup-msys2** is a JavaScript GitHub Action (GHA) to setup an [MSYS2](https://www.msys2.org/) environment (i.e. MSYS, MINGW32 and/or MINGW64 shells) using the GHA [toolkit](https://github.com/actions/toolkit) for automatic caching. |
14 | 14 |
|
15 |
| -**setup-msys2** is a JavaScript GitHub Action (GHA) to optionally setup an up-to-date and stable [MSYS2](https://www.msys2.org/) environment in a temporal location, using the GHA [toolkit](https://github.com/actions/toolkit). Moreover, it provides a custom entrypoint. |
| 15 | +## Context |
16 | 16 |
|
17 |
| -If option `release` is `false`, the default installation is used. Otherwise (by default), the latest tarball available at [repo.msys2.org/distrib/x86_64](http://repo.msys2.org/distrib/x86_64/) is downloaded and extracted. |
| 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)): |
| 18 | + |
| 19 | +- It is updated every ~10 days. |
| 20 | +- It includes a non-negligible set of pre-installed packages. As a result, update time can be up to 10 min. |
| 21 | +- Caching of installation packages is not supported. |
| 22 | +- MSYS2/MINGW are neither added to the PATH nor available as a custom `shell` option. |
| 23 | + |
| 24 | +**setup-msys2** works around those constraints: |
| 25 | + |
| 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. |
| 28 | + |
| 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`. |
18 | 30 |
|
19 | 31 | ## Usage
|
20 | 32 |
|
@@ -54,7 +66,9 @@ In order to reduce verbosity, it is possible to set `msys2` as the default shell
|
54 | 66 | - uses: msys2/setup-msys2@v2
|
55 | 67 | with:
|
56 | 68 | update: true
|
57 |
| - install: base-devel git |
| 69 | + install: >- |
| 70 | + base-devel |
| 71 | + git |
58 | 72 | #- run: git config --global core.autocrlf input
|
59 | 73 | # shell: bash
|
60 | 74 | - uses: actions/checkout@v2
|
@@ -143,39 +157,7 @@ Installing additional packages after updating the system is supported through op
|
143 | 157 | - uses: msys2/setup-msys2@v2
|
144 | 158 | with:
|
145 | 159 | update: true
|
146 |
| - install: 'git base-devel' |
| 160 | + install: >- |
| 161 | + git |
| 162 | + base-devel |
147 | 163 | ```
|
148 |
| - |
149 |
| -## Development |
150 |
| - |
151 |
| -The steps to publish a new release are the following: |
152 |
| - |
153 |
| -```sh |
154 |
| -# Remove/clean dir 'dist' |
155 |
| -rm -rf dist |
156 |
| -
|
157 |
| -# Package the action with ncc |
158 |
| -yarn pkg |
159 |
| -
|
160 |
| -# - Copy release artifacts to subdir dir |
161 |
| -# - Create a new orphan branch in a new empty repo |
162 |
| -# - Push the branch |
163 |
| -./release.sh v2.x.x |
164 |
| -
|
165 |
| -# Fetch the new branch and checkout it |
166 |
| -git fetch --all |
167 |
| -git checkout -b tmp origin/v2.x.x |
168 |
| -
|
169 |
| -# Reset the 'rolling' tag to the just released branch |
170 |
| -git tag -d v2 |
171 |
| -git tag v2 |
172 |
| -git push origin +v2 |
173 |
| -
|
174 |
| -# Remove the temporal branch |
175 |
| -git checkout master |
176 |
| -git branch -D tmp |
177 |
| -``` |
178 |
| - |
179 |
| -> NOTE: although it feels unidiomatic having 'rolling' tags and/or storing release assets in specific branches, it is the recommended solution. Retrieving assets from GitHub Releases is not supported by GitHub Actions (yet). See [actions/javascript-action: Create a release branch](https://github.com/actions/javascript-action#create-a-release-branch), [actions/toolkit: docs/action-versioning.md](https://github.com/actions/toolkit/blob/master/docs/action-versioning.md) and [actions/toolkit#214](https://github.com/actions/toolkit/issues/214). |
180 |
| - |
181 |
| -> NOTE: tag `tag-for-git-describe` is used for testing `git describe --dirty --tags` in CI. See [actions/checkout#250](https://github.com/actions/checkout/issues/250). |
0 commit comments