From 8dd3c8d6b4ce21ad7c0e9cf0e39462a7ffdb4b0c Mon Sep 17 00:00:00 2001 From: Max Howell Date: Wed, 15 Jan 2025 11:03:02 -0500 Subject: [PATCH 1/4] wip --- scripts/publish-release.sh | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/scripts/publish-release.sh b/scripts/publish-release.sh index 7fee99fa..7d2727f7 100755 --- a/scripts/publish-release.sh +++ b/scripts/publish-release.sh @@ -42,12 +42,12 @@ major|minor|patch|prerelease) esac if [ $v_new = $v_latest ]; then - echo "$v_new already exists!" >&2 + echo v"$v_new already exists!" >&2 exit 1 fi if ! gh release view v$v_new >/dev/null 2>&1; then - gum confirm "prepare draft release for $v_new?" || exit 1 + gum confirm "prepare draft release for v$v_new?" || exit 1 gh release create \ v$v_new \ @@ -74,23 +74,24 @@ if ! gh run watch --exit-status $run_id; then exit $foo fi +git checkout -b v$v_new-branch npm run dist git add ./action.js git commit --message $v_new -git tag $v_new -git push origin $v_new +git tag v$v_new +git push origin v$v_new gh release upload --clobber v$v_new ./installer.sh ./action.js -# reset so we don’t accidentally commit it -git co action.js - gh release view v$v_new -gum confirm "draft prepared, release $v_new?" || exit 1 +gum confirm "draft prepared, release v$v_new?" || exit 1 gh release edit \ v$v_new \ --verify-tag \ --latest \ --draft=false + +git checkout main +git branch -D v$v_new-branch From 7677931414e0a55ba9e9f6fd92009c690ff0c212 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Wed, 8 Jan 2025 11:56:35 -0500 Subject: [PATCH 2/4] Install pkgm alongside pkgx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 --- README.md | 9 ++------- installer.sh | 6 +++++- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index d6e6e4c6..ba0509a3 100644 --- a/README.md +++ b/README.md @@ -32,11 +32,6 @@ $ pkgx +rust > See [`@pkgxdev/dev`] to run the `dev` command in a GitHub Actions compatible manner -### Shell Integration - -We cannot integrate with the GitHub Actions shell. But you probably don’t -need it. - ### Should you Cache `~/.pkgx`? No. pkgx packages are just tarballs. Caching is just a tarball. You’ll likely @@ -52,8 +47,8 @@ To install `pkgx`: ```sh $ curl https://pkgx.sh | sh -# - installs to `/usr/local/bin/pkgx` -# - if pkgx is already installed it’s a noop +# - installs `pkgx` & `pkgm` to `/usr/local/bin` +# - if both are already installed, does an update check ``` ## Temporary Sandboxes diff --git a/installer.sh b/installer.sh index 89e19cfd..52f074c9 100755 --- a/installer.sh +++ b/installer.sh @@ -117,7 +117,7 @@ _install_pkgx() { progress="--progress-bar" fi - tmpdir=$(mktemp -d) + tmpdir="$(mktemp -d)" if [ $# -eq 0 ]; then if [ -f /usr/local/bin/pkgx ]; then @@ -130,10 +130,14 @@ _install_pkgx() { pipe="$tmpdir/pipe" mkfifo "$pipe" + curl --silent --fail --proto '=https' -o "$tmpdir/pkgm" \ + https://pkgxdev.github.io/pkgm/pkgm.ts + curl $progress --fail --proto '=https' "https://pkgx.sh/$(uname)/$(uname -m)".tgz > "$pipe" & $SUDO sh -c " mkdir -p /usr/local/bin tar xz --directory /usr/local/bin < '$pipe' + install -m 755 "$tmpdir/pkgm" /usr/local/bin " & wait From 2689d77bf74253dc0d5630a391e528b3ea052b59 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Wed, 15 Jan 2025 11:08:05 -0500 Subject: [PATCH 3/4] wip --- .github/workflows/ci.installer.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/ci.installer.yml b/.github/workflows/ci.installer.yml index f69a5a99..0438614f 100644 --- a/.github/workflows/ci.installer.yml +++ b/.github/workflows/ci.installer.yml @@ -189,3 +189,13 @@ jobs: - run: test "$(pkgx --version)" = 'pkgx 1.0.0' - run: ./installer.sh - run: pkgx semverator gt $(pkgx --version | awk '{print $2}') 1.0.0 + + pkgm: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: '! pkgm --version' + - run: cat ./installer.sh | sh + - run: pkgm --version + - run: pkgm i deno + - run: deno --version From a66ed88e3e4d832448226e5ecdd3c230a97464d6 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Wed, 15 Jan 2025 11:10:14 -0500 Subject: [PATCH 4/4] wip --- .github/workflows/ci.installer.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.installer.yml b/.github/workflows/ci.installer.yml index 0438614f..53b529d8 100644 --- a/.github/workflows/ci.installer.yml +++ b/.github/workflows/ci.installer.yml @@ -195,6 +195,7 @@ jobs: steps: - uses: actions/checkout@v4 - run: '! pkgm --version' + - run: '! deno --version' - run: cat ./installer.sh | sh - run: pkgm --version - run: pkgm i deno