Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish to crates.io #528

Closed
haerdib opened this issue Apr 12, 2023 · 11 comments · Fixed by #743
Closed

Publish to crates.io #528

haerdib opened this issue Apr 12, 2023 · 11 comments · Fixed by #743
Assignees

Comments

@haerdib
Copy link
Contributor

haerdib commented Apr 12, 2023

Why not? It would certainly increase the visibility of this crate and we're already using tags and semantic versioning.

@Niederb
Copy link
Contributor

Niederb commented Apr 13, 2023

I think it's a good idea. Unfortunately someone already took the name. We could try to contact them though.
https://crates.io/crates/substrate-api-client

@haerdib

This comment was marked as resolved.

@haerdib

This comment was marked as resolved.

@Niederb

This comment was marked as resolved.

@haerdib haerdib self-assigned this Apr 13, 2023
@haerdib
Copy link
Contributor Author

haerdib commented Apr 18, 2023

Published crates (see branch https://github.com/scs/substrate-api-client/tree/bh/crates-io):

Tested build via CI: https://github.com/scs/substrate-api-client/actions/runs/4730423144 run through except for tests. The reason it didn't build in test mode is because of a Substrate dependencies mismatch (once via github, once via crates.io in the api-client). But I think this suffices because it built successfully and clippy was happy as well :)

@haerdib haerdib closed this as completed Apr 18, 2023
@haerdib
Copy link
Contributor Author

haerdib commented Apr 18, 2023

Necessary changes: Change all GitHub and local dependencies in the .toml files to crates.io.

More concrete:

  • Cargo.toml:
# Substrate no_std dependencies
-sp-core = { default-features = false, features = ["full_crypto"], git = "https://github.com/paritytech/substrate.git", branch = "master" }
-sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "master" }
-sp-runtime-interface = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "master" }
+sp-core = { version = "19.0", default-features = false, features = ["full_crypto"] }
+sp-runtime = { version = "22.0", default-features = false }
+sp-runtime-interface = { version = "16.0", default-features = false }

# substrate std / wasm only
-frame-support = { optional = true, git = "https://github.com/paritytech/substrate.git", branch = "master" }
+frame-support = { version = "20.0", optional = true }

# local deps
-ac-compose-macros = { path = "compose-macros", default-features = false }
-ac-node-api = { path = "node-api", default-features = false }
-ac-primitives = { path = "primitives", default-features = false }
+ac-compose-macros = { version = "0.3", default-features = false }
+ac-node-api = { version = "0.3", default-features = false }
+ac-primitives = { version = "0.6", default-features = false }

[dev-dependencies]
-ac-node-api = { path = "node-api", features = ["mocks"] }
-kitchensink-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "master" }
+ac-node-api = { version = "0.3", features = ["mocks"] }
+kitchensink-runtime = { package = "node-template-runtime", version = "2.0" }
scale-info = { version = "2.1.1", features = ["derive"] }
  • compose-macros/Cargo.toml:
# local
-ac-primitives = { path = "../primitives", default-features = false }
+ac-primitives = { version = "0.6", default-features = false }
  • node-api/Cargo.toml:
# substrate
-sp-core = { default-features = false, features = ["full_crypto"], git = "https://github.com/paritytech/substrate.git", branch = "master" }
-sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "master" }
+sp-core = { version = "19.0", default-features = false, features = ["full_crypto"] }
+sp-runtime = { version = "22.0", default-features = false }

# need to add this for `no_std`
-sp-application-crypto = { default-features = false, git = "https://github.com/paritytech/substrate.git", features = ["full_crypto"], branch = "master" }
-sp-runtime-interface = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "master" }
-
+sp-application-crypto = { version = "21.0", default-features = false, features = ["full_crypto"] }
+sp-runtime-interface = { version = "16.0", default-features = false }
# local
-ac-primitives = { path = "../primitives", default-features = false }
+ac-primitives = { version = "0.6", default-features = false }
  • primitives/Cargo.toml:
# substrate no_std
-sp-core = { default-features = false, features = ["full_crypto"], git = "https://github.com/paritytech/substrate.git", branch = "master" }
-sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "master" }
-sp-runtime-interface = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "master" }
-sp-staking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "master" }
-sp-version = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "master" }
-sp-weights = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "master" }
+sp-core = { version = "19.0", default-features = false, features = ["full_crypto"] }
+sp-runtime = { version = "22.0", default-features = false }
+sp-runtime-interface = { version = "16.0", default-features = false }
+sp-staking = { version = "18.0", default-features = false }
+sp-version = { version = "20.0", default-features = false }
+sp-weights = { version = "18.0", default-features = false }

# need to add this for the app_crypto macro
-sp-application-crypto = { default-features = false, features = ["full_crypto"], git = "https://github.com/paritytech/substrate.git", branch = "master" }
+sp-application-crypto = { version = "21.0", default-features = false, features = ["full_crypto"] }

# substrate std / wasm only
-frame-system = { optional = true, git = "https://github.com/paritytech/substrate.git", branch = "master" }
-pallet-assets = { optional = true, git = "https://github.com/paritytech/substrate.git", branch = "master" }
-pallet-balances = { optional = true, git = "https://github.com/paritytech/substrate.git", branch = "master" }
-pallet-contracts = { optional = true, git = "https://github.com/paritytech/substrate.git", branch = "master" }
-pallet-staking = { optional = true, git = "https://github.com/paritytech/substrate.git", branch = "master" }
+frame-system = { version = "20.0", optional = true }
+pallet-assets = { version = "21.0", optional = true }
+pallet-balances = { version = "20.0", optional = true }
+pallet-contracts = { version = "19.0", optional = true }
+pallet-staking = { version = "20.0", optional = true }

[dev-dependencies]
-node-template-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "master" }
-sp-keyring = { git = "https://github.com/paritytech/substrate.git", branch = "master" }
+node-template-runtime = { version = "2.0" }
+sp-keyring = { version = "22.0" }

@brenzi
Copy link
Contributor

brenzi commented Feb 27, 2024

Would be great if you could publish major bumps on crates.io for every minor polkadot-sdk upgrade. As polkadot-sdk isn't semver compliant, releases are always breaking changes, so they bump crates.io major revisions for every minor release of the sdk. Probably easiest to just follow the same rule.

encointer pallets now get versioned like this and published to crates.io:

  • polkadot-sdk-v1.6.0 - sp-core-28.0.0 - encointer*-5.0.0
  • polkadot-sdk-v1.7.0 - sp-core-29.0.0 - encointer*-6.0.0

against semver-logic, encointer-internal changes will be versioned with minor or patch revisions

@haerdib haerdib reopened this Feb 27, 2024
@haerdib
Copy link
Contributor Author

haerdib commented Feb 29, 2024

As crates.io seems to be needed now, I'd propose to change our release cycle to match the one of parity. E.g. as @brenzi suggested, for every polkadot-sdk release, we will release a version of our own - and publish it on crates.io accordingly.

If agreed upon, the following needs to be done:

@haerdib
Copy link
Contributor Author

haerdib commented Feb 29, 2024

@brenzi v0.17 has been published, but for v1.8.0. Is that alright with you?

@brenzi
Copy link
Contributor

brenzi commented Mar 1, 2024

@haerdib amazing, thank you!
I can live with polkadot-v1.8.0, yes. forces me to do that upgrade as well already ;-)

@brenzi
Copy link
Contributor

brenzi commented Mar 1, 2024

@haerdib I can't find substrate-client-keystore crate on crates.io. May I ask you to publish that as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants