From 9d2574c4a016c5fa81f12ff3d6ec5ef1369dd46e Mon Sep 17 00:00:00 2001 From: DjDeveloperr Date: Sun, 18 Aug 2024 13:10:42 -0400 Subject: [PATCH] chore: bump version and improve release workflow --- .github/workflows/ci.yml | 25 ++++++++++++++++++++++--- .github/workflows/publish.yml | 16 ++++++++++++++++ deno.json | 2 +- scripts/build.ts | 6 ++---- 4 files changed, 41 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ba2c255..5e33020 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,7 +62,7 @@ jobs: test: strategy: matrix: - os: [ubuntu-20.04, windows-latest, macos-latest] + os: [ubuntu-20.04, windows-2022, macos-14] runs-on: ${{ matrix.os }} @@ -78,10 +78,28 @@ jobs: deno-version: 'v1.x' - name: Setup MSVC Dev Env - if: matrix.os == 'windows-latest' + if: matrix.os == 'windows-2022' uses: ilammy/msvc-dev-cmd@v1 - - name: Build sqlite3 + - name: Build sqlite3 (windows, linux) + if: matrix.os != 'macos-14' + env: + TARGET_ARCH: x86_64 + CC: + run: deno task build + + - name: Build sqlite3 (macos-x86_64) + if: matrix.os == 'macos-14' + env: + TARGET_ARCH: x86_64 + CC: clang -arch x86_64 + run: deno task build + + - name: Build sqlite3 (macos-aarch64) + if: matrix.os == 'macos-14' + env: + TARGET_ARCH: aarch64 + CC: clang -arch arm64 run: deno task build - name: Run Tests @@ -100,4 +118,5 @@ jobs: files: | build/libsqlite3.so build/libsqlite3.dylib + build/libsqlite3_aarch64.dylib build/sqlite3.dll diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..93cf9eb --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,16 @@ +name: Publish +on: release + +jobs: + publish: + runs-on: ubuntu-latest + + permissions: + contents: read + id-token: write + + steps: + - uses: actions/checkout@v4 + + - name: Publish package + run: npx jsr publish diff --git a/deno.json b/deno.json index fe83142..c8be83b 100644 --- a/deno.json +++ b/deno.json @@ -1,6 +1,6 @@ { "name": "@db/sqlite", - "version": "0.11.2", + "version": "0.12.0", "github": "https://github.com/denodrivers/sqlite3", "exports": "./mod.ts", diff --git a/scripts/build.ts b/scripts/build.ts index f4137f5..d9a444b 100644 --- a/scripts/build.ts +++ b/scripts/build.ts @@ -54,13 +54,11 @@ const $ = (cmd: string | URL, ...args: string[]) => { }).outputSync(); }; -await Deno.remove(new URL("../build", import.meta.url), { recursive: true }) - .catch(() => {}); await Deno.remove(new URL("../sqlite/build", import.meta.url), { recursive: true, }) .catch(() => {}); -await Deno.mkdir(new URL("../build", import.meta.url)); +await Deno.mkdir(new URL("../build", import.meta.url)).catch(() => {}); await Deno.mkdir(new URL("../sqlite/build", import.meta.url)); if (Deno.build.os !== "windows") { @@ -97,7 +95,7 @@ if (Deno.build.os === "windows") { new URL("../sqlite/configure", import.meta.url), "--enable-releasemode", "--enable-update-limit", - ...(Deno.build.arch === ARCH ? [] : ["--disable-tcl", "--host=arm-linux"]), + ...(Deno.build.arch === ARCH || Deno.build.os !== "linux" ? [] : ["--disable-tcl", "--host=arm-linux"]), ); $( "make",