- This repository provides the 
pkgxGitHub Action. - It also hosts 
installer.sh; the result ofcurl pkgx.sh. 
- uses: pkgxdev/setup@v4Installs the latest version of pkgx.
Note
v3&v4default to pkgx^2v2defaults to pkgx^1
See action.yml for all inputs and outputs, but here’s the usual ones:
- uses: pkgxdev/setup@v4
  with:
    +: deno@1.30
       rust@1.60   # we understand colloquial names, generally just type what you know
       clang       # versions aren’t necessary if you don’t careThe easiest way to know if it will work in the action is to try it locally on your computer:
$ pkgx +rust
# if there’s output, we got it
See
@pkgxdev/devto run thedevcommand in a GitHub Actions compatible manner
No. pkgx packages are just tarballs. Caching is just a tarball. You’ll likely just slow things down.
v4defaults topkgx^2, uses node^20 and doesn’t install any pre-reqs on Linux†v3defaults topkgx^2 and uses node^20v2defaults topkgx^1 and uses node^20v1defaults topkgx@latest and uses node^16v0should not be used
†
pkgxrequires glibc>=2.28, libgcc, libstdc++ and libatomic. Generally images come installed with these. If you are building binaries you may need the-devversions of these packages also.
To install pkgx:
$ curl https://pkgx.sh | sh
# - installs `pkgx` & `pkgm` to `/usr/local/bin`
# - if both are already installed, does an update checkOr on Windows:
$ irm https://pkgx.sh | iex
# - installs `pkgx.exe` to `$env:ProgramFiles/pkgx`
# - adds it to your system PATHTo use pkgx to run a command in a temporary sandbox:
$ curl -Ssf https://pkgx.sh | sh -s -- gum spin -- sleep 5
# - if pkgx is installed, uses that installation to run gum
# - if pkgx *isn’t* installed, downloads pkgx to a temporary location
# - if pkgx *isn’t* installed, packages are also cached to a temporary locationThis usage of our installer can be useful for demonstrative purposes in READMEs and gists.
This syntax is easier to remember:
sh <(curl -L pkgx.sh) gum spin -- sleep 5There is the notable caveat that the above easier syntax will not work with bash <4 which is the bash that comes with macOS. Even though macOS has defaulted to zsh for years it is still relatively easy for users to end up in a situation where bash is the shell interpreting your commands. Your call.
Additionally, use of
-Lis subject to man-in-the-middle attacks. Again your call.
