@stratadb/core 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/release.yml +125 -0
- package/Cargo.lock +1169 -0
- package/Cargo.toml +25 -0
- package/LICENSE +21 -0
- package/README.md +255 -0
- package/__tests__/strata.test.js +217 -0
- package/build.rs +5 -0
- package/index.d.ts +536 -0
- package/index.js +236 -0
- package/jest.config.js +5 -0
- package/npm/darwin-arm64/README.md +3 -0
- package/npm/darwin-arm64/package.json +41 -0
- package/npm/darwin-x64/README.md +3 -0
- package/npm/darwin-x64/package.json +41 -0
- package/npm/linux-arm64-gnu/README.md +3 -0
- package/npm/linux-arm64-gnu/package.json +44 -0
- package/npm/linux-arm64-musl/README.md +3 -0
- package/npm/linux-arm64-musl/package.json +44 -0
- package/npm/linux-x64-gnu/README.md +3 -0
- package/npm/linux-x64-gnu/package.json +44 -0
- package/npm/linux-x64-musl/README.md +3 -0
- package/npm/linux-x64-musl/package.json +44 -0
- package/npm/win32-x64-msvc/README.md +3 -0
- package/npm/win32-x64-msvc/package.json +41 -0
- package/package.json +67 -0
- package/src/lib.rs +775 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
name: Release to npm
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: write
|
|
10
|
+
id-token: write
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
build:
|
|
14
|
+
strategy:
|
|
15
|
+
fail-fast: false
|
|
16
|
+
matrix:
|
|
17
|
+
settings:
|
|
18
|
+
- host: macos-14
|
|
19
|
+
target: x86_64-apple-darwin
|
|
20
|
+
- host: macos-14
|
|
21
|
+
target: aarch64-apple-darwin
|
|
22
|
+
- host: windows-latest
|
|
23
|
+
target: x86_64-pc-windows-msvc
|
|
24
|
+
- host: ubuntu-latest
|
|
25
|
+
target: x86_64-unknown-linux-gnu
|
|
26
|
+
- host: ubuntu-latest
|
|
27
|
+
target: x86_64-unknown-linux-musl
|
|
28
|
+
- host: ubuntu-24.04-arm
|
|
29
|
+
target: aarch64-unknown-linux-gnu
|
|
30
|
+
- host: ubuntu-24.04-arm
|
|
31
|
+
target: aarch64-unknown-linux-musl
|
|
32
|
+
|
|
33
|
+
name: Build ${{ matrix.settings.target }}
|
|
34
|
+
runs-on: ${{ matrix.settings.host }}
|
|
35
|
+
steps:
|
|
36
|
+
- uses: actions/checkout@v4
|
|
37
|
+
|
|
38
|
+
- name: Setup Node.js
|
|
39
|
+
uses: actions/setup-node@v4
|
|
40
|
+
with:
|
|
41
|
+
node-version: 20
|
|
42
|
+
|
|
43
|
+
- name: Install Rust
|
|
44
|
+
uses: dtolnay/rust-toolchain@stable
|
|
45
|
+
with:
|
|
46
|
+
targets: ${{ matrix.settings.target }}
|
|
47
|
+
|
|
48
|
+
- name: Install musl tools
|
|
49
|
+
if: contains(matrix.settings.target, 'musl')
|
|
50
|
+
run: sudo apt-get update && sudo apt-get install -y musl-tools musl-dev
|
|
51
|
+
|
|
52
|
+
- name: Install dependencies
|
|
53
|
+
run: npm install
|
|
54
|
+
|
|
55
|
+
- name: Build
|
|
56
|
+
run: npm run build -- --target ${{ matrix.settings.target }}
|
|
57
|
+
|
|
58
|
+
- name: Upload artifact
|
|
59
|
+
uses: actions/upload-artifact@v4
|
|
60
|
+
with:
|
|
61
|
+
name: bindings-${{ matrix.settings.target }}
|
|
62
|
+
path: "*.node"
|
|
63
|
+
if-no-files-found: error
|
|
64
|
+
|
|
65
|
+
publish:
|
|
66
|
+
name: Publish to npm
|
|
67
|
+
runs-on: ubuntu-latest
|
|
68
|
+
needs: build
|
|
69
|
+
steps:
|
|
70
|
+
- uses: actions/checkout@v4
|
|
71
|
+
|
|
72
|
+
- name: Setup Node.js
|
|
73
|
+
uses: actions/setup-node@v4
|
|
74
|
+
with:
|
|
75
|
+
node-version: 20
|
|
76
|
+
registry-url: https://registry.npmjs.org
|
|
77
|
+
|
|
78
|
+
- name: Install dependencies
|
|
79
|
+
run: npm install
|
|
80
|
+
|
|
81
|
+
- name: Download all artifacts
|
|
82
|
+
uses: actions/download-artifact@v4
|
|
83
|
+
with:
|
|
84
|
+
path: artifacts
|
|
85
|
+
|
|
86
|
+
- name: Move artifacts
|
|
87
|
+
run: npm run artifacts
|
|
88
|
+
|
|
89
|
+
- name: List packages
|
|
90
|
+
run: ls -R npm
|
|
91
|
+
|
|
92
|
+
- name: Setup npm auth
|
|
93
|
+
run: |
|
|
94
|
+
echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > ~/.npmrc
|
|
95
|
+
echo "Token length: ${#NODE_AUTH_TOKEN}"
|
|
96
|
+
env:
|
|
97
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
98
|
+
|
|
99
|
+
- name: Verify npm auth
|
|
100
|
+
run: npm whoami --registry https://registry.npmjs.org
|
|
101
|
+
env:
|
|
102
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
103
|
+
|
|
104
|
+
- name: Publish platform packages
|
|
105
|
+
run: |
|
|
106
|
+
for dir in npm/*/; do
|
|
107
|
+
if [ -d "$dir" ]; then
|
|
108
|
+
# Skip Windows until npm spam detection is resolved
|
|
109
|
+
if [[ "$dir" == *"win32"* ]]; then
|
|
110
|
+
echo "Skipping $dir (spam detection issue)"
|
|
111
|
+
continue
|
|
112
|
+
fi
|
|
113
|
+
echo "Publishing $dir"
|
|
114
|
+
cd "$dir"
|
|
115
|
+
npm publish --access public || true
|
|
116
|
+
cd -
|
|
117
|
+
fi
|
|
118
|
+
done
|
|
119
|
+
env:
|
|
120
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
121
|
+
|
|
122
|
+
- name: Publish main package
|
|
123
|
+
run: npm publish --access public
|
|
124
|
+
env:
|
|
125
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|