Skip to content

Commit 1d467a2

Browse files
committed
v3; defaults to pkgx^2; pure js rewrite
1 parent d703046 commit 1d467a2

File tree

19 files changed

+832
-461
lines changed

19 files changed

+832
-461
lines changed

.github/workflows/cd.vx.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: cd·vx
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
8+
concurrency:
9+
group: cd/vx/${{ github.event.release.tag_name }}
10+
cancel-in-progress: true
11+
12+
permissions:
13+
contents: write
14+
15+
jobs:
16+
retag:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: fischerscode/tagger@v0
21+
with:
22+
prefix: v
23+
- run: |
24+
git tag -f latest
25+
git push origin latest --force

.github/workflows/cd.yml

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -9,69 +9,3 @@ jobs:
99
uses: ./.github/workflows/ci.installer.yml
1010
qa-action:
1111
uses: ./.github/workflows/ci.action.yml
12-
13-
dist:
14-
needs: [qa-installer, qa-action]
15-
runs-on: ubuntu-latest
16-
steps:
17-
- uses: actions/checkout@v4
18-
- run: curl -Ssf https://pkgx.sh/$(uname)/$(uname -m).tgz | sudo tar xz -C /usr/local/bin
19-
- run: ./scripts/dist.sh --minify
20-
- uses: actions/upload-artifact@v3
21-
with:
22-
name: dist
23-
path: dist
24-
25-
put:
26-
permissions:
27-
contents: write
28-
deployments: write
29-
needs: dist
30-
runs-on: ubuntu-latest
31-
steps:
32-
- name: Create Deployment
33-
uses: bobheadxi/deployments@v1
34-
id: deployment
35-
with:
36-
step: start
37-
env: aws
38-
39-
- uses: actions/checkout@v4
40-
- uses: actions/download-artifact@v3
41-
with:
42-
name: dist
43-
path: dist
44-
45-
- uses: git-actions/set-user@v1
46-
47-
- run: |
48-
if ! git diff --exit-code; then
49-
git add dist
50-
git commit -m v${{ github.event.inputs.version }}
51-
git tag v${{ github.event.inputs.version }}
52-
git push origin v${{ github.event.inputs.version }} main
53-
fi
54-
55-
- uses: softprops/action-gh-release@v1
56-
with:
57-
files: ./installer.sh
58-
tag_name: v${{ github.event.inputs.version }}
59-
fail_on_unmatched_files: true
60-
61-
- uses: fischerscode/tagger@v0
62-
with:
63-
prefix: v
64-
tag: v${{ github.event.inputs.version }}
65-
66-
- run: |
67-
git tag --force latest
68-
git push origin latest
69-
70-
- name: Seal Deployment
71-
uses: bobheadxi/deployments@v1
72-
if: always()
73-
with:
74-
env: aws
75-
step: finish
76-
status: ${{ job.status }}
77-
deployment_id: ${{ steps.deployment.outputs.deployment_id }}

.github/workflows/ci.action.yml

Lines changed: 13 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ on:
22
workflow_call:
33
pull_request:
44
paths:
5-
- action.ts
5+
- action.js
66
- action.yml
77
- package.json
88

@@ -11,30 +11,17 @@ concurrency:
1111
cancel-in-progress: true
1212

1313
jobs:
14-
dist:
15-
runs-on: ubuntu-latest
16-
steps:
17-
- uses: actions/checkout@v4
18-
- run: ./scripts/dist.sh
19-
- uses: actions/upload-artifact@v3
20-
with:
21-
name: dist
22-
path: dist
23-
2414
std:
25-
needs: dist
2615
runs-on: ubuntu-latest
2716
steps:
2817
- uses: actions/checkout@v4
29-
- uses: actions/download-artifact@v3
30-
with:
31-
name: dist
32-
path: dist
18+
- run: npm i
3319
- uses: ./
20+
with:
21+
version: null
3422
- run: pkgx --version
3523

