diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index cd8a779..52cc461 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -133,8 +133,8 @@ jobs: with: toolchain: stable - run: make sqlite-vec.h - - run: cp sqlite-vec.c bindings/rust - - run: cp sqlite-vec.h bindings/rust + - run: make deps + working-directory: ./bindings/rust - run: cargo publish --no-verify working-directory: ./bindings/rust env: diff --git a/bindings/rust/.gitignore b/bindings/rust/.gitignore index 3697d89..44bec09 100644 --- a/bindings/rust/.gitignore +++ b/bindings/rust/.gitignore @@ -1,3 +1,4 @@ target/ sqlite-vec.c sqlite-vec.h +Cargo.toml diff --git a/bindings/rust/Cargo.toml b/bindings/rust/Cargo.toml deleted file mode 100644 index 2eaa6f6..0000000 --- a/bindings/rust/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "sqlite-vec" -version = "0.1.0" -edition = "2021" - -[dependencies] - -[build-dependencies] -cc = "1.0" - -[dev-dependencies] -rusqlite = "0.31.0" diff --git a/bindings/rust/Cargo.toml.tmpl b/bindings/rust/Cargo.toml.tmpl new file mode 100644 index 0000000..5df7481 --- /dev/null +++ b/bindings/rust/Cargo.toml.tmpl @@ -0,0 +1,19 @@ +[package] +name = "sqlite-vec" +version = "${VERSION}" +edition = "2021" +authors = ["Alex Garcia "] +description = "FFI bindings to the sqlite-vec SQLite extension" +homepage = "https://github.com/asg017/sqlite-vec" +repository = "https://github.com/asg017/sqlite-vec" +keywords = ["sqlite", "sqlite-extension"] +license = "MIT/Apache-2.0" + + +[dependencies] + +[build-dependencies] +cc = "1.0" + +[dev-dependencies] +rusqlite = "0.31.0" diff --git a/bindings/rust/Makefile b/bindings/rust/Makefile new file mode 100644 index 0000000..6171353 --- /dev/null +++ b/bindings/rust/Makefile @@ -0,0 +1,14 @@ +VERSION=$(shell cat ../../VERSION) + +deps: Cargo.toml sqlite-vec.c sqlite-vec.h + +Cargo.toml: ../../VERSION Cargo.toml.tmpl + VERSION=$(VERSION) envsubst < Cargo.toml.tmpl > $@ + +sqlite-vec.c: ../../sqlite-vec.c + cp $< $@ + +sqlite-vec.h: ../../sqlite-vec.h + cp $< $@ + +.PHONY: deps