Skip to content

Commit

Permalink
v3; defaults to pkgx^2; pure js rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
mxcl committed Jan 14, 2025
1 parent f4c4d2e commit c8a8e2a
Show file tree
Hide file tree
Showing 19 changed files with 832 additions and 462 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/cd.vx.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: cd·vx

on:
release:
types:
- published

concurrency:
group: cd/vx/${{ github.event.release.tag_name }}
cancel-in-progress: true

permissions:
contents: write

jobs:
retag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: fischerscode/tagger@v0
with:
prefix: v
- run: |
git tag -f latest
git push origin latest --force
66 changes: 0 additions & 66 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,69 +9,3 @@ jobs:
uses: ./.github/workflows/ci.installer.yml
qa-action:
uses: ./.github/workflows/ci.action.yml

dist:
needs: [qa-installer, qa-action]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: curl -Ssf https://pkgx.sh/$(uname)/$(uname -m).tgz | sudo tar xz -C /usr/local/bin
- run: ./scripts/dist.sh --minify
- uses: actions/upload-artifact@v3
with:
name: dist
path: dist

put:
permissions:
contents: write
deployments: write
needs: dist
runs-on: ubuntu-latest
steps:
- name: Create Deployment
uses: bobheadxi/deployments@v1
id: deployment
with:
step: start
env: aws

- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
name: dist
path: dist

- uses: git-actions/set-user@v1

- run: |
if ! git diff --exit-code; then
git add dist
git commit -m v${{ github.event.inputs.version }}
git tag v${{ github.event.inputs.version }}
git push origin v${{ github.event.inputs.version }} main
fi
- uses: softprops/action-gh-release@v1
with:
files: ./installer.sh
tag_name: v${{ github.event.inputs.version }}
fail_on_unmatched_files: true

- uses: fischerscode/tagger@v0
with:
prefix: v
tag: v${{ github.event.inputs.version }}

- run: |
git tag --force latest
git push origin latest
- name: Seal Deployment
uses: bobheadxi/deployments@v1
if: always()
with:
env: aws
step: finish
status: ${{ job.status }}
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
41 changes: 13 additions & 28 deletions .github/workflows/ci.action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ on:
workflow_call:
pull_request:
paths:
- action.ts
- action.js
- action.yml
- package.json

Expand All @@ -11,30 +11,17 @@ concurrency:
cancel-in-progress: true

jobs:
dist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: ./scripts/dist.sh
- uses: actions/upload-artifact@v3
with:
name: dist
path: dist

std:
needs: dist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
name: dist
path: dist
- run: npm i
- uses: ./
with:
version: null
- run: pkgx --version

plus-pkgs:
needs: dist
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -46,7 +33,7 @@ jobs:
- [self-hosted, linux, ARM64] # works in arm64 environments
prefix:
- null
- /opt
- /tmp/pkgx
container:
- null
include:
Expand All @@ -55,31 +42,29 @@ jobs:
container: ${{ matrix.container }}
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3

- uses: actions/setup-node@v4
with:
name: dist
path: dist
node-version: latest
- run: npm i

- uses: ./
with:
PKGX_DIR: ${{ matrix.prefix }}
+: node@18 deno.land

- run: test -f '${{ matrix.prefix }}/pkgx.sh/v*/bin/pkgx'
- run: test -f '${{ matrix.prefix }}/deno.land/v*/bin/deno'
if: ${{ matrix.prefix }}

- run: pkgx --version
- run: node --eval 'console.log(1)'
- run: '[[ "$(node --version)" == v18.* ]]'
- run: deno --version

multiple-apply-is-ok:
runs-on: ubuntu-latest
needs: dist
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
name: dist
path: dist
- run: npm i
- uses: ./
- run: pkgx --version
- uses: ./
Expand Down
48 changes: 2 additions & 46 deletions .github/workflows/ci.installer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,52 +48,6 @@ jobs:
env:
PATH: ${{ github.workspace }}/bin:/usr/bin:/bin

eval-bash:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
eval "$(cat ./installer.sh)"
env +duf
duf --version
test -n "$BASH_VERSION"
test -z "$ZSH_VERSION"
shell: bash -e {0}
# check pkgx was installed despite executing via `eval`
- run:
pkgx duf --version

eval-zsh:
runs-on: ubuntu-latest
steps:
- name: prep
run: sudo apt-get update && sudo apt-get install -y zsh

- uses: actions/checkout@v4
- run: |
eval "$(cat ./installer.sh)"
env +duf
duf --version
test -n "$ZSH_VERSION"
test -z "$BASH_VERSION"
shell: zsh -e {0}
eval-posix-sh:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
eval "$(cat ./installer.sh)"
env +duf
duf --version
test -z "$ZSH_VERSION"
test -z "$BASH_VERSION"
shell: /bin/sh -e {0}
sudo-required:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -161,5 +115,7 @@ jobs:
tar xz --strip-components=3
- run: mv pkgx /usr/local/bin
- run: test "$(pkgx --version)" = 'pkgx 1.0.0'
- run: PKGX_UPDATE=no ./installer.sh
- run: test "$(pkgx --version)" = 'pkgx 1.0.0'
- run: ./installer.sh
- run: pkgx semverator gt $(pkgx --version | awk '{print $2}') 1.0.0
Loading

0 comments on commit c8a8e2a

Please sign in to comment.