3624
plus-pkgs:
37-
needs: dist
3825
runs-on: ${{ matrix.os }}
3926
strategy:
4027
fail-fast: false
@@ -46,7 +33,7 @@ jobs:
4633
- [self-hosted, linux, ARM64] # works in arm64 environments
4734
prefix:
4835
- null
49-
- /opt
36+
- /tmp/pkgx
5037
container:
5138
- null
5239
include:
@@ -55,31 +42,29 @@ jobs:
5542
container: ${{ matrix.container }}
5643
steps:
5744
- uses: actions/checkout@v4
58-
- uses: actions/download-artifact@v3
45+
46+
- uses: actions/setup-node@v4
5947
with:
60-
name: dist
61-
path: dist
48+
node-version: latest
49+
- run: npm i
6250

6351
- uses: ./
6452
with:
6553
PKGX_DIR: ${{ matrix.prefix }}
6654
+: node@18 deno.land
6755

68-
- run: test -f '${{ matrix.prefix }}/pkgx.sh/v*/bin/pkgx'
56+
- run: test -f '${{ matrix.prefix }}/deno.land/v*/bin/deno'
6957
if: ${{ matrix.prefix }}
58+
7059
- run: pkgx --version
71-
- run: node --eval 'console.log(1)'
60+
- run: '[[ "$(node --version)" == v18.* ]]'
7261
- run: deno --version
7362

7463
multiple-apply-is-ok:
7564
runs-on: ubuntu-latest
76-
needs: dist
7765
steps:
7866
- uses: actions/checkout@v4
79-
- uses: actions/download-artifact@v3
80-
with:
81-
name: dist
82-
path: dist
67+
- run: npm i
8368
- uses: ./
8469
- run: pkgx --version
8570
- uses: ./

.github/workflows/ci.installer.yml

Lines changed: 2 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -48,52 +48,6 @@ jobs:
4848
env:
4949
PATH: ${{ github.workspace }}/bin:/usr/bin:/bin
5050

51-
eval-bash:
52-
runs-on: ubuntu-latest
53-
steps:
54-
- uses: actions/checkout@v4
55-
- run: |
56-
eval "$(cat ./installer.sh)"
57-
env +duf
58-
duf --version
59-
60-
test -n "$BASH_VERSION"
61-
test -z "$ZSH_VERSION"
62-
shell: bash -e {0}
63-
64-
# check pkgx was installed despite executing via `eval`
65-
- run:
66-
pkgx duf --version
67-
68-
eval-zsh:
69-
runs-on: ubuntu-latest
70-
steps:
71-
- name: prep
72-
run: sudo apt-get update && sudo apt-get install -y zsh
73-
74-
- uses: actions/checkout@v4
75-
- run: |
76-
eval "$(cat ./installer.sh)"
77-
env +duf
78-
duf --version
79-
80-
test -n "$ZSH_VERSION"
81-
test -z "$BASH_VERSION"
82-
shell: zsh -e {0}
83-
84-
eval-posix-sh:
85-
runs-on: ubuntu-latest
86-
steps:
87-
- uses: actions/checkout@v4
88-
- run: |
89-
eval "$(cat ./installer.sh)"
90-
env +duf
91-
duf --version
92-
93-
test -z "$ZSH_VERSION"
94-
test -z "$BASH_VERSION"
95-
shell: /bin/sh -e {0}
96-
9751
sudo-required:
9852
runs-on: ubuntu-latest
9953
steps:
@@ -172,5 +126,7 @@ jobs:
172126
tar xz --strip-components=3
173127
- run: mv pkgx /usr/local/bin
174128
- run: test "$(pkgx --version)" = 'pkgx 1.0.0'
129+
- run: PKGX_UPDATE=no ./installer.sh
130+
- run: test "$(pkgx --version)" = 'pkgx 1.0.0'
175131
- run: ./installer.sh
176132
- run: pkgx semverator gt $(pkgx --version | awk '{print $2}') 1.0.0

0 commit comments

Comments
 (0)