Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b9c058e

Browse files
committedJan 15, 2025
Install pkgm alongside pkgx (#251)
* Install pkgm alongside pkgx * Not a complete implementation since we need to check if there’s a newer pkgm separate to pkgx. * Default action to install pkgx^1 by default since we need a major version bump to switch to ^2
1 parent eb1c861 commit b9c058e

File tree

4 files changed

+25
-14
lines changed

4 files changed

+25
-14
lines changed
 

‎.github/workflows/ci.installer.yml

+11
Original file line numberDiff line numberDiff line change
@@ -189,3 +189,14 @@ jobs:
189189
- run: test "$(pkgx --version)" = 'pkgx 1.0.0'
190190
- run: ./installer.sh
191191
- run: pkgx semverator gt $(pkgx --version | awk '{print $2}') 1.0.0
192+
193+
pkgm:
194+
runs-on: ubuntu-latest
195+
steps:
196+
- uses: actions/checkout@v4
197+
- run: '! pkgm --version'
198+
- run: '! deno --version'
199+
- run: cat ./installer.sh | sh
200+
- run: pkgm --version
201+
- run: pkgm i deno
202+
- run: deno --version

‎README.md

+2-7
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,6 @@ $ pkgx +rust
3232
> See [`@pkgxdev/dev`] to run the `dev` command in a GitHub Actions compatible manner
3333

3434

35-
### Shell Integration
36-
37-
We cannot integrate with the GitHub Actions shell. But you probably don’t
38-
need it.
39-
4035
### Should you Cache `~/.pkgx`?
4136

4237
No. pkgx packages are just tarballs. Caching is just a tarball. You’ll likely
@@ -52,8 +47,8 @@ To install `pkgx`:
5247
```sh
5348
$ curl https://pkgx.sh | sh
5449
55-
# - installs to `/usr/local/bin/pkgx`
56-
# - if pkgx is already installed it’s a noop
50+
# - installs `pkgx` & `pkgm` to `/usr/local/bin`
51+
# - if both are already installed, does an update check
5752
```
5853

5954
## Temporary Sandboxes

‎installer.sh

+5-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ _install_pkgx() {
117117
progress="--progress-bar"
118118
fi
119119

120-
tmpdir=$(mktemp -d)
120+
tmpdir="$(mktemp -d)"
121121

122122
if [ $# -eq 0 ]; then
123123
if [ -f /usr/local/bin/pkgx ]; then
@@ -130,10 +130,14 @@ _install_pkgx() {
130130
pipe="$tmpdir/pipe"
131131
mkfifo "$pipe"
132132

133+
curl --silent --fail --proto '=https' -o "$tmpdir/pkgm" \
134+
https://pkgxdev.github.io/pkgm/pkgm.ts
135+
133136
curl $progress --fail --proto '=https' "https://pkgx.sh/$(uname)/$(uname -m)".tgz > "$pipe" &
134137
$SUDO sh -c "
135138
mkdir -p /usr/local/bin
136139
tar xz --directory /usr/local/bin < '$pipe'
140+
install -m 755 "$tmpdir/pkgm" /usr/local/bin
137141
" &
138142
wait
139143

‎scripts/publish-release.sh

+7-6
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ major|minor|patch|prerelease)
4242
esac
4343

4444
if [ $v_new = $v_latest ]; then
45-
echo "$v_new already exists!" >&2
45+
echo v"$v_new already exists!" >&2
4646
exit 1
4747
fi
4848

4949
if ! gh release view v$v_new >/dev/null 2>&1; then
50-
gum confirm "prepare draft release for $v_new?" || exit 1
50+
gum confirm "prepare draft release for v$v_new?" || exit 1
5151

5252
gh release create \
5353
v$v_new \
@@ -74,6 +74,7 @@ if ! gh run watch --exit-status $run_id; then
7474
exit $foo
7575
fi
7676

77+
git checkout -b v$v_new-branch
7778
npm run dist
7879
git add ./action.js
7980
git commit --message v$v_new
@@ -82,15 +83,15 @@ git push origin v$v_new
8283

8384
gh release upload --clobber v$v_new ./installer.sh ./action.js
8485

85-
# reset so we don’t accidentally commit it
86-
git co action.js
87-
8886
gh release view v$v_new
8987

90-
gum confirm "draft prepared, release $v_new?" || exit 1
88+
gum confirm "draft prepared, release v$v_new?" || exit 1
9189

9290
gh release edit \
9391
v$v_new \
9492
--verify-tag \
9593
--latest \
9694
--draft=false
95+
96+
git checkout main
97+
git branch -D v$v_new-branch

0 commit comments

Comments
 (0)
Please sign in to comment.