Skip to content

Commit ca07d00

Browse files
committed
update libexec for pkgx^2
- no longer produces `v*`. - uses PKGX_PANTRY_DIR in addition to PKGX_PANTRY_PATH.
1 parent 552d4b6 commit ca07d00

File tree

32 files changed

+129
-113
lines changed

32 files changed

+129
-113
lines changed

.github/modify-pantry/action.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
runs:
22
using: composite
33
steps:
4-
- run: pkgx --sync #FIXME bug where shebangs don’t cause an auto-sync
5-
shell: bash
64
- uses: fregante/setup-git-user@v2
75
- run: git update-ref refs/remotes/origin/main HEAD
86
working-directory: ${{ github.workspace }}

.github/setup-pantry/action.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Setup pantry overlay
2+
description: >
3+
Checks out upstream pkgxdev/pantry and merges brewkit's test packages on top.
4+
Sets PKGX_PANTRY_DIR and PKGX_PANTRY_PATH for subsequent steps.
5+
6+
inputs:
7+
path:
8+
description: >
9+
Path to the brewkit checkout (containing projects/).
10+
Defaults to $GITHUB_WORKSPACE at runtime (safe for containers).
11+
required: false
12+
13+
runs:
14+
using: composite
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
repository: pkgxdev/pantry
19+
path: .upstream-pantry
20+
21+
- shell: bash
22+
env:
23+
INPUT_PATH: ${{inputs.path}}
24+
run: |
25+
dir="${INPUT_PATH:-$GITHUB_WORKSPACE}"
26+
cp -rn "$GITHUB_WORKSPACE/.upstream-pantry/projects/"* "$dir/projects/"
27+
rm -rf "$GITHUB_WORKSPACE/.upstream-pantry"
28+
echo "PKGX_PANTRY_DIR=$dir" >> "$GITHUB_ENV"
29+
echo "PKGX_PANTRY_PATH=$dir" >> "$GITHUB_ENV"

.github/workflows/ci.actions.yml

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ jobs:
77
runs-on: ${{ matrix.platform.os }}
88
outputs:
99
pkg: ${{ steps.build.outputs.pkgjson }}
10-
env:
11-
PKGX_PANTRY_PATH: ${{github.workspace}}/co
1210
strategy:
1311
matrix:
1412
platform:
@@ -21,9 +19,12 @@ jobs:
2119
steps:
2220
- uses: actions/checkout@v4
2321
with:
24-
path: co # test that things working isnt just a coincident of PWD == BREKWIT_DIR
22+
path: co # test that things working isn't just a coincident of PWD == BREKWIT_DIR
2523

26-
- uses: pkgxdev/setup@v2
24+
- uses: pkgxdev/setup@v4
25+
- uses: ./co/.github/setup-pantry
26+
with:
27+
path: ${{github.workspace}}/co
2728

2829
- uses: ./co/build
2930
id: build
@@ -49,13 +50,14 @@ jobs:
4950
- darwin+aarch64
5051
- null
5152
runs-on: ubuntu-latest
52-
env:
53-
PKGX_PANTRY_PATH: ${{github.workspace}}/co
5453
steps:
5554
- uses: actions/checkout@v4
5655
with:
57-
path: co # test that things working isn’t just a coincident of PWD == BREKWIT_DIR
58-
- uses: pkgxdev/setup@v2
56+
path: co # test that things working isn't just a coincident of PWD == BREKWIT_DIR
57+
- uses: pkgxdev/setup@v4
58+
- uses: ./co/.github/setup-pantry
59+
with:
60+
path: ${{github.workspace}}/co
5961
- uses: ./co/download-build-artifact
6062
with:
6163
pkg: ${{ needs.build.outputs.pkg }}
@@ -72,13 +74,14 @@ jobs:
7274
os:
7375
- ubuntu-latest
7476
- macos-latest
75-
env:
76-
PKGX_PANTRY_PATH: ${{github.workspace}}/co
7777
steps:
7878
- uses: actions/checkout@v4
7979
with:
80-
path: co # test that things working isn’t just a coincident of PWD == BREKWIT_DIR
81-
- uses: pkgxdev/setup@v2
80+
path: co # test that things working isn't just a coincident of PWD == BREKWIT_DIR
81+
- uses: pkgxdev/setup@v4
82+
- uses: ./co/.github/setup-pantry
83+
with:
84+
path: ${{github.workspace}}/co
8285
- uses: ./co/download-build-artifact
8386
with:
8487
pkg: ${{ needs.build.outputs.pkg }}
@@ -95,14 +98,15 @@ jobs:
9598
platform:
9699
- darwin+aarch64
97100
- linux+x86-64
98-
env:
99-
PKGX_PANTRY_PATH: ${{github.workspace}}/co
100101
steps:
101102
- uses: actions/checkout@v4
102103
with:
103-
path: co # test that things working isnt just a coincident of PWD == BREKWIT_DIR
104+
path: co # test that things working isn't just a coincident of PWD == BREKWIT_DIR
104105

