Repository: scs/substrate-api-client (language: rust)

Issue:
Publish to crates.io
Why not? It would certainly increase the visibility of this crate and we're already using tags and semantic versioning.


Discussion / hints:
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
That's a little sad. However, there seem to be still users of the published crates.io version (if one is to believe the activity in "Downloads over the last 90 days"), so maybe we should publish it under a different name either way?
How about "substrate-api-client-v2"? 😋 
Or "the-real-substrate-api-client" 😆 
Anyway I think it is worth it to try to contact the owner on crates.io. Renaming the crate will be a hassle for all our users.
Published crates (see branch https://github.com/scs/substrate-api-client/tree/bh/crates-io):

- [x] ac-primitives : https://crates.io/crates/ac-primitives
- [x] ac-compose-macros: https://crates.io/crates/ac-compose-macros
- [x] ac-node-api: https://crates.io/crates/ac-node-api
- [x] substrate-api-client v0.11: https://crates.io/crates/substrate-api-client

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 :)


Necessary changes: Change all GitHub and local dependencies in the `.toml` files to `crates.io`.

More concrete:
- `Cargo.toml`:
```diff
# 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`:
```diff
# local
-ac-primitives = { path = "../primitives", default-features = false }
+ac-primitives = { version = "0.6", default-features = false }
```

- `node-api/Cargo.toml`:
```diff
# 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`:
```diff
# 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" }
```

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

Fix patch:
diff --git a/docs/README.md b/docs/README.md
index a370d4ccf..a4abfc885 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -5,7 +5,7 @@ If a new release is released, the following tasks need to be done:
 1. Update the .toml versions in accordance with the [Semantic Versioning](#semantic-versioning) section.
 2. Add a new tag to the desired commit, see the [Tag generation](#tag-generation) section.
 3. Update and release the new release.
-
+4. Publish to crates.io, see https://doc.rust-lang.org/cargo/reference/publishing.html for more info. Important: Create a new branch and change all github deps to crates.io deps. See https://github.com/scs/substrate-api-client/issues/528 for an example update.
 
 ## TODO list for a new Parity release branch
 To follow a new partiy branch release, the following needs to be done:


Test patch: