Comments (5)
FYI, in a custom action of mine I ended up creating a bash-or-msys2
symlink pointing to bash
on Linux / Mac OS, and msys2.cmd
on Windows; thanks to that, and the fact that I used it as shell
parameter for some of my action steps (i.e. shell: bash-or-msys2 {0}
), I saved myself from duplicating a bunch of steps simply because it's still not possible to inject shell to composite action (see: that actions/runner#835).
- name: Create bash-or-msys2
shell: bash
run: |
if [[ "$RUNNER_OS" == "Windows" ]]; then
powershell New-Item -ItemType SymbolicLink \
-Path "D:/a/_temp/setup-msys2/bash-or-msys2.cmd" \
-Target "D:/a/_temp/setup-msys2/msys2.cmd"
else
sudo ln -sf $(which bash) /usr/local/bin/bash-or-msys2
fi
...
- name: Upgrade ASDF to the Latest Version
shell: bash-or-msys2 {0}
run: |
if [[ "${{ inputs.asdf-version }}" != "latest" ]]; then
echo ::group::Installing ASDF ${{ inputs.asdf-version }}
ros install asdf/${{ inputs.asdf-version }}
else
echo ::group::Installing latest ASDF
ros install asdf
fi
echo ::endgroup::
Hope it helps!
from setup-msys2.
Hi @newhoggy! I think it's ok not to fail on non-Windows platforms but display a warning instead.
With regard to msysdo
, unfortunately it is not possible to have the same file behave differently, because it's a cmd
file. The non-Windows execution would need to create a different file. Instead, I think that an alias msys2=bash
should be created. Either shell: bash {0}
or run: bash -c 'uname -a'
are valid commands.
Do you want to give it a try?
from setup-msys2.
Is there a way to make alias msys2=bash
persist between jobs? The commands I want to run under msys2
are scattered amongst multiple jobs?
from setup-msys2.
Note that currently setup-msys2 is not persistent between jobs. It works for multiple steps, but it needs to be executed in each job.
From a technical point of view, rather than an alias, you might want to symlink e.g. /usr/bin/msys2
to /usr/bin/bash
. That's actually the "interesting" issue of this feature: finding the solution that is preserved properly.
For using msys2 in multiple step, set it as a global shell. See https://github.com/msys2/setup-msys2#usage
from setup-msys2.
Option platform-check-severity
was added in v2.6.0. See #172 and https://github.com/msys2/setup-msys2/blob/master/CHANGELOG.md#260---20211103.
from setup-msys2.
Related Issues (20)
- Extend action to support Ubuntu runner? HOT 7
- Feature: option for disable caching HOT 5
- "powershell.exe" renamed to "pwsh.exe" HOT 2
- Failed install? HOT 2
- ERROR in dll HOT 8
- Tag releases with semver tag HOT 5
- ctest fails as test-binaries are missing, even though cmake-build of those binaries shows no error HOT 1
- update to node20 HOT 2
- Cache package databases HOT 1
- Get "verified" badge for msys2/setup-msys2 on github marketplace HOT 4
- sometimes action is very slow HOT 11
- Provide alternative for $GITHUB_PATH inside MSYS2 with path-type: minimal HOT 8
- [question] how to move needed binaries (DLL's) to release zip? [SOLVED] HOT 13
- New installer hangs on clangarm64 HOT 12
- Winget Update problem HOT 8
- issue with "location" HOT 2
- Cache restore problem (gzip: Cannot exec) HOT 1
- Add cache-from and cache-to options
- Add possibility to modify BUILDENV in /etc/makepkg.conf using workflow arguments
- Shell not respecting system flag HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from setup-msys2.