105-
- uses: pkgxdev/setup@v2
106+
- uses: pkgxdev/setup@v4
107+
- uses: ./co/.github/setup-pantry
108+
with:
109+
path: ${{github.workspace}}/co
106110

107111
- uses: ./co/download-build-artifact
108112
id: dl
@@ -119,42 +123,38 @@ jobs:
119123

120124
- uses: actions/upload-artifact@v4
121125
with:
122-
path: ${{ steps.bottle.outputs.filename }}
123-
name: ${{ steps.bottle.outputs.name }}
126+
path: ${{ steps.bottle.outputs.filename }}
127+
name: ${{ steps.bottle.outputs.name }}
124128

125129
unavailable:
126130
runs-on: ubuntu-latest
127131
steps:
128132
- uses: actions/checkout@v4
129-
- uses: pkgxdev/setup@v2
133+
- uses: pkgxdev/setup@v4
134+
- uses: ./.github/setup-pantry
130135

131136
- uses: ./build
132137
id: build
133138
with:
134139
pkg: unavailable.com
135-
env:
136-
PKGX_PANTRY_PATH: ${{github.workspace}}
137140

138141
- run: echo ${{steps.build.outputs.noop}}
139142

140143
- run: exit 1
141144
if: ${{steps.build.outputs.noop != 'true'}}
142145

143146
id:
144-
env:
145-
PKGX_PANTRY_PATH: ${{github.workspace}}
146147
runs-on: ubuntu-latest
147148
outputs:
148149
pkgs: ${{ steps.id.outputs.pkgs }}
149150
steps:
150151
- uses: actions/checkout@v4
151-
- uses: pkgxdev/setup@v2
152+
- uses: pkgxdev/setup@v4
153+
- uses: ./.github/setup-pantry
152154
- uses: ./id
153155
id: id
154156
with:
155157
pkg: stark.com/foo
156-
env:
157-
PKGX_PANTRY_PATH: ${{github.workspace}}
158158
- run: test ${{ steps.id.outputs.version }} = 2.3.4
159159
- run: test ${{ steps.id.outputs.version-raw }} = 2.3.4
160160
- run: test -z "${{ steps.id.outputs.version-tag }}"

.github/workflows/ci.cli.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44

55
env:
66
GITHUB_TOKEN: ${{github.token}}
7-
PKGX_PANTRY_PATH: ${{github.workspace}}
87

98
jobs:
109
integration-tests:
@@ -33,11 +32,12 @@ jobs:
3332
runs-on: ${{ matrix.platform.os }}
3433
container: ${{ matrix.platform.img }}
3534
steps:
35+
# we need libc6-dev headers and gcc bits
36+
- run: apt-get update && apt-get install -y build-essential
37+
if: matrix.platform.img != null
3638
- uses: actions/checkout@v4
37-
- uses: pkgxdev/setup@v2
38-
39-
# otherwise, we're getting some weird race conditions on CI
40-
- run: pkgx --sync
39+
- uses: pkgxdev/setup@v4
40+
- uses: ./.github/setup-pantry
4141

4242
- run: bin/bk build ${{matrix.pkg}}
4343
- run: bin/bk test ${{matrix.pkg}}
@@ -47,7 +47,8 @@ jobs:
4747
runs-on: ubuntu-latest
4848
steps:
4949
- uses: actions/checkout@v4
50-
- uses: pkgxdev/setup@v2
50+
- uses: pkgxdev/setup@v4
51+
- run: ./.github/setup-pantry
5152
- uses: ./.github/modify-pantry
5253
- run: test $(bin/bk status) = stark.com/foo
5354
- run: bin/bk build
@@ -59,9 +60,10 @@ jobs:
5960

