Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1aa7df1c97 | |||
| 371d338a8b |
@@ -20,24 +20,35 @@ jobs:
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
|
||||
- name: Publish wickra-core
|
||||
run: cargo publish -p wickra-core --token "$CARGO_REGISTRY_TOKEN"
|
||||
# Idempotent publishing: if the version is already on crates.io we
|
||||
# treat that as success so re-runs of the workflow don't fail.
|
||||
- name: Publish wickra-core (idempotent)
|
||||
run: |
|
||||
out=$(cargo publish -p wickra-core --token "$CARGO_REGISTRY_TOKEN" 2>&1) && echo "$out" \
|
||||
|| (echo "$out" | grep -q "already uploaded\|already exists" && echo "skip: already published" \
|
||||
|| (echo "$out"; exit 1))
|
||||
env:
|
||||
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
||||
|
||||
- name: Wait for crates.io index to refresh
|
||||
run: sleep 45
|
||||
|
||||
- name: Publish wickra-data
|
||||
run: cargo publish -p wickra-data --token "$CARGO_REGISTRY_TOKEN"
|
||||
- name: Publish wickra-data (idempotent)
|
||||
run: |
|
||||
out=$(cargo publish -p wickra-data --token "$CARGO_REGISTRY_TOKEN" 2>&1) && echo "$out" \
|
||||
|| (echo "$out" | grep -q "already uploaded\|already exists" && echo "skip: already published" \
|
||||
|| (echo "$out"; exit 1))
|
||||
env:
|
||||
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
||||
|
||||
- name: Wait for crates.io index to refresh
|
||||
run: sleep 45
|
||||
|
||||
- name: Publish wickra
|
||||
run: cargo publish -p wickra --token "$CARGO_REGISTRY_TOKEN"
|
||||
- name: Publish wickra (idempotent)
|
||||
run: |
|
||||
out=$(cargo publish -p wickra --token "$CARGO_REGISTRY_TOKEN" 2>&1) && echo "$out" \
|
||||
|| (echo "$out" | grep -q "already uploaded\|already exists" && echo "skip: already published" \
|
||||
|| (echo "$out"; exit 1))
|
||||
env:
|
||||
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
||||
|
||||
@@ -170,10 +181,9 @@ jobs:
|
||||
path: bindings/node/artifacts
|
||||
pattern: bindings-*
|
||||
|
||||
- name: Create npm/<platform>/ scaffolding
|
||||
working-directory: bindings/node
|
||||
run: npx napi create-npm-dirs
|
||||
|
||||
# The npm/<platform>/package.json templates are committed to the
|
||||
# repo (see bindings/node/npm/), so `napi artifacts` only needs to
|
||||
# drop the freshly built .node binary into the matching directory.
|
||||
- name: Move binaries into platform package layout
|
||||
working-directory: bindings/node
|
||||
run: npx napi artifacts --dir artifacts
|
||||
@@ -228,8 +238,11 @@ jobs:
|
||||
fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2));
|
||||
"
|
||||
|
||||
- name: Publish wickra-wasm to npm
|
||||
- name: Publish wickra-wasm to npm (idempotent)
|
||||
working-directory: bindings/wasm/pkg
|
||||
run: npm publish --access public
|
||||
run: |
|
||||
out=$(npm publish --access public 2>&1) && echo "$out" \
|
||||
|| (echo "$out" | grep -q "You cannot publish over" && echo "skip: version already on npm" \
|
||||
|| (echo "$out"; exit 1))
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
|
||||
Generated
+6
-6
@@ -1883,7 +1883,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "wickra"
|
||||
version = "0.1.0"
|
||||
version = "0.1.2"
|
||||
dependencies = [
|
||||
"approx",
|
||||
"criterion",
|
||||
@@ -1894,7 +1894,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "wickra-core"
|
||||
version = "0.1.0"
|
||||
version = "0.1.2"
|
||||
dependencies = [
|
||||
"approx",
|
||||
"proptest",
|
||||
@@ -1904,7 +1904,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "wickra-data"
|
||||
version = "0.1.0"
|
||||
version = "0.1.2"
|
||||
dependencies = [
|
||||
"approx",
|
||||
"csv",
|
||||
@@ -1922,7 +1922,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "wickra-node"
|
||||
version = "0.1.0"
|
||||
version = "0.1.2"
|
||||
dependencies = [
|
||||
"napi",
|
||||
"napi-build",
|
||||
@@ -1932,7 +1932,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "wickra-python"
|
||||
version = "0.1.0"
|
||||
version = "0.1.2"
|
||||
dependencies = [
|
||||
"numpy",
|
||||
"pyo3",
|
||||
@@ -1941,7 +1941,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "wickra-wasm"
|
||||
version = "0.1.0"
|
||||
version = "0.1.2"
|
||||
dependencies = [
|
||||
"console_error_panic_hook",
|
||||
"js-sys",
|
||||
|
||||
+2
-2
@@ -11,7 +11,7 @@ members = [
|
||||
exclude = []
|
||||
|
||||
[workspace.package]
|
||||
version = "0.1.0"
|
||||
version = "0.1.2"
|
||||
authors = ["Wickra Contributors"]
|
||||
edition = "2021"
|
||||
rust-version = "1.75"
|
||||
@@ -23,7 +23,7 @@ keywords = ["finance", "trading", "indicators", "technical-analysis", "ta"]
|
||||
categories = ["finance", "mathematics", "science"]
|
||||
|
||||
[workspace.dependencies]
|
||||
wickra-core = { path = "crates/wickra-core", version = "0.1.0" }
|
||||
wickra-core = { path = "crates/wickra-core", version = "0.1.2" }
|
||||
|
||||
thiserror = "2"
|
||||
rayon = "1.10"
|
||||
|
||||
+41
-21
@@ -1,30 +1,50 @@
|
||||
/* eslint-disable */
|
||||
/* prettier-ignore */
|
||||
// This loader is generated by `napi build --platform` at publish time. For
|
||||
// editable development just `require` the local debug binary that napi places
|
||||
// at the package root.
|
||||
// Platform-aware loader for the Wickra Node native binding.
|
||||
//
|
||||
// In production (after `npm install wickra`) the actual `.node` binary
|
||||
// lives inside a per-platform subpackage that npm installs as an
|
||||
// optional dependency — e.g. `wickra-linux-x64-gnu`. In development
|
||||
// (after `napi build --platform`) the binary sits next to this file.
|
||||
// We try the local path first and fall back to the subpackage so the
|
||||
// same loader works in both modes.
|
||||
|
||||
const { platform, arch } = process;
|
||||
const { join } = require('node:path');
|
||||
const { existsSync } = require('node:fs');
|
||||
const { platform, arch } = process;
|
||||
|
||||
function loadNative() {
|
||||
// Try precompiled per-platform binary first (published wheels do this).
|
||||
const candidates = [
|
||||
`./wickra.${platform}-${arch}.node`,
|
||||
`./wickra.${platform}-${arch}-musl.node`,
|
||||
'./wickra.node',
|
||||
];
|
||||
for (const c of candidates) {
|
||||
const p = join(__dirname, c);
|
||||
if (existsSync(p)) {
|
||||
return require(p);
|
||||
}
|
||||
const TARGETS = {
|
||||
'linux-x64': 'linux-x64-gnu',
|
||||
'darwin-x64': 'darwin-x64',
|
||||
'darwin-arm64': 'darwin-arm64',
|
||||
'win32-x64': 'win32-x64-msvc',
|
||||
};
|
||||
|
||||
function load() {
|
||||
const key = `${platform}-${arch}`;
|
||||
const target = TARGETS[key];
|
||||
if (!target) {
|
||||
throw new Error(
|
||||
`wickra: this platform/architecture combination is not supported (${key}). ` +
|
||||
'Open an issue at https://github.com/kingchenc/wickra/issues with your platform details.'
|
||||
);
|
||||
}
|
||||
|
||||
const localBinary = join(__dirname, `wickra.${target}.node`);
|
||||
if (existsSync(localBinary)) {
|
||||
return require(localBinary);
|
||||
}
|
||||
|
||||
try {
|
||||
return require(`wickra-${target}`);
|
||||
} catch (err) {
|
||||
throw new Error(
|
||||
`wickra: failed to load the native binding for ${key}. ` +
|
||||
`Expected either ${localBinary} or the wickra-${target} package to be installed. ` +
|
||||
`Run \`npm install\` again, or build from source with \`npm run build\`. ` +
|
||||
`Underlying error: ${err.message}`
|
||||
);
|
||||
}
|
||||
throw new Error(
|
||||
`Wickra: no precompiled binary found for ${platform}-${arch}. ` +
|
||||
'Build from source with `napi build --release` or install a platform-specific package.'
|
||||
);
|
||||
}
|
||||
|
||||
module.exports = loadNative();
|
||||
module.exports = load();
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"name": "wickra-darwin-arm64",
|
||||
"version": "0.1.2",
|
||||
"description": "Native binding for wickra (macOS Apple Silicon). Installed automatically as an optional dependency of wickra on matching platforms.",
|
||||
"main": "wickra.darwin-arm64.node",
|
||||
"files": [
|
||||
"wickra.darwin-arm64.node"
|
||||
],
|
||||
"license": "SEE LICENSE IN LICENSE",
|
||||
"engines": {
|
||||
"node": ">= 16"
|
||||
},
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/kingchenc/wickra"
|
||||
},
|
||||
"homepage": "https://github.com/kingchenc/wickra"
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"name": "wickra-darwin-x64",
|
||||
"version": "0.1.2",
|
||||
"description": "Native binding for wickra (macOS Intel). Installed automatically as an optional dependency of wickra on matching platforms.",
|
||||
"main": "wickra.darwin-x64.node",
|
||||
"files": [
|
||||
"wickra.darwin-x64.node"
|
||||
],
|
||||
"license": "SEE LICENSE IN LICENSE",
|
||||
"engines": {
|
||||
"node": ">= 16"
|
||||
},
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/kingchenc/wickra"
|
||||
},
|
||||
"homepage": "https://github.com/kingchenc/wickra"
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"name": "wickra-linux-x64-gnu",
|
||||
"version": "0.1.2",
|
||||
"description": "Native binding for wickra (linux x64 GNU). Installed automatically as an optional dependency of wickra on matching platforms.",
|
||||
"main": "wickra.linux-x64-gnu.node",
|
||||
"files": [
|
||||
"wickra.linux-x64-gnu.node"
|
||||
],
|
||||
"license": "SEE LICENSE IN LICENSE",
|
||||
"engines": {
|
||||
"node": ">= 16"
|
||||
},
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/kingchenc/wickra"
|
||||
},
|
||||
"homepage": "https://github.com/kingchenc/wickra"
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"name": "wickra-win32-x64-msvc",
|
||||
"version": "0.1.2",
|
||||
"description": "Native binding for wickra (Windows x64 MSVC). Installed automatically as an optional dependency of wickra on matching platforms.",
|
||||
"main": "wickra.win32-x64-msvc.node",
|
||||
"files": [
|
||||
"wickra.win32-x64-msvc.node"
|
||||
],
|
||||
"license": "SEE LICENSE IN LICENSE",
|
||||
"engines": {
|
||||
"node": ">= 16"
|
||||
},
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/kingchenc/wickra"
|
||||
},
|
||||
"homepage": "https://github.com/kingchenc/wickra"
|
||||
}
|
||||
+11
-10
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "wickra",
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.2",
|
||||
"description": "Streaming-first technical indicators: incremental, fast, install-free. Node bindings powered by Rust.",
|
||||
"author": "kingchenc <kingchencp@gmail.com>",
|
||||
"main": "index.js",
|
||||
@@ -32,23 +32,24 @@
|
||||
"napi": {
|
||||
"name": "wickra",
|
||||
"triples": {
|
||||
"defaults": true,
|
||||
"defaults": false,
|
||||
"additional": [
|
||||
"x86_64-unknown-linux-musl",
|
||||
"aarch64-unknown-linux-gnu",
|
||||
"i686-pc-windows-msvc",
|
||||
"armv7-unknown-linux-gnueabihf",
|
||||
"x86_64-unknown-linux-gnu",
|
||||
"x86_64-apple-darwin",
|
||||
"aarch64-apple-darwin",
|
||||
"aarch64-linux-android",
|
||||
"x86_64-unknown-freebsd",
|
||||
"aarch64-unknown-linux-musl",
|
||||
"aarch64-pc-windows-msvc"
|
||||
"x86_64-pc-windows-msvc"
|
||||
]
|
||||
}
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 16"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"wickra-linux-x64-gnu": "0.1.2",
|
||||
"wickra-darwin-x64": "0.1.2",
|
||||
"wickra-darwin-arm64": "0.1.2",
|
||||
"wickra-win32-x64-msvc": "0.1.2"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "napi build --platform --release",
|
||||
"build:debug": "napi build --platform",
|
||||
|
||||
@@ -4,7 +4,7 @@ build-backend = "maturin"
|
||||
|
||||
[project]
|
||||
name = "wickra"
|
||||
version = "0.1.0"
|
||||
version = "0.1.2"
|
||||
description = "Streaming-first technical indicators: incremental, fast, install-free."
|
||||
readme = "README.md"
|
||||
license = { text = "PolyForm-Noncommercial-1.0.0" }
|
||||
|
||||
Reference in New Issue
Block a user