Skip to content

Commit

Permalink
fix issues with pkg versions
Browse files Browse the repository at this point in the history
  • Loading branch information
vemonet committed Nov 20, 2023
1 parent e6ab387 commit 6822464
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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)**.

Expand Down
6 changes: 3 additions & 3 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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.
"""
Expand All @@ -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"] }
5 changes: 3 additions & 2 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
4 changes: 2 additions & 2 deletions js/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion js/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
""
);
rdfText.innerText = np.get_rdf();
console.log("PUBLISHED", np.toString());
console.log("CHECKED", checked.toString());
console.log("PUBLISHED", np.toString());
});
</script>
</body>
Expand Down
4 changes: 2 additions & 2 deletions lib/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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)
"""
Expand Down Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions python/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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"] }
2 changes: 1 addition & 1 deletion python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
25 changes: 25 additions & 0 deletions scripts/bump.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
set -e

# Check if version argument is provided
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <new_version>"
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

0 comments on commit 6822464

Please sign in to comment.