Skip to content

Commit 436d463

Browse files
author
Marcus Pousette
committed
fix: prebuild pipeline
1 parent 78d94cb commit 436d463

1 file changed

Lines changed: 32 additions & 13 deletions

File tree

.github/workflows/prebuilt.yml

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ jobs:
5555
run: |
5656
set -e
5757
ART=""
58-
for f in sqlite-vec/sqlite-vec.*.so sqlite-vec/sqlite-vec.*.dylib sqlite-vec/sqlite-vec.*.dll sqlite-vec/sqlite-vec.so sqlite-vec/sqlite-vec.dylib sqlite-vec/sqlite-vec.dll; do
58+
for f in \
59+
sqlite-vec/dist/*.so sqlite-vec/dist/*.dylib sqlite-vec/dist/*.dll \
60+
sqlite-vec/sqlite-vec.*.so sqlite-vec/sqlite-vec.*.dylib sqlite-vec/sqlite-vec.*.dll \
61+
sqlite-vec/sqlite-vec.so sqlite-vec/sqlite-vec.dylib sqlite-vec/sqlite-vec.dll; do
5962
if [ -f "$f" ]; then ART="$f"; break; fi
6063
done
6164
if [ -z "$ART" ]; then echo "::error::No sqlite-vec artifact found"; exit 1; fi
@@ -79,13 +82,18 @@ jobs:
7982
gh release upload "${{ steps.ver.outputs.tag }}" "$NAME.sha256" --clobber
8083
8184
prebuild-alpine:
82-
if: ${{ github.event_name == 'release' }}
8385
name: Prebuild on alpine
8486
runs-on: ubuntu-latest
8587
needs: build-matrix
8688
container: node:20-alpine
8789
steps:
8890
- uses: actions/checkout@v4
91+
- name: Resolve tag
92+
id: ver
93+
shell: sh
94+
run: |
95+
VER=$(node -p "require('./package.json').version")
96+
echo "tag=v${VER#v}" >> $GITHUB_OUTPUT
8997
- run: apk add build-base git python3 py3-setuptools --update-cache
9098
- run: git clone --depth 1 https://github.com/asg017/sqlite-vec.git
9199
- run: |
@@ -96,16 +104,16 @@ jobs:
96104
shell: sh
97105
run: |
98106
set -e
99-
ART=$(ls sqlite-vec/sqlite-vec*.so || true)
107+
ART=""
108+
for f in sqlite-vec/dist/*.so sqlite-vec/sqlite-vec*.so; do [ -f "$f" ] && ART="$f" && break; done
100109
[ -n "$ART" ] || (echo "No artifact" && exit 1)
101110
NAME=sqlite-vec-linux-x64-musl.so
102111
echo "Uploading $NAME"
103-
gh release upload "${{ needs.build-matrix.outputs.tag || steps.ver.outputs.tag }}" "$ART#$NAME" --clobber
112+
gh release upload "${{ steps.ver.outputs.tag }}" "$ART#$NAME" --clobber
104113
node -e "const fs=require('fs');const c=require('crypto');const d=fs.readFileSync(process.argv[1]);const h=c.createHash('sha256').update(d).digest('hex');fs.writeFileSync(process.argv[1]+'.sha256', h+' '+process.argv[2]);" "$NAME" "$NAME"
105-
gh release upload "${{ needs.build-matrix.outputs.tag || steps.ver.outputs.tag }}" "$NAME.sha256" --clobber
114+
gh release upload "${{ steps.ver.outputs.tag }}" "$NAME.sha256" --clobber
106115
107116
prebuild-alpine-arm:
108-
if: ${{ github.event_name == 'release' }}
109117
name: Prebuild on alpine (arm)
110118
runs-on: ubuntu-latest
111119
needs: build-matrix
@@ -116,6 +124,11 @@ jobs:
116124
steps:
117125
- uses: actions/checkout@v4
118126
- uses: docker/setup-qemu-action@v3
127+
- name: Resolve tag
128+
id: ver
129+
run: |
130+
VER=$(node -p "require('./package.json').version")
131+
echo "tag=v${VER#v}" >> $GITHUB_OUTPUT
119132
- name: Build (alpine ${{ matrix.arch }})
120133
run: |
121134
docker run --rm -v $PWD:/w --entrypoint /bin/sh --platform linux/${{ matrix.arch }} node:20-alpine -c '
@@ -129,21 +142,26 @@ jobs:
129142
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
130143
run: |
131144
set -e
132-
ART=$(ls sqlite-vec/sqlite-vec*.so)
145+
ART=""
146+
for f in sqlite-vec/dist/*.so sqlite-vec/sqlite-vec*.so; do [ -f "$f" ] && ART="$f" && break; done
133147
if [ "${{ matrix.arch }}" = "arm/v7" ]; then ARCH=armv7; else ARCH=arm64; fi
134148
NAME=sqlite-vec-linux-$ARCH-musl.so
135-
gh release upload "${{ github.event.release.tag_name }}" "$ART#$NAME" --clobber
149+
gh release upload "${{ steps.ver.outputs.tag }}" "$ART#$NAME" --clobber
136150
node -e "const fs=require('fs');const c=require('crypto');const d=fs.readFileSync(process.argv[1]);const h=c.createHash('sha256').update(d).digest('hex');fs.writeFileSync(process.argv[1]+'.sha256', h+' '+process.argv[2]);" "$NAME" "$NAME"
137-
gh release upload "${{ github.event.release.tag_name }}" "$NAME.sha256" --clobber
151+
gh release upload "${{ steps.ver.outputs.tag }}" "$NAME.sha256" --clobber
138152
139153
prebuild-linux-arm:
140-
if: ${{ github.event_name == 'release' }}
141154
name: Prebuild on Linux (arm64)
142155
runs-on: ubuntu-latest
143156
needs: build-matrix
144157
steps:
145158
- uses: actions/checkout@v4
146159
- uses: docker/setup-qemu-action@v3
160+
- name: Resolve tag
161+
id: ver
162+
run: |
163+
VER=$(node -p "require('./package.json').version")
164+
echo "tag=v${VER#v}" >> $GITHUB_OUTPUT
147165
- name: Build manylinux (arm64)
148166
run: |
149167
docker run --rm -v $PWD:/w --entrypoint /bin/sh --platform linux/arm64 node:20-bullseye -c '
@@ -157,8 +175,9 @@ jobs:
157175
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
158176
run: |
159177
set -e
160-
ART=$(ls sqlite-vec/sqlite-vec*.so)
178+
ART=""
179+
for f in sqlite-vec/dist/*.so sqlite-vec/sqlite-vec*.so; do [ -f "$f" ] && ART="$f" && break; done
161180
NAME=sqlite-vec-linux-arm64-gnu.so
162-
gh release upload "${{ needs.build-matrix.outputs.tag || steps.ver.outputs.tag }}" "$ART#$NAME" --clobber
181+
gh release upload "${{ steps.ver.outputs.tag }}" "$ART#$NAME" --clobber
163182
node -e "const fs=require('fs');const c=require('crypto');const d=fs.readFileSync(process.argv[1]);const h=c.createHash('sha256').update(d).digest('hex');fs.writeFileSync(process.argv[1]+'.sha256', h+' '+process.argv[2]);" "$NAME" "$NAME"
164-
gh release upload "${{ needs.build-matrix.outputs.tag || steps.ver.outputs.tag }}" "$NAME.sha256" --clobber
183+
gh release upload "${{ steps.ver.outputs.tag }}" "$NAME.sha256" --clobber

0 commit comments

Comments
 (0)