From 68224641ada479575ee4d9830d31e88e1aa90f5f Mon Sep 17 00:00:00 2001 From: Vincent Emonet Date: Mon, 20 Nov 2023 11:32:09 +0100 Subject: [PATCH] fix issues with pkg versions --- .github/workflows/build.yml | 4 ++-- README.md | 10 +++++++++- cli/Cargo.toml | 6 +++--- docs/contributing.md | 5 +++-- js/Cargo.toml | 4 ++-- js/index.html | 2 +- lib/Cargo.toml | 4 ++-- python/Cargo.toml | 4 ++-- python/pyproject.toml | 2 +- scripts/bump.sh | 25 +++++++++++++++++++++++++ 10 files changed, 50 insertions(+), 16 deletions(-) create mode 100755 scripts/bump.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e76eff5..d990c44 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -297,12 +297,12 @@ jobs: path: ./js/pkg - run: npm run release - working-directory: ./js/pkg + working-directory: ./js env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} if: github.event_name == 'release' - +# nanopub-sign/ publish_crates: name: 📦️ Publish crates to crates.io if: github.event_name == 'release' diff --git a/README.md b/README.md index b102ca8..e4c5a5a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,14 @@ # ✍️ Nanopub cross-platform toolkit ⚔️ -[![Build](https://github.com/vemonet/nanopub-rs/actions/workflows/build.yml/badge.svg)](https://github.com/vemonet/nanopub-rs/actions/workflows/build.yml) [![Lint and Test](https://github.com/vemonet/nanopub-rs/actions/workflows/test.yml/badge.svg)](https://github.com/vemonet/nanopub-rs/actions/workflows/test.yml) [![codecov](https://codecov.io/gh/vemonet/nanopub-rs/graph/badge.svg?token=BF15PSO6GN)](https://codecov.io/gh/vemonet/nanopub-rs) [![dependency status](https://deps.rs/repo/github/vemonet/nanopub-rs/status.svg)](https://deps.rs/repo/github/vemonet/nanopub-rs) +[![Latest Version](https://img.shields.io/crates/v/nanopub.svg)](https://crates.io/crates/nanopub) +[![Released API docs](https://docs.rs/nanopub/badge.svg)](https://docs.rs/nanopub) +[![PyPI](https://img.shields.io/pypi/v/nanopub-sign)](https://pypi.org/project/nanopub-sign/) +[![npm](https://img.shields.io/npm/v/nanopub/sign)](https://www.npmjs.com/package/nanopub/sign) + +[![Build](https://github.com/vemonet/nanopub-rs/actions/workflows/build.yml/badge.svg)](https://github.com/vemonet/nanopub-rs/actions/workflows/build.yml) +[![Lint and Test](https://github.com/vemonet/nanopub-rs/actions/workflows/test.yml/badge.svg)](https://github.com/vemonet/nanopub-rs/actions/workflows/test.yml) +[![codecov](https://codecov.io/gh/vemonet/nanopub-rs/graph/badge.svg?token=BF15PSO6GN)](https://codecov.io/gh/vemonet/nanopub-rs) +[![dependency status](https://deps.rs/repo/github/vemonet/nanopub-rs/status.svg)](https://deps.rs/repo/github/vemonet/nanopub-rs) This project aims to provide a comprehensive cross-platform toolkit to sign, publish, and check **[Nanopublications](https://nanopub.net)**. diff --git a/cli/Cargo.toml b/cli/Cargo.toml index d08b22b..20411eb 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nanopub-cli" -version = "0.0.1" +version = "0.0.2" description = """ A cross-platform CLI tool written in Rust to sign Nanopublications. """ @@ -14,5 +14,5 @@ homepage.workspace = true categories.workspace = true [dependencies] -nanopub = { version = "0.0.1", path = "../lib" } -clap = { version = "4.4.8", features = ["derive"] } +nanopub = { version = "0.0.2", path = "../lib" } +clap = { version = "0.0.2", features = ["derive"] } diff --git a/docs/contributing.md b/docs/contributing.md index 3cf2246..641b415 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -128,14 +128,15 @@ cargo install cargo-release cargo-outdated 2. Bump the version in the `Cargo.toml` file in folders `lib/`, `python`, `js` ```bash - # patch, minor, major - cargo release patch --no-tag --no-publish + ./scripts/bump.sh 0.0.2 ``` 3. Commit, push, and create a new release on GitHub 4. The `build.yml` workflow will automatically build artifacts (binary, pip wheel, npm package), and add them to the new release. +> TODO: try `cargo release patch --no-tag --no-publish` + ## ☑️ To do - [ ] Integrate to the python `nanopub` library to perform signing? diff --git a/js/Cargo.toml b/js/Cargo.toml index 4e59b1f..1b271c1 100644 --- a/js/Cargo.toml +++ b/js/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nanopub-js" -version = "0.0.1" +version = "0.0.2" description = "JavaScript bindings for the Nanopub rust toolkit" repository = "https://github.com/vemonet/nanopub-rs/tree/main/js" authors.workspace = true @@ -15,7 +15,7 @@ categories.workspace = true crate-type = ["cdylib"] [dependencies] -nanopub = { version = "0.0.1", path = "../lib" } +nanopub = { version = "0.0.2", path = "../lib" } wasm-bindgen = "0.2" js-sys = "0.3" console_error_panic_hook = "0.1" diff --git a/js/index.html b/js/index.html index 02ff0f2..3e6756f 100644 --- a/js/index.html +++ b/js/index.html @@ -60,8 +60,8 @@ "" ); rdfText.innerText = np.get_rdf(); - console.log("PUBLISHED", np.toString()); console.log("CHECKED", checked.toString()); + console.log("PUBLISHED", np.toString()); }); diff --git a/lib/Cargo.toml b/lib/Cargo.toml index 2869660..233ebe2 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nanopub" -version = "0.0.1" +version = "0.0.2" description = """ A cross-platform Rust library to sign Nanopublications, with bindings to Python and JS (wasm) """ @@ -28,7 +28,7 @@ reqwest = { version = "0.11", features = ["blocking", "rustls-tls"], default-fea serde = { version = "1.0", features = ["derive"] } serde_yaml = "0.9" chrono = "0.4" -# log = { version = "0.4.20", features = ["std"] } +# log = { version = "0.0.2", features = ["std"] } [dev-dependencies] mdbook = "0.4.35" diff --git a/python/Cargo.toml b/python/Cargo.toml index 298856f..c77211e 100644 --- a/python/Cargo.toml +++ b/python/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nanopub-sign" -version = "0.0.1" +version = "0.0.2" description = "Python bindings for the Nanopub rust toolkit" repository = "https://github.com/vemonet/nanopub-rs/tree/main/python" authors.workspace = true @@ -16,5 +16,5 @@ name = "nanopub_sign" crate-type = ["cdylib"] [dependencies] -nanopub = { version = "0.0.1", path = "../lib" } +nanopub = { version = "0.0.2", path = "../lib" } pyo3 = { version = "0.20", features = ["extension-module"] } diff --git a/python/pyproject.toml b/python/pyproject.toml index 218d8f6..85ab2f2 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -4,8 +4,8 @@ build-backend = "maturin" [project] # Most of the metadata are in Cargo.toml and injected by maturin +# version = "0.0.0" name = "nanopub-sign" -version = "0.0.0" classifiers = [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", diff --git a/scripts/bump.sh b/scripts/bump.sh new file mode 100755 index 0000000..d3c7308 --- /dev/null +++ b/scripts/bump.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +set -e + +# Check if version argument is provided +if [ "$#" -ne 1 ]; then + echo "Usage: $0 " + exit 1 +fi + +new_version=$1 +files=( + "lib/Cargo.toml" + "cli/Cargo.toml" + "python/Cargo.toml" + "js/Cargo.toml" +) + +for file in "${files[@]}"; do + if [ -f "$file" ]; then + sed -i "s/version = \"[0-9]*\.[0-9]*\.[0-9]*\"/version = \"$new_version\"/" "$file" + echo "🏷️ Updated version in $file" + else + echo "⚠️ File not found: $file" + fi +done