Skip to content

Commit ec7e7fd

Browse files
committed
output & ci fixes
1 parent d703046 commit ec7e7fd

File tree

3 files changed

+53
-23
lines changed

3 files changed

+53
-23
lines changed

.github/workflows/ci.installer.yml

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ jobs:
3030
runs-on: ubuntu-latest
3131
steps:
3232
- uses: actions/checkout@v4
33-
- run: cat ./installer.sh | sh -s node --eval 'console.log(1)'
34-
- run: ./installer.sh sh -c "which pkgx"
35-
- run: source <(cat ./installer.sh) duf
33+
- run: cat ./installer.sh | sh -s deno eval 'console.log(1)'
34+
- run: ./installer.sh -- sh -c "which pkgx"
35+
- run: sh <(cat ./installer.sh) duf
3636
- run: if command -v pkgx; then exit 1; fi
3737

3838
sudo-not-required:
@@ -53,8 +53,16 @@ jobs:
5353
steps:
5454
- uses: actions/checkout@v4
5555
- run: |
56-
eval "$(cat ./installer.sh)"
57-
env +duf
56+
vMAJOR=$(curl https://pkgx.sh/VERSION | cut -d. -f1)
57+
58+
if [ "$vMAJOR" -lt 2 ]; then
59+
eval "$(cat ./installer.sh)"
60+
env +duf
61+
else
62+
eval "$(cat ./installer.sh)"
63+
eval "$(pkgx +duf)"
64+
fi
65+
5866
duf --version
5967
6068
test -n "$BASH_VERSION"
@@ -73,8 +81,16 @@ jobs:
7381

7482
- uses: actions/checkout@v4
7583
- run: |
76-
eval "$(cat ./installer.sh)"
77-
env +duf
84+
vMAJOR=$(curl https://pkgx.sh/VERSION | cut -d. -f1)
85+
86+
if [ "$vMAJOR" -lt 2 ]; then
87+
eval "$(cat ./installer.sh)"
88+
env +duf
89+
else
90+
eval "$(cat ./installer.sh)"
91+
eval "$(pkgx +duf)"
92+
fi
93+
7894
duf --version
7995
8096
test -n "$ZSH_VERSION"
@@ -86,8 +102,16 @@ jobs:
86102
steps:
87103
- uses: actions/checkout@v4
88104
- run: |
89-
eval "$(cat ./installer.sh)"
90-
env +duf
105+
vMAJOR=$(curl https://pkgx.sh/VERSION | cut -d. -f1)
106+
107+
if [ "$vMAJOR" -lt 2 ]; then
108+
eval "$(cat ./installer.sh)"
109+
env +duf
110+
else
111+
eval "$(cat ./installer.sh)"
112+
eval "$(pkgx +duf)"
113+
fi
114+
91115
duf --version
92116
93117
test -z "$ZSH_VERSION"
@@ -161,7 +185,7 @@ jobs:
161185
env:
162186
PATH: ${{ github.workspace }}/bin:/usr/bin:/bin
163187

164-
- run: pkgx node --eval 'console.log(1)'
188+
- run: pkgx deno eval 'console.log(1)'
165189

166190
upgrades:
167191
runs-on: ubuntu-latest

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
# GitHub Action
88

99
```yaml
10-
- uses: pkgxdev/setup@v2
10+
- uses: pkgxdev/setup@v3
1111
```
1212
1313
Installs the latest version of `pkgx`.
1414

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

1717
```yaml
18-
- uses: pkgxdev/setup@v2
18+
- uses: pkgxdev/setup@v3
1919
with:
2020
+: deno@1.30
2121
rust@1.60 # we understand colloquial names, generally just type what you know

installer.sh

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,21 @@ _install_pre_reqs() {
5454

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

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

6263
case $(cat /etc/debian_version) in
6364
jessie/sid|8.*|stretch/sid|9.*)
64-
apt --yes install libc-dev libstdc++-4.8-dev libgcc-4.7-dev $A $B;;
65+
apt install --yes libc-dev libstdc++-4.8-dev libgcc-4.7-dev $A $B;;
6566
buster/sid|10.*)
66-
apt --yes install libc-dev libstdc++-8-dev libgcc-8-dev $A $B;;
67+
apt install --yes libc-dev libstdc++-8-dev libgcc-8-dev $A $B;;
6768
bullseye/sid|11.*)
68-
apt --yes install libc-dev libstdc++-10-dev libgcc-9-dev $A $B;;
69+
apt install --yes libc-dev libstdc++-10-dev libgcc-9-dev $A $B;;
6970
bookworm/sid|12.*|*)
70-
apt --yes install libc-dev libstdc++-11-dev libgcc-11-dev $A $B;;
71+
apt install --yes libc-dev libstdc++-11-dev libgcc-11-dev $A $B;;
7172
esac
7273
elif test -f /etc/fedora-release; then
7374
$SUDO yum --assumeyes install libatomic
@@ -129,10 +130,12 @@ _install_pkgx() {
129130
}
130131

131132
_pkgx_is_old() {
132-
v="$(/usr/local/bin/pkgx --version || echo pkgx 0)"
133-
/usr/local/bin/pkgx --silent semverator gt \
134-
$(curl -Ssf https://pkgx.sh/VERSION) \
135-
$(echo $v | awk '{print $2}')
133+
new_version=$(curl -Ssf https://pkgx.sh/VERSION)
134+
old_version=$(/usr/local/bin/pkgx --version || echo pkgx 0)
135+
old_version=$(echo $old_version | cut -d' ' -f2)
136+
major_version=$(echo $new_version | cut -d. -f1)
137+
138+
/usr/local/bin/pkgx --silent semverator gt $new_version $old_version
136139
}
137140

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

163-
if type eval >/dev/null 2>&1; then
164-
# we `type eval` as on Travis there was no `eval`!
166+
if ! [ "$major_version" = "0" ]; then
167+
major_version=$(pkgx --version | cut -d' ' -f2 | cut -d. -f1)
168+
fi
169+
170+
if [ $major_version -lt 2 ] && type eval >/dev/null 2>&1; then
165171
eval "$(pkgx --shellcode)" 2>/dev/null
166172
fi
167173

0 commit comments

Comments
 (0)