Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switch back to zipped artifacts #410

Merged
merged 3 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 20 additions & 26 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ jobs:
include:
- os: ubuntu-latest
library_name: crsqlite.so
artifact_name: crsqlite.gz
asset_name: crsqlite-linux-x86_64.gz
artifact_name: crsqlite.zip
asset_name: crsqlite-linux-x86_64.zip
- os: macos-latest
library_name: crsqlite.dylib
artifact_name: crsqlite.gz
asset_name: crsqlite-darwin-x86_64.gz
artifact_name: crsqlite.zip
asset_name: crsqlite-darwin-x86_64.zip

steps:
- uses: actions/checkout@v3
Expand All @@ -37,8 +37,7 @@ jobs:
run: |
cd core
make loadable
gzip dist/${{ matrix.library_name }}
mv dist/${{ matrix.library_name }}.gz dist/crsqlite.gz
cd dist; zip crsqlite.zip ${{ matrix.library_name }}

- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
Expand All @@ -57,8 +56,8 @@ jobs:
include:
- os: macos-latest
library_name: crsqlite.dylib
artifact_name: crsqlite.gz
asset_name: crsqlite-darwin-aarch64.gz
artifact_name: crsqlite.zip
asset_name: crsqlite-darwin-aarch64.zip

steps:
- uses: actions/checkout@v3
Expand All @@ -74,8 +73,7 @@ jobs:
run: |
cd core
export CI_MAYBE_TARGET="aarch64-apple-darwin" && make loadable
gzip dist/${{ matrix.library_name }}
mv dist/${{ matrix.library_name }}.gz dist/crsqlite.gz
cd dist; zip crsqlite.zip ${{ matrix.library_name }}

- name: Upload macos dylib to release
uses: svenstaro/upload-release-action@v2
Expand Down Expand Up @@ -106,8 +104,8 @@ jobs:
include:
- os: ubuntu-latest
library_name: crsqlite.so
artifact_name: crsqlite.gz
asset_name: crsqlite-linux-aarch64.gz
artifact_name: crsqlite.zip
asset_name: crsqlite-linux-aarch64.zip

steps:
- name: Install toolchain
Expand All @@ -128,8 +126,7 @@ jobs:
run: |
cd core
export CI_MAYBE_TARGET="aarch64-unknown-linux-gnu" && export CI_GCC="aarch64-linux-gnu-gcc" && make loadable
gzip dist/${{ matrix.library_name }}
mv dist/${{ matrix.library_name }}.gz dist/crsqlite.gz
cd dist; zip crsqlite.zip ${{ matrix.library_name }}

- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
Expand All @@ -147,8 +144,8 @@ jobs:
include:
- os: ubuntu-latest
library_name: crsqlite.dll
artifact_name: crsqlite.gz
asset_name: crsqlite-win-x86_64.gz
artifact_name: crsqlite.zip
asset_name: crsqlite-win-x86_64.zip

steps:
- uses: actions/checkout@v3
Expand All @@ -169,8 +166,7 @@ jobs:
run: |
cd core
export CI_MAYBE_TARGET="x86_64-pc-windows-gnu" && export CI_GCC="x86_64-w64-mingw32-gcc" && make loadable
gzip dist/${{ matrix.library_name }}
mv dist/${{ matrix.library_name }}.gz dist/crsqlite.gz
cd dist; zip crsqlite.zip ${{ matrix.library_name }}

- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
Expand All @@ -188,8 +184,8 @@ jobs:
include:
- os: ubuntu-latest
library_name: crsqlite.dll
artifact_name: crsqlite.gz
asset_name: crsqlite-win-i686.gz
artifact_name: crsqlite.zip
asset_name: crsqlite-win-i686.zip

steps:
- uses: actions/checkout@v3
Expand All @@ -210,8 +206,7 @@ jobs:
run: |
cd core
export CI_MAYBE_TARGET="i686-pc-windows-gnu" && export CI_GCC="i686-w64-mingw32-gcc" && make loadable
gzip dist/${{ matrix.library_name }}
mv dist/${{ matrix.library_name }}.gz dist/crsqlite.gz
cd dist; zip crsqlite.zip ${{ matrix.library_name }}

- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
Expand All @@ -229,8 +224,8 @@ jobs:
include:
- os: ubuntu-latest
library_name: crsqlite.so
artifact_name: crsqlite.gz
asset_name: crsqlite-aarch64-linux-android.gz
artifact_name: crsqlite.zip
asset_name: crsqlite-aarch64-linux-android.zip

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -259,8 +254,7 @@ jobs:
run: |
cd core
export ANDROID_TARGET=aarch64-linux-android; make loadable
gzip dist/${{ matrix.library_name }}
mv dist/${{ matrix.library_name }}.gz dist/crsqlite.gz
cd dist; zip crsqlite.zip ${{ matrix.library_name }}

- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
Expand Down
10 changes: 3 additions & 7 deletions core/nodejs-install-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import fs from "fs";
import https from "https";
import pkg from "./package.json" assert { type: "json" };
import { exec } from "child_process";
import zlip from "zlib";
const unzip = zlip.createUnzip();
import unzipper from "unzipper";
let { version } = pkg;

let arch = process.arch;
Expand Down Expand Up @@ -52,7 +51,7 @@ if (process.env.CRSQLITE_NOPREBUILD) {
break;
}

const binaryUrl = `https://github.com/vlcn-io/cr-sqlite/releases/download/${version}/crsqlite-${os}-${arch}.gz`;
const binaryUrl = `https://github.com/vlcn-io/cr-sqlite/releases/download/${version}/crsqlite-${os}-${arch}.zip`;
console.log(`Look for prebuilt binary from ${binaryUrl}`);
const distPath = join("dist", `crsqlite.${ext}`);

Expand Down Expand Up @@ -90,10 +89,7 @@ if (process.env.CRSQLITE_NOPREBUILD) {
return;
}

const file = fs.createWriteStream(distPath);
res.pipe(unzip).pipe(file);
file.on("finish", () => {
file.close();
res.pipe(unzipper.Extract({ path: join(".", "dist") })).on("close", () => {
console.log("Prebuilt binary downloaded");
process.exit(0);
});
Expand Down
5 changes: 4 additions & 1 deletion core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,8 @@
"sqlite",
"sqlite3",
"crdt"
]
],
"dependencies": {
"unzipper": "^0.10.14"
}
}
209 changes: 209 additions & 0 deletions core/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.