Skip to content

Commit

Permalink
output fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mxcl committed Jan 15, 2025
1 parent d703046 commit 7d40308
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 17 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/ci.installer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- uses: actions/checkout@v4
- run: cat ./installer.sh | sh -s node --eval 'console.log(1)'
- run: ./installer.sh sh -c "which pkgx"
- run: source <(cat ./installer.sh) duf
- run: sh <(cat ./installer.sh) duf
- run: if command -v pkgx; then exit 1; fi

sudo-not-required:
Expand All @@ -52,9 +52,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: echo "vMAJOR=$(curl https://pkgx.sh/VERSION | cut -d. -f1)" >> "$GITHUB_ENV"
- run: |
eval "$(cat ./installer.sh)"
env +duf
if [ "$vMAJOR" -lt 2 ]; then
eval "$(cat ./installer.sh)"
env +duf
else
eval "$(cat ./installer.sh +duf)"
fi
duf --version
test -n "$BASH_VERSION"
Expand Down Expand Up @@ -161,7 +167,7 @@ jobs:
env:
PATH: ${{ github.workspace }}/bin:/usr/bin:/bin

- run: pkgx node --eval 'console.log(1)'
- run: pkgx deno eval 'console.log(1)'

upgrades:
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
# GitHub Action

```yaml
- uses: pkgxdev/setup@v2
- uses: pkgxdev/setup@v3
```
Installs the latest version of `pkgx`.

See [`action.yml`] for all inputs and outputs, but here’s the usual ones:

```yaml
- uses: pkgxdev/setup@v2
- uses: pkgxdev/setup@v3
with:
+: deno@1.30
rust@1.60 # we understand colloquial names, generally just type what you know
Expand Down
24 changes: 13 additions & 11 deletions installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,21 @@ _install_pre_reqs() {

# minimal but required or networking doesn’t work
# https://packages.debian.org/buster/all/netbase/filelist
A=netbase
# ca-certs needed until we bundle our own root cert
A="netbase ca-certificates"

# difficult to pkg in our opinion
B=libudev-dev

case $(cat /etc/debian_version) in
jessie/sid|8.*|stretch/sid|9.*)
apt --yes install libc-dev libstdc++-4.8-dev libgcc-4.7-dev $A $B;;
apt install --yes libc-dev libstdc++-4.8-dev libgcc-4.7-dev $A $B;;
buster/sid|10.*)
apt --yes install libc-dev libstdc++-8-dev libgcc-8-dev $A $B;;
apt install --yes libc-dev libstdc++-8-dev libgcc-8-dev $A $B;;
bullseye/sid|11.*)
apt --yes install libc-dev libstdc++-10-dev libgcc-9-dev $A $B;;
apt install --yes libc-dev libstdc++-10-dev libgcc-9-dev $A $B;;
bookworm/sid|12.*|*)
apt --yes install libc-dev libstdc++-11-dev libgcc-11-dev $A $B;;
apt install --yes libc-dev libstdc++-11-dev libgcc-11-dev $A $B;;
esac
elif test -f /etc/fedora-release; then
$SUDO yum --assumeyes install libatomic
Expand Down Expand Up @@ -129,10 +130,12 @@ _install_pkgx() {
}

_pkgx_is_old() {
v="$(/usr/local/bin/pkgx --version || echo pkgx 0)"
/usr/local/bin/pkgx --silent semverator gt \
$(curl -Ssf https://pkgx.sh/VERSION) \
$(echo $v | awk '{print $2}')
new_version=$(curl -Ssf https://pkgx.sh/VERSION)
old_version=$(/usr/local/bin/pkgx --version || echo pkgx 0)
old_version=$(echo $old_version | cut -d' ' -f2)
major_version=$(echo $new_version | cut -d. -f1)

/usr/local/bin/pkgx --silent semverator gt $new_version $old_version
}

_should_install_pkgx() {
Expand Down Expand Up @@ -160,8 +163,7 @@ if [ $# -gt 0 ]; then
elif [ $(basename "/$0") != 'installer.sh' ]; then
# ^^ temporary exception for action.ts

if type eval >/dev/null 2>&1; then
# we `type eval` as on Travis there was no `eval`!
if [ $major_version -lt 2 ] && type eval >/dev/null 2>&1; then
eval "$(pkgx --shellcode)" 2>/dev/null
fi

Expand Down

0 comments on commit 7d40308

Please sign in to comment.