From 9fef9177c85521c336e62f677370b7ac705682e1 Mon Sep 17 00:00:00 2001 From: Marco Bambini Date: Fri, 13 Nov 2026 14:08:45 +0100 Subject: [PATCH] fix: give the node and Flutter packages the version they are published at Both carried a number from several releases back: packages/node/package.json said 1.1.14 and packages/flutter/pubspec.yaml 1.2.3, while the extension was at 1.4.1. The release job writes the real version into the working copy before publishing but never committed it, so the repository went on showing whatever was last committed. For the node package that was not only confusing. Its optionalDependencies pinned the seven platform packages to 1.1.14 as well, so an npm install in packages/node fetched binaries from long before the current source: no memory limit, no interrupt handler, none of the stack work. The published package was always right, since the release job rewrites all eight versions with jq before npm publish; only the repository was wrong. Both files now say 1.4.2, which is what is published, and the release job commits them from now on, in the same [auto-update] commit as the Package.swift checksum. The Flutter pubspec is rewritten there too, since flutter-package.yml only rewrites it after the tag; its sed stays as the safety net it is. The commit message keeps [auto-update], which is what keeps the build job from running again for it. Checked that all seven platform packages exist at 1.4.2 on the registry, so the pinned version resolves. Co-Authored-By: Claude Opus 5 --- .github/workflows/main.yml | 26 ++++++++++++++++++++------ packages/flutter/pubspec.yaml | 2 +- packages/node/package.json | 16 ++++++++-------- 3 files changed, 29 insertions(+), 15 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4dd262d..8d97000 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -331,23 +331,37 @@ jobs: echo " Platform packages: 7" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" - - name: update Package.swift checksum and version + - name: update Package.swift and the package versions if: steps.tag.outputs.version != '' run: | VERSION=${{ steps.tag.outputs.version }} + + # The versions the steps above publish under are written into the working copy but were + # never committed, so the repository kept showing whatever it was last committed with: + # packages/node/package.json said 1.1.14 and the Flutter pubspec 1.2.3 while the + # extension was at 1.4.1. For the node package that was not only confusing, since its + # optionalDependencies pinned the seven platform packages to that old version too, so + # an npm install in packages/node fetched binaries from long before the current source. + # package.json was rewritten by the publish step above; the pubspec is rewritten by + # flutter-package.yml after the tag, so it is done here as well to commit it with the + # rest. Its sed there is then a no-op, and stays as the safety net it is. + sed -i "s/^version: .*/version: $VERSION/" packages/flutter/pubspec.yaml + ZIP="js-apple-xcframework-${VERSION}.zip" if [ -f "$ZIP" ]; then CHECKSUM=$(swift package compute-checksum "$ZIP") URL="https://github.com/sqliteai/sqlite-js/releases/download/${VERSION}/${ZIP}" sed -i "s|url: \".*apple-xcframework.*\"|url: \"${URL}\"|" Package.swift sed -i "s|checksum: \".*\"|checksum: \"${CHECKSUM}\"|" Package.swift - git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com" - git config --global user.name "$GITHUB_ACTOR" - git add Package.swift - git commit -m "Update Package.swift checksum for ${VERSION} [auto-update]" || true - git push origin main || true fi + git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com" + git config --global user.name "$GITHUB_ACTOR" + git add Package.swift packages/node/package.json packages/flutter/pubspec.yaml + # [auto-update] keeps the build job from running again for this commit + git commit -m "Update Package.swift and the package versions for ${VERSION} [auto-update]" || true + git push origin main || true + - uses: softprops/action-gh-release@v2.2.1 if: steps.tag.outputs.version != '' with: diff --git a/packages/flutter/pubspec.yaml b/packages/flutter/pubspec.yaml index fac5c48..97f70a7 100644 --- a/packages/flutter/pubspec.yaml +++ b/packages/flutter/pubspec.yaml @@ -1,5 +1,5 @@ name: sqlite_js -version: 1.2.3 +version: 1.4.2 description: > SQLite JS is a powerful extension that brings JavaScript capabilities to SQLite. With this extension, you can create custom SQLite functions, aggregates, diff --git a/packages/node/package.json b/packages/node/package.json index 2f99688..1e03d44 100644 --- a/packages/node/package.json +++ b/packages/node/package.json @@ -1,6 +1,6 @@ { "name": "@sqliteai/sqlite-js", - "version": "1.1.14", + "version": "1.4.2", "description": "SQLite JS extension for Node.js - Custom SQLite functions in JavaScript", "main": "./dist/index.js", "module": "./dist/index.mjs", @@ -53,13 +53,13 @@ "node": ">=16.0.0" }, "optionalDependencies": { - "@sqliteai/sqlite-js-darwin-arm64": "1.1.14", - "@sqliteai/sqlite-js-darwin-x86_64": "1.1.14", - "@sqliteai/sqlite-js-linux-arm64": "1.1.14", - "@sqliteai/sqlite-js-linux-arm64-musl": "1.1.14", - "@sqliteai/sqlite-js-linux-x86_64": "1.1.14", - "@sqliteai/sqlite-js-linux-x86_64-musl": "1.1.14", - "@sqliteai/sqlite-js-win32-x86_64": "1.1.14" + "@sqliteai/sqlite-js-darwin-arm64": "1.4.2", + "@sqliteai/sqlite-js-darwin-x86_64": "1.4.2", + "@sqliteai/sqlite-js-linux-arm64": "1.4.2", + "@sqliteai/sqlite-js-linux-arm64-musl": "1.4.2", + "@sqliteai/sqlite-js-linux-x86_64": "1.4.2", + "@sqliteai/sqlite-js-linux-x86_64-musl": "1.4.2", + "@sqliteai/sqlite-js-win32-x86_64": "1.4.2" }, "devDependencies": { "@types/node": "^20.0.0",