Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 48 additions & 1 deletion .github/workflows/Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,53 @@ jobs:
msystem: MINGW64
- run: msys2 ./test.sh MINGW64

install-and-pacboy:
needs: [cache]
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
msystem: [ MINGW64, MINGW32, UCRT64, CLANG64 ]
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
name: action
- name: run action
uses: ./
with:
msystem: ${{ matrix.msystem }}
update: true
install: git
pacboy: openssl:p
- shell: msys2 {0}
run: |
uname -a
openssl help

pacboy:
needs: [cache]
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
msystem: [ MINGW64, MINGW32, UCRT64, CLANG64 ]
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
name: action
- name: run action
uses: ./
with:
msystem: ${{ matrix.msystem }}
update: true
pacboy: openssl:p
- shell: msys2 {0}
run: |
uname -a
openssl help


defaultclean:
needs: [cache]
Expand Down Expand Up @@ -375,6 +422,7 @@ jobs:
with:
platform-check-severity: warn


location:
needs: [cache]
runs-on: windows-latest
Expand All @@ -391,4 +439,3 @@ jobs:
- shell: msys2 {0}
run: |
cygpath -m /

1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- Options:
- `platform-check-severity`. [[#172](https://github.com/msys2/setup-msys2/pull/172)]
- `location`. [[#173](https://github.com/msys2/setup-msys2/pull/173)]
- `pacboy`. [[#166](https://github.com/msys2/setup-msys2/pull/166)]

### Changed

Expand Down
42 changes: 40 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,24 @@ See, for instance:
- uses: msys2/setup-msys2@v2
with:
msystem: ${{matrix.sys}}
install: mingw-w64-${{matrix.env}}-toolchain
install: mingw-w64-${{matrix.env}}-openssl
```

Alternatively, option `pacboy` allows using a single matrix variable:

```yml
strategy:
matrix:
sys:
- mingw64
- mingw32
- ucrt64 # Experimental!
- clang64 # Experimental!
steps:
- uses: msys2/setup-msys2@v2
with:
msystem: ${{matrix.sys}}
pacboy: openssl:p
```

Find similar patterms in the following workflows:
Expand Down Expand Up @@ -190,7 +207,7 @@ By setting option `update` to `true`, the action will try to update the runtime
#### install

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`.
The package or list of packages are installed through `pacman --noconfirm -S --needed --overwrite *`.

```yaml
- uses: msys2/setup-msys2@v2
Expand All @@ -201,6 +218,27 @@ The package or list of packages are installed through `pacman --noconfirm -S --n
base-devel
```

#### pacboy

Installing additional packages with [pacboy](https://www.msys2.org/docs/package-management/#avoiding-writing-long-package-names) after updating the system is supported through option `pacboy`.
The package or list of packages are installed through `pacboy --noconfirm -S --needed`.

```yaml
strategy:
fail-fast: false
matrix:
sys: [ MINGW64, MINGW32, UCRT64, CLANG64 ]
steps:
- uses: msys2/setup-msys2@v2
with:
msystem: ${{matrix.sys}}
install: >-
git
base-devel
pacboy: >-
openssl:p
```

#### release

By default (`true`), retrieve and extract base installation from upstream GitHub Releases.
Expand Down
6 changes: 5 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ inputs:
required: false
default: false
install:
description: 'Install additional packages through pacman, after installation and/or update'
description: 'After installation and/or update, install additional packages through pacman'
required: false
default: false
pacboy:
description: 'After installation and/or update, install additional packages through pacboy'
required: false
default: false
release:
Expand Down
25 changes: 21 additions & 4 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ function parseInput() {
let p_pathtype = core.getInput('path-type');
let p_msystem = core.getInput('msystem');
let p_install = core.getInput('install');
let p_pacboy = core.getInput('pacboy');
let p_platformcheckseverity = core.getInput('platform-check-severity');
let p_location = core.getInput('location');

Expand All @@ -37,6 +38,7 @@ function parseInput() {
p_msystem = p_msystem.toUpperCase()

p_install = (p_install === 'false') ? [] : p_install.split(/\s+/);
p_pacboy = (p_pacboy === 'false') ? [] : p_pacboy.split(/\s+/);

const platformcheckseverity_allowed = ['fatal', 'warn'];
if (!platformcheckseverity_allowed.includes(p_platformcheckseverity)) {
Expand All @@ -55,6 +57,7 @@ function parseInput() {
pathtype: p_pathtype,
msystem: p_msystem,
install: p_install,
pacboy: p_pacboy,
platformcheckseverity: p_platformcheckseverity,
location: (p_location == "RUNNER_TEMP") ? process.env['RUNNER_TEMP'] : p_location,
}
Expand Down Expand Up @@ -199,8 +202,8 @@ async function runMsys(args, opts) {
await exec.exec('cmd', ['/D', '/S', '/C', cmd].concat(['-c', quotedArgs.join(' ')]), opts);
}

async function pacman(args, opts) {
await runMsys(['pacman', '--noconfirm'].concat(args), opts);
async function pacman(args, opts, cmd) {
await runMsys([cmd ? cmd : 'pacman', '--noconfirm'].concat(args), opts);
}

async function run() {
Expand Down Expand Up @@ -287,8 +290,22 @@ async function run() {
}

if (input.install.length) {
core.startGroup('Installing additional packages...');
await pacman(['-S', '--needed', '--overwrite', '*'].concat(input.install), {});
core.startGroup('Installing additional packages through pacman...');
await pacman(['-S', '--needed', '--overwrite', '*'].concat(
(input.pacboy.length) ? input.install.concat(['pactoys']) : input.install
), {});
core.endGroup();
} else {
if (input.pacboy.length) {
core.startGroup('Installing pacboy...');
await pacman(['-S', '--needed', '--overwrite', '*', 'pactoys'], {});
core.endGroup();
}
}

if (input.pacboy.length) {
core.startGroup('Installing additional packages through pacboy...');
await pacman(['-S', '--needed'].concat(input.pacboy), {}, 'pacboy');
core.endGroup();
}

Expand Down