6061
unit-tests:
6162
runs-on: ubuntu-latest
62-
env:
63-
PKGX_PANTRY_PATH: null
6463
steps:
64+
- run: |
65+
unset PKGX_PANTRY_PATH
66+
unset PKGX_PANTRY_DIR
6567
- uses: actions/checkout@v4
6668
- uses: pkgxdev/dev@v1
6769
- run: deno test --allow-env --allow-net --ignore=.data
@@ -71,8 +73,8 @@ jobs:
7173
runs-on: ubuntu-latest
7274
steps:
7375
- uses: actions/checkout@v4
74-
- uses: pkgxdev/setup@v2
75-
- run: pkgx --sync # FIXME PKGX_PANTRY_PATH causes auto sync to fail
76+
- uses: pkgxdev/setup@v4
77+
- uses: ./.github/setup-pantry
7678
- name: build
7779
run: |
7880
set +e

audit/action.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ inputs:
55
description: |
66
* eg. pkgx.sh@1.1
77
* if unset uses `$BREWKIT_PKGSPEC`
8-
* if unset checks for modifications in `$PKGX_PANTRY_PATH`
8+
* if unset checks for modifications in `$PKGX_PANTRY_PATH || $PKGX_PANTRY_DIR`
99
required: false
1010
token:
1111
default: ${{ github.token }}
@@ -14,13 +14,6 @@ inputs:
1414
runs:
1515
using: composite
1616
steps:
17-
- run: |
18-
if ! pkgx --sync; then
19-
echo "::error::you must use: pkgxdev/setup before using this action"
20-
exit 1
21-
fi
22-
shell: bash
23-
2417
- name: fetch deno deps
2518
shell: bash
2619
run: |

bin/bk-docker

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ if [ -n "$VERBOSE" ]; then
1414
set -x
1515
fi
1616

17+
# name changed in v2
18+
export PKGX_PANTRY_PATH="${PKGX_PANTRY_PATH:-$PKGX_PANTRY_DIR}"
19+
1720
if [ ! -d "$PKGX_PANTRY_PATH" ]; then
1821
echo "error: \`brewkit docker\` can only be run from a pantry checkout" >&2
1922
exit 64

bin/bk-edit

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
set -eo pipefail
44

55
d="$(cd "$(dirname "$0")/.." && pwd)"
6+
# name changed in v2
7+
export PKGX_PANTRY_PATH="${PKGX_PANTRY_PATH:-$PKGX_PANTRY_DIR}"
68

79
if [ -z "$1" ]; then
810
if [ -z "$PKGX_PANTRY_PATH" ]; then

bin/bk-init

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33

44
set -eo pipefail
55

6+
# name changed in v2
7+
export PKGX_PANTRY_PATH="${PKGX_PANTRY_PATH:-$PKGX_PANTRY_DIR}"
8+
69
if test -z "$PKGX_PANTRY_PATH"; then
710
echo "error: PKGX_PANTRY_PATH is not set" >&2
811
exit 1

bin/bk-status

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#!/usr/bin/env -S pkgx +git +column bash -eo pipefail
22
# shellcheck shell=bash
33

4+
# name changed in v2
5+
export PKGX_PANTRY_PATH="${PKGX_PANTRY_PATH:-$PKGX_PANTRY_DIR}"
6+
47
GIT_DIR="$PKGX_PANTRY_PATH"
58

69
if ! d="$(git rev-parse --show-toplevel 2>/dev/null)"; then

build/action.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,6 @@ outputs:
3636
runs:
3737
using: composite
3838
steps:
39-
- name: prep
40-
run: |
41-
if ! pkgx --sync; then
42-
echo "::error::you must use: pkgxdev/setup before using this action"
43-
exit 1
44-
fi
45-
shell: bash
46-
4739
- name: fetch deno deps
4840
shell: bash
4941
run: |
@@ -54,8 +46,9 @@ runs:
5446
5547
- name: build
5648
run: |
57-
if [ -d projects -a -z "$PKGX_PANTRY_PATH" ]; then
49+
if [ -d projects -a -z "$PKGX_PANTRY_PATH" -a -z "$PKGX_PANTRY_DIR" ]; then
5850
export PKGX_PANTRY_PATH="$PWD/projects"
51+
export PKGX_PANTRY_DIR="$PWD/projects"
5952
fi
6053
6154
set +e

0 commit comments

Comments
 (0)