From 18c5935fc66f299afa013780b104b4896580008a Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Thu, 7 Aug 2025 15:00:16 +0200 Subject: [PATCH 1/6] bump version to 1.1.7 --- src/sqlitejs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sqlitejs.h b/src/sqlitejs.h index 20d76b4..8f0cc55 100644 --- a/src/sqlitejs.h +++ b/src/sqlitejs.h @@ -16,7 +16,7 @@ #include "sqlite3.h" #endif -#define SQLITE_JS_VERSION "1.1.6" +#define SQLITE_JS_VERSION "1.1.7" int sqlite3_js_init (sqlite3 *db, char **pzErrMsg, const sqlite3_api_routines *pApi); const char *sqlitejs_version (void); From ffe1fc405f81e74bd64b4e8203a9307608dbd4d3 Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Thu, 7 Aug 2025 15:56:24 +0200 Subject: [PATCH 2/6] Refactor Makefile and Workflow file --- .github/workflows/release.yml | 102 ++++++++++++--------- Makefile | 162 ++++++++++++++++++++++++---------- 2 files changed, 176 insertions(+), 88 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a477230..1f6dca8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,64 +8,84 @@ permissions: jobs: build: runs-on: ${{ matrix.os }} - name: ${{ matrix.name }}${{ matrix.arch && format('-{0}', matrix.arch) || '' }} build${{ matrix.arch != 'arm64-v8a' && matrix.name != 'isim' && matrix.name != 'ios' && ' + test' || ''}} + container: ${{ matrix.container && matrix.container || '' }} + 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' && ' + test' || ''}} timeout-minutes: 20 strategy: fail-fast: false matrix: include: - - os: macos-latest - name: isim - make: PLATFORM=isim - - os: macos-latest - name: ios - make: PLATFORM=ios - - os: ubuntu-latest - arch: arm64-v8a - name: android - make: - PLATFORM=android - CC=$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android26-clang - - os: ubuntu-latest - arch: x86_64 - name: android - make: - PLATFORM=android - CC=$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android26-clang - sqlite-amalgamation-zip: https://sqlite.org/2025/sqlite-amalgamation-3490100.zip - - os: ubuntu-latest + - os: ubuntu-22.04 arch: x86_64 name: linux - - os: LinuxARM64 + - os: ubuntu-22.04-arm arch: arm64 name: linux - - os: macos-latest + - os: ubuntu-22.04 + arch: x86_64 + name: linux-musl + container: alpine:latest + - os: ubuntu-22.04-arm + arch: arm64 + name: linux-musl + - os: macos-15 name: macos - - os: windows-latest + - os: windows-2022 arch: x86_64 name: windows + - os: ubuntu-22.04 + arch: arm64-v8a + name: android + make: PLATFORM=android ARCH=arm64-v8a + - os: ubuntu-22.04 + arch: x86_64 + name: android + make: PLATFORM=android ARCH=x86_64 + sqlite-amalgamation-zip: https://sqlite.org/2025/sqlite-amalgamation-3490100.zip + - os: macos-15 + name: ios + make: PLATFORM=ios + - os: macos-15 + name: ios-sim + make: PLATFORM=ios-sim + - os: macos-15 + name: apple-xcframework + make: xcframework defaults: run: - shell: bash - env: - MAKEFLAGS: -j 8 + shell: ${{ matrix.container && 'sh' || 'bash' }} steps: - uses: actions/checkout@v4.2.2 - - name: build sqlite-js - run: make ${{ matrix.make && matrix.make || ''}} - - - name: windows install sqlite3 - if: matrix.os == 'windows-latest' + - name: windows install dependencies + if: matrix.name == 'windows' run: choco install sqlite -y - - name: macos install sqlite3 without SQLITE_OMIT_LOAD_EXTENSION + - name: macos install dependencies if: matrix.name == 'macos' run: brew link sqlite --force + - name: linux-musl x86_64 install dependencies + if: matrix.name == 'linux-musl' && matrix.arch == 'x86_64' + run: apk update && apk add --no-cache gcc make sqlite musl-dev linux-headers + + - name: linux-musl arm64 setup container + if: matrix.name == 'linux-musl' && matrix.arch == 'arm64' + run: | + docker run -d --name alpine \ + --platform linux/arm64 \ + -v ${{ github.workspace }}:/workspace \ + -w /workspace \ + alpine:latest \ + tail -f /dev/null + docker exec alpine sh -c "apk update && apk add --no-cache gcc make sqlite musl-dev linux-headers" + + - name: build sqlite-js + run: ${{ matrix.name == 'linux-musl' && matrix.arch == 'arm64' && 'docker exec alpine' || '' }} make extension ${{ matrix.make && matrix.make || ''}} + - name: android setup test environment if: matrix.name == 'android' && matrix.arch != 'arm64-v8a' run: | @@ -80,16 +100,16 @@ jobs: curl -O ${{ matrix.sqlite-amalgamation-zip }} unzip sqlite-amalgamation-*.zip export ${{ matrix.make }} - $CC sqlite-amalgamation-*/shell.c sqlite-amalgamation-*/sqlite3.c -o sqlite3 -ldl + $ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/${{ matrix.arch }}-linux-android26-clang sqlite-amalgamation-*/shell.c sqlite-amalgamation-*/sqlite3.c -o sqlite3 -ldl rm -rf sqlite-amalgamation-*.zip sqlite-amalgamation-* echo "::endgroup::" echo "::group::prepare the test script" - make test CC=$CC PLATFORM=$PLATFORM || echo "It should fail. Running remaining commands in the emulator" + make test PLATFORM=$PLATFORM ARCH=$ARCH || echo "It should fail. Running remaining commands in the emulator" cat > commands.sh << EOF mv -f /data/local/tmp/sqlite3 /system/xbin cd /data/local/tmp - $(make test CC=$CC PLATFORM=$PLATFORM -n) + $(make test PLATFORM=$PLATFORM ARCH=$ARCH -n) EOF echo "::endgroup::" @@ -106,8 +126,8 @@ jobs: adb shell "sh /data/local/tmp/commands.sh" - name: test sqlite-js - if: matrix.name == 'linux' || matrix.name == 'macos' || matrix.name == 'windows' - run: make test + if: contains(matrix.name, 'linux') || matrix.name == 'windows' || matrix.name == 'macos' + run: ${{ matrix.name == 'linux-musl' && matrix.arch == 'arm64' && 'docker exec alpine' || '' }} make test ${{ matrix.make && matrix.make || ''}} - uses: actions/upload-artifact@v4.6.2 with: @@ -116,7 +136,7 @@ jobs: if-no-files-found: error release: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 name: release needs: build if: github.ref == 'refs/heads/main' @@ -154,8 +174,7 @@ jobs: for folder in "artifacts"/*; do if [ -d "$folder" ]; then name=$(basename "$folder") - zip -jq "${name}-${{ steps.tag.outputs.version }}.zip" "$folder"/* - tar -cJf "${name}-${{ steps.tag.outputs.version }}.tar.xz" -C "$folder" . + (cd "$folder" && zip -rq "../../${name}-${{ steps.tag.outputs.version }}.zip" .) tar -czf "${name}-${{ steps.tag.outputs.version }}.tar.gz" -C "$folder" . fi done @@ -167,6 +186,5 @@ jobs: tag_name: ${{ steps.tag.outputs.version }} files: | js-*-${{ steps.tag.outputs.version }}.zip - js-*-${{ steps.tag.outputs.version }}.tar.xz js-*-${{ steps.tag.outputs.version }}.tar.gz make_latest: true diff --git a/Makefile b/Makefile index 018a298..1f22af9 100644 --- a/Makefile +++ b/Makefile @@ -3,16 +3,23 @@ # Set default platform if not specified ifeq ($(OS),Windows_NT) - PLATFORM := windows + PLATFORM := windows + HOST := windows + CPUS := $(shell powershell -Command "[Environment]::ProcessorCount") else - UNAME_S := $(shell uname -s) - ifeq ($(UNAME_S),Darwin) - PLATFORM := macos - else - PLATFORM := linux - endif + HOST = $(shell uname -s | tr '[:upper:]' '[:lower:]') + ifeq ($(HOST),darwin) + PLATFORM := macos + CPUS := $(shell sysctl -n hw.ncpu) + else + PLATFORM := $(HOST) + CPUS := $(shell nproc) + endif endif +# Speed up builds by using all available CPU cores +MAKEFLAGS += -j$(CPUS) + # Directories SRC_DIR := src LIB_DIR := libs @@ -31,40 +38,50 @@ CFLAGS := -Wall -Wextra -fPIC -g -O2 -DQJS_BUILD_LIBC $(INCLUDES) # Platform-specific settings ifeq ($(PLATFORM),windows) - TARGET := $(DIST_DIR)/js.dll - LDFLAGS := -shared - # Create .def file for Windows - DEF_FILE := $(BUILD_DIR)/js.def + TARGET := $(DIST_DIR)/js.dll + LDFLAGS := -shared + # Create .def file for Windows + DEF_FILE := $(BUILD_DIR)/js.def + STRIP = strip --strip-unneeded $@ else ifeq ($(PLATFORM),macos) - TARGET := $(DIST_DIR)/js.dylib - LDFLAGS := -arch x86_64 -arch arm64 -dynamiclib -undefined dynamic_lookup - # macOS-specific flags - CFLAGS += -arch x86_64 -arch arm64 + TARGET := $(DIST_DIR)/js.dylib + LDFLAGS := -arch x86_64 -arch arm64 -dynamiclib -undefined dynamic_lookup + # macOS-specific flags + CFLAGS += -arch x86_64 -arch arm64 + STRIP = strip -x -S $@ else ifeq ($(PLATFORM),android) - # Use Android NDK's Clang compiler, the user should set the CC - # example CC=$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android26-clang - ifeq ($(filter %-clang,$(CC)),) - $(error "CC must be set to the Android NDK's Clang compiler") - endif - TARGET := $(DIST_DIR)/js.so - LDFLAGS := -shared -lm - # Android-specific flags - CFLAGS += -D__ANDROID__ + ifndef ARCH # Set ARCH to find Android NDK's Clang compiler, the user should set the ARCH + $(error "Android ARCH must be set to ARCH=x86_64 or ARCH=arm64-v8a") + endif + ifndef ANDROID_NDK # Set ANDROID_NDK path to find android build tools; e.g. on MacOS: export ANDROID_NDK=/Users/username/Library/Android/sdk/ndk/25.2.9519653 + $(error "Android NDK must be set") + endif + BIN = $(ANDROID_NDK)/toolchains/llvm/prebuilt/$(HOST)-x86_64/bin + ifneq (,$(filter $(ARCH),arm64 arm64-v8a)) + override ARCH := aarch64 + endif + CC = $(BIN)/$(ARCH)-linux-android26-clang + TARGET := $(DIST_DIR)/js.so + LDFLAGS := -lm -shared + STRIP = $(BIN)/llvm-strip --strip-unneeded $@ else ifeq ($(PLATFORM),ios) - TARGET := $(DIST_DIR)/js.dylib - SDK := -isysroot $(shell xcrun --sdk iphoneos --show-sdk-path) -miphoneos-version-min=11.0 - LDFLAGS := -dynamiclib $(SDK) - # iOS-specific flags - CFLAGS += -arch arm64 $(SDK) -else ifeq ($(PLATFORM),isim) - TARGET := $(DIST_DIR)/js.dylib - SDK := -isysroot $(shell xcrun --sdk iphonesimulator --show-sdk-path) -miphonesimulator-version-min=11.0 - LDFLAGS := -arch x86_64 -arch arm64 -dynamiclib $(SDK) - # iphonesimulator-specific flags - CFLAGS += -arch x86_64 -arch arm64 $(SDK) + TARGET := $(DIST_DIR)/js.dylib + SDK := -isysroot $(shell xcrun --sdk iphoneos --show-sdk-path) -miphoneos-version-min=11.0 + LDFLAGS := -dynamiclib $(SDK) + # iOS-specific flags + CFLAGS += -arch arm64 $(SDK) + STRIP = strip -x -S $@ +else ifeq ($(PLATFORM),ios-sim) + TARGET := $(DIST_DIR)/js.dylib + SDK := -isysroot $(shell xcrun --sdk iphonesimulator --show-sdk-path) -miphonesimulator-version-min=11.0 + LDFLAGS := -arch x86_64 -arch arm64 -dynamiclib $(SDK) + # iphonesimulator-specific flags + CFLAGS += -arch x86_64 -arch arm64 $(SDK) + STRIP = strip -x -S $@ else # linux - TARGET := $(DIST_DIR)/js.so - LDFLAGS := -lm -shared + TARGET := $(DIST_DIR)/js.so + LDFLAGS := -lm -shared + STRIP = strip --strip-unneeded $@ endif # Object files @@ -83,6 +100,8 @@ ifeq ($(PLATFORM),windows) # Generate import library for Windows dlltool -D $@ -d $(DEF_FILE) -l $(DIST_DIR)/js.lib endif + # Strip debug symbols + $(STRIP) # Compile source files $(BUILD_DIR)/%.o: $(SRC_DIR)/%.c @@ -138,25 +157,76 @@ test: $(TARGET) $(TEST_TARGET) sqlite3 ":memory:" -cmd ".bail on" ".load ./$<" "SELECT js_eval('console.log(\"hello, world\nToday is\", new Date().toLocaleDateString())');" ./$(TEST_TARGET) +.NOTPARALLEL: %.dylib +%.dylib: + rm -rf $(BUILD_DIR) && $(MAKE) PLATFORM=$* + mv $(DIST_DIR)/js.dylib $(DIST_DIR)/$@ + +define PLIST +\ +\ +\ +\ +CFBundleDevelopmentRegion\ +en\ +CFBundleExecutable\ +js\ +CFBundleIdentifier\ +ai.sqlite.js\ +CFBundleInfoDictionaryVersion\ +6.0\ +CFBundlePackageType\ +FMWK\ +CFBundleSignature\ +????\ +CFBundleVersion\ +$(shell make version)\ +CFBundleShortVersionString\ +$(shell make version)\ +MinimumOSVersion\ +11.0\ +\ + +endef + +LIB_NAMES = ios.dylib ios-sim.dylib macos.dylib +FMWK_NAMES = ios-arm64 ios-arm64_x86_64-simulator macos-arm64_x86_64 +$(DIST_DIR)/%.xcframework: $(LIB_NAMES) + @$(foreach i,1 2 3,\ + lib=$(word $(i),$(LIB_NAMES)); \ + fmwk=$(word $(i),$(FMWK_NAMES)); \ + mkdir -p $(DIST_DIR)/$$fmwk/js.framework; \ + printf "$(PLIST)" > $(DIST_DIR)/$$fmwk/js.framework/Info.plist; \ + mv $(DIST_DIR)/$$lib $(DIST_DIR)/$$fmwk/js.framework/js; \ + install_name_tool -id "@rpath/js.framework/js" $(DIST_DIR)/$$fmwk/js.framework/js; \ + ) + xcodebuild -create-xcframework $(foreach fmwk,$(FMWK_NAMES),-framework $(DIST_DIR)/$(fmwk)/js.framework) -output $@ + rm -rf $(foreach fmwk,$(FMWK_NAMES),$(DIST_DIR)/$(fmwk)) + +xcframework: $(DIST_DIR)/js.xcframework + +version: + @echo $(shell sed -n 's/^#define SQLITE_JS_VERSION[[:space:]]*"\([^"]*\)".*/\1/p' src/sqlitejs.h) + # Help message help: @echo "SQLite JavaScript Extension Makefile" @echo "Usage:" - @echo " make [PLATFORM=platform] [target]" + @echo " make [PLATFORM=platform] [ARCH=arch] [ANDROID_NDK=\$$ANDROID_HOME/ndk/26.1.10909125] [target]" @echo "" @echo "Platforms:" @echo " linux (default on Linux)" @echo " macos (default on macOS)" @echo " windows (default on Windows)" - @echo " android (needs CC to be set to Android NDK's Clang compiler)" + @echo " android (needs ARCH to be set to x86_64 or arm64-v8a and ANDROID_NDK to be set)" @echo " ios (only on macOS)" - @echo " isim (only on macOS)" + @echo " ios-sim (only on macOS)" @echo "" @echo "Targets:" - @echo " all - Build the extension (default)" - @echo " clean - Remove built files" - @echo " install - Install the extension" - @echo " test - Test the extension" - @echo " help - Display this help message" + @echo " all - Build the extension (default)" + @echo " clean - Remove built files" + @echo " install - Install the extension" + @echo " test - Test the extension" + @echo " help - Display this help message" -.PHONY: all clean install test help +.PHONY: all clean install test help version xcframework From cf8fed34708be4f933c25c4f41a290128130592c Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Thu, 7 Aug 2025 16:19:34 +0200 Subject: [PATCH 3/6] Add 'extension' target to Makefile for improved build process --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1f22af9..93707f9 100644 --- a/Makefile +++ b/Makefile @@ -92,6 +92,7 @@ $(shell mkdir -p $(BUILD_DIR) $(DIST_DIR)) # Main target all: $(TARGET) +extension: $(TARGET) # Link the final target $(TARGET): $(OBJ_FILES) $(DEF_FILE) @@ -229,4 +230,4 @@ help: @echo " test - Test the extension" @echo " help - Display this help message" -.PHONY: all clean install test help version xcframework +.PHONY: all extension clean install test help version xcframework From 1a4306b863effb546658ac19b8fd91dbccc8321f Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Fri, 29 Aug 2025 19:40:27 +0200 Subject: [PATCH 4/6] Add module map and header files for xcframework generation --- Makefile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 93707f9..d99786f 100644 --- a/Makefile +++ b/Makefile @@ -190,14 +190,24 @@ define PLIST endef +define MODULEMAP +framework module js {\ + umbrella header \"sqlitejs.h\"\ + export *\ +} +endef + LIB_NAMES = ios.dylib ios-sim.dylib macos.dylib FMWK_NAMES = ios-arm64 ios-arm64_x86_64-simulator macos-arm64_x86_64 $(DIST_DIR)/%.xcframework: $(LIB_NAMES) @$(foreach i,1 2 3,\ lib=$(word $(i),$(LIB_NAMES)); \ fmwk=$(word $(i),$(FMWK_NAMES)); \ - mkdir -p $(DIST_DIR)/$$fmwk/js.framework; \ + mkdir -p $(DIST_DIR)/$$fmwk/js.framework/Headers; \ + mkdir -p $(DIST_DIR)/$$fmwk/js.framework/Modules; \ + cp src/sqlitejs.h $(DIST_DIR)/$$fmwk/js.framework/Headers; \ printf "$(PLIST)" > $(DIST_DIR)/$$fmwk/js.framework/Info.plist; \ + printf "$(MODULEMAP)" > $(DIST_DIR)/$$fmwk/js.framework/Modules/module.modulemap; \ mv $(DIST_DIR)/$$lib $(DIST_DIR)/$$fmwk/js.framework/js; \ install_name_tool -id "@rpath/js.framework/js" $(DIST_DIR)/$$fmwk/js.framework/js; \ ) From 8a42f2d5d52527452354904a21b8aaedba29b498 Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Fri, 29 Aug 2025 19:53:38 +0200 Subject: [PATCH 5/6] Enhance release workflow with keychain management and codesigning for xcframework --- .github/workflows/release.yml | 43 +++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1f6dca8..3e2a42a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,6 +1,7 @@ -name: release sqlite-js +name: build, test and release sqlite-js on: push: + workflow_dispatch: permissions: contents: write @@ -86,6 +87,35 @@ jobs: - name: build sqlite-js run: ${{ matrix.name == 'linux-musl' && matrix.arch == 'arm64' && 'docker exec alpine' || '' }} make extension ${{ matrix.make && matrix.make || ''}} + - name: create keychain for codesign + if: matrix.os == 'macos-15' + run: | + echo "${{ secrets.APPLE_CERTIFICATE }}" | base64 --decode > certificate.p12 + security create-keychain -p "${{ secrets.KEYCHAIN_PASSWORD }}" build.keychain + security default-keychain -s build.keychain + security unlock-keychain -p "${{ secrets.KEYCHAIN_PASSWORD }}" build.keychain + security import certificate.p12 -k build.keychain -P "${{ secrets.CERTIFICATE_PASSWORD }}" -T /usr/bin/codesign + security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "${{ secrets.KEYCHAIN_PASSWORD }}" build.keychain + + - name: codesign dylib + if: matrix.os == 'macos-15' && matrix.name != 'apple-xcframework' + run: codesign --sign "${{ secrets.APPLE_TEAM_ID }}" --timestamp --options runtime dist/js.dylib + + - name: codesign and notarize xcframework + if: matrix.name == 'apple-xcframework' + run: | + find dist/js.xcframework -name "*.framework" -exec echo "Signing: {}" \; -exec codesign --sign "${{ secrets.APPLE_TEAM_ID }}" --timestamp --options runtime {} \; # Sign each individual framework FIRST + codesign --sign "${{ secrets.APPLE_TEAM_ID }}" --timestamp --options runtime dist/js.xcframework # Then sign the xcframework wrapper + ditto -c -k --keepParent dist/js.xcframework dist/js.xcframework.zip + xcrun notarytool submit dist/js.xcframework.zip --apple-id "${{ secrets.APPLE_ID }}" --password "${{ secrets.APPLE_PASSWORD }}" --team-id "${{ secrets.APPLE_TEAM_ID }}" --wait + rm dist/js.xcframework.zip + + - name: cleanup keychain for codesign + if: matrix.os == 'macos-15' + run: | + rm certificate.p12 + security delete-keychain build.keychain + - name: android setup test environment if: matrix.name == 'android' && matrix.arch != 'arm64-v8a' run: | @@ -101,6 +131,7 @@ jobs: unzip sqlite-amalgamation-*.zip export ${{ matrix.make }} $ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/${{ matrix.arch }}-linux-android26-clang sqlite-amalgamation-*/shell.c sqlite-amalgamation-*/sqlite3.c -o sqlite3 -ldl + # remove unused folders to save up space rm -rf sqlite-amalgamation-*.zip sqlite-amalgamation-* echo "::endgroup::" @@ -130,6 +161,7 @@ jobs: run: ${{ matrix.name == 'linux-musl' && matrix.arch == 'arm64' && 'docker exec alpine' || '' }} make test ${{ matrix.make && matrix.make || ''}} - uses: actions/upload-artifact@v4.6.2 + if: always() with: name: js-${{ matrix.name }}${{ matrix.arch && format('-{0}', matrix.arch) || '' }} path: dist/js.* @@ -155,11 +187,10 @@ jobs: - name: release tag version from sqlitejs.h id: tag run: | - FILE="src/sqlitejs.h" - VERSION=$(grep -oP '#define SQLITE_JS_VERSION\s+"\K[^"]+' "$FILE") + VERSION=$(make version) if [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then LATEST=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r '.name') - if [[ "$VERSION" != "$LATEST" ]]; then + if [[ "$VERSION" != "$LATEST" || "$GITHUB_EVENT_NAME" == "workflow_dispatch" ]]; then echo "version=$VERSION" >> $GITHUB_OUTPUT else echo "::warning file=src/sqlitejs.h::To release a new version, please update the SQLITE_JS_VERSION in src/sqlitejs.h to be different than the latest $LATEST" @@ -174,8 +205,10 @@ jobs: for folder in "artifacts"/*; do if [ -d "$folder" ]; then name=$(basename "$folder") + if [[ "$name" != "js-apple-xcframework" ]]; then + tar -czf "${name}-${{ steps.tag.outputs.version }}.tar.gz" -C "$folder" . + fi (cd "$folder" && zip -rq "../../${name}-${{ steps.tag.outputs.version }}.zip" .) - tar -czf "${name}-${{ steps.tag.outputs.version }}.tar.gz" -C "$folder" . fi done From 88369b41e52185f87ac07cc7da2390c625fd4d63 Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Fri, 29 Aug 2025 19:54:32 +0200 Subject: [PATCH 6/6] Rename main workflow file for building, testing, and releasing sqlite-js --- .github/workflows/{release.yml => main.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{release.yml => main.yml} (100%) diff --git a/.github/workflows/release.yml b/.github/workflows/main.yml similarity index 100% rename from .github/workflows/release.yml rename to .github/workflows/main.yml