1010 build :
1111 runs-on : ${{ matrix.os }}
1212 container : ${{ matrix.container && matrix.container || '' }}
13- name : ${{ matrix.name }}${{ matrix.arch && format('-{0}', matrix.arch) || '' }} build${{ matrix.arch != 'arm64-v8a' && matrix.name != 'ios-sim' && matrix.name != 'ios' && matrix.name != 'apple-xcframework' && matrix.name != 'android-aar' && ' + test' || ''}}
13+ name : ${{ matrix.name }}${{ matrix.arch && format('-{0}', matrix.arch) || '' }} build${{ matrix.arch != 'arm64-v8a' && matrix.name != 'ios-sim' && matrix.name != 'ios' && matrix.name != 'apple-xcframework' && matrix.name != 'android-aar' && ( matrix.name != 'macos' || matrix.arch != 'x86_64' ) && ' + test' || ''}}
1414 timeout-minutes : 20
1515 strategy :
1616 fail-fast : false
3131 name : linux-musl
3232 - os : macos-15
3333 name : macos
34+ - os : macos-15
35+ arch : x86_64
36+ name : macos
37+ make : ARCH=x86_64
38+ - os : macos-15
39+ arch : arm64
40+ name : macos
41+ make : ARCH=arm64
3442 - os : windows-2022
3543 arch : x86_64
3644 name : windows
@@ -171,7 +179,7 @@ jobs:
171179 adb shell "sh /data/local/tmp/commands.sh"
172180
173181 - name : test sqlite-vector
174- if : contains(matrix.name, 'linux') || matrix.name == 'windows' || matrix.name == 'macos'
182+ if : contains(matrix.name, 'linux') || matrix.name == 'windows' || ( matrix.name == 'macos' && matrix.arch != 'x86_64' )
175183 run : ${{ matrix.name == 'linux-musl' && matrix.arch == 'arm64' && 'docker exec alpine' || '' }} make test ${{ matrix.make && matrix.make || ''}}
176184
177185 - uses : actions/upload-artifact@v4.6.2
@@ -198,12 +206,76 @@ jobs:
198206 with :
199207 path : artifacts
200208
209+ - name : zip artifacts
210+ run : |
211+ VERSION=$(make version)
212+ for folder in "artifacts"/*; do
213+ if [ -d "$folder" ]; then
214+ name=$(basename "$folder")
215+ if [[ "$name" != "vector-apple-xcframework" && "$name" != "vector-android-aar" ]]; then
216+ tar -czf "${name}-${VERSION}.tar.gz" -C "$folder" .
217+ fi
218+ if [[ "$name" != "vector-android-aar" ]]; then
219+ (cd "$folder" && zip -rq "../../${name}-${VERSION}.zip" .)
220+ else
221+ cp "$folder"/*.aar "${name}-${VERSION}.aar"
222+ fi
223+ fi
224+ done
225+
201226 - name : release tag version from sqlite-vector.h
202227 id : tag
203228 run : |
204229 VERSION=$(make version)
205230 if [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
206- LATEST=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r '.name')
231+ LATEST_RELEASE=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/releases/latest)
232+ LATEST=$(echo "$LATEST_RELEASE" | jq -r '.name')
233+
234+ # Check artifact sizes against previous release
235+ if [ -n "$LATEST" ] && [ "$LATEST" != "null" ]; then
236+ echo "Checking artifact sizes against previous release: $LATEST"
237+ FAILED=0
238+
239+ for artifact in vector-*-${VERSION}.*; do
240+ if [ ! -f "$artifact" ]; then
241+ continue
242+ fi
243+
244+ # Get current artifact size
245+ NEW_SIZE=$(stat -c%s "$artifact" 2>/dev/null || stat -f%z "$artifact")
246+
247+ # Get artifact name for previous release
248+ ARTIFACT_NAME=$(echo "$artifact" | sed "s/${VERSION}/${LATEST}/")
249+
250+ # Get previous artifact size from GitHub API
251+ OLD_SIZE=$(echo "$LATEST_RELEASE" | jq -r ".assets[] | select(.name == \"$(basename "$ARTIFACT_NAME")\") | .size")
252+
253+ if [ -z "$OLD_SIZE" ] || [ "$OLD_SIZE" = "null" ]; then
254+ echo "⚠️ Previous artifact not found: $(basename "$ARTIFACT_NAME"), skipping comparison"
255+ continue
256+ fi
257+
258+ # Calculate percentage increase
259+ INCREASE=$(awk "BEGIN {printf \"%.2f\", (($NEW_SIZE - $OLD_SIZE) / $OLD_SIZE) * 100}")
260+
261+ echo "📦 $artifact: $OLD_SIZE → $NEW_SIZE bytes (${INCREASE}% change)"
262+
263+ # Check if increase is more than 5%
264+ if (( $(echo "$INCREASE > 5" | bc -l) )); then
265+ echo "❌ ERROR: $artifact size increased by ${INCREASE}% (limit: 5%)"
266+ FAILED=1
267+ fi
268+ done
269+
270+ if [ $FAILED -eq 1 ]; then
271+ echo ""
272+ echo "❌ One or more artifacts exceeded the 5% size increase limit"
273+ exit 1
274+ fi
275+
276+ echo "✅ All artifacts within 5% size increase limit"
277+ fi
278+
207279 if [[ "$VERSION" != "$LATEST" || "$GITHUB_EVENT_NAME" == "workflow_dispatch" ]]; then
208280 echo "version=$VERSION" >> $GITHUB_OUTPUT
209281 else
@@ -234,23 +306,6 @@ jobs:
234306 git add modules/sqlite-vector
235307 git commit -m "Bump sqlite-vector version to ${{ steps.tag.outputs.version }}"
236308 git push origin main
237-
238- - name : zip artifacts
239- if : steps.tag.outputs.version != ''
240- run : |
241- for folder in "artifacts"/*; do
242- if [ -d "$folder" ]; then
243- name=$(basename "$folder")
244- if [[ "$name" != "vector-apple-xcframework" && "$name" != "vector-android-aar" ]]; then
245- tar -czf "${name}-${{ steps.tag.outputs.version }}.tar.gz" -C "$folder" .
246- fi
247- if [[ "$name" != "vector-android-aar" ]]; then
248- (cd "$folder" && zip -rq "../../${name}-${{ steps.tag.outputs.version }}.zip" .)
249- else
250- cp "$folder"/*.aar "${name}-${{ steps.tag.outputs.version }}.aar"
251- fi
252- fi
253- done
254309
255310 - uses : actions/setup-java@v4
256311 if : steps.tag.outputs.version != ''
@@ -260,12 +315,7 @@ jobs:
260315
261316 - name : release android aar to maven central
262317 if : steps.tag.outputs.version != ''
263- run : cd packages/android && ./gradlew publishToCentralPortal -PVERSION=${{ steps.tag.outputs.version }}
264- env :
265- SONATYPE_USERNAME : ${{ secrets.MAVEN_CENTRAL_USERNAME }}
266- SONATYPE_PASSWORD : ${{ secrets.MAVEN_CENTRAL_TOKEN }}
267- SIGNING_KEY : ${{ secrets.SIGNING_KEY }}
268- SIGNING_PASSWORD : ${{ secrets.SIGNING_PASSWORD }}
318+ run : cd packages/android && ./gradlew publishAggregationToCentralPortal -PSIGNING_KEY="${{ secrets.SIGNING_KEY }}" -PSIGNING_PASSWORD="${{ secrets.SIGNING_PASSWORD }}" -PSONATYPE_USERNAME="${{ secrets.MAVEN_CENTRAL_USERNAME }}" -PSONATYPE_PASSWORD="${{ secrets.MAVEN_CENTRAL_TOKEN }}" -PVERSION="${{ steps.tag.outputs.version }}" -PAAR_PATH="../../artifacts/vector-android-aar/vector.aar"
269319
270320 - uses : softprops/action-gh-release@v2.2.1
271321 if : steps.tag.outputs.version != ''
0 commit comments