Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit b99f2bc

Browse files
Implement crate publishing on CI (#12768)
* implement crate publishing from CI * fix indentation * use resource_group for job exclusivity ensure that at most one instance of the publish-crates job is running at any given time to prevent race conditions * correct publish = false * Remove YAML anchors as GitLab's `extends:` doesn't need it * Temporarily force cache upload for the new jobs * Revert `RUSTY_CACHIER_FORCE_UPLOAD` * pin libp2p-tcp=0.37.0 for sc-telemetry * Revert "pin libp2p-tcp=0.37.0 for sc-telemetry" This reverts commit 29146bf. * always collect generated crates * increase timeout for publish-crates-template * Force upload the new job cache again * Revert "Force upload the new job cache again" This reverts commit 5a5feee. * reformat * improve timeout explanation * s/usual/average Co-authored-by: Vladimir Istyufeev <[email protected]>
1 parent 0a27e54 commit b99f2bc

File tree

48 files changed

+137
-36
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+137
-36
lines changed

.gitlab-ci.yml

+19
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,25 @@ default:
180180
# this job runs only on nightly pipeline with the mentioned variable, against `master` branch
181181
- if: $CI_COMMIT_REF_NAME == "master" && $CI_PIPELINE_SOURCE == "schedule" && $PIPELINE == "nightly"
182182

183+
.crates-publishing-template:
184+
stage: test
185+
extends: .docker-env
186+
# collect artifacts even on failure so that we know how the crates were generated (they'll be
187+
# generated to the artifacts folder according to SPUB_TMP further down)
188+
artifacts:
189+
name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}"
190+
when: always
191+
expire_in: 7 days
192+
paths:
193+
- artifacts/
194+
variables:
195+
CRATESIO_API: https://crates.io/api
196+
CRATESIO_CRATES_OWNER: parity-crate-owner
197+
GH_API: https://api.github.com
198+
REPO: substrate
199+
REPO_OWNER: paritytech
200+
SPUB_TMP: artifacts
201+
183202
#### stage: .pre
184203

185204
skip-if-draft:

Cargo.lock

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+9
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ members = [
88
"bin/node/bench",
99
"bin/node/cli",
1010
"bin/node/executor",
11+
"bin/node/inspect",
1112
"bin/node/primitives",
1213
"bin/node/rpc",
1314
"bin/node/runtime",
@@ -39,11 +40,13 @@ members = [
3940
"client/executor/wasmi",
4041
"client/executor/wasmtime",
4142
"client/finality-grandpa",
43+
"client/finality-grandpa/rpc",
4244
"client/informant",
4345
"client/keystore",
4446
"client/merkle-mountain-range",
4547
"client/merkle-mountain-range/rpc",
4648
"client/network",
49+
"client/network/transactions",
4750
"client/network-gossip",
4851
"client/network/bitswap",
4952
"client/network/common",
@@ -88,11 +91,13 @@ members = [
8891
"frame/child-bounties",
8992
"frame/collective",
9093
"frame/contracts",
94+
"frame/contracts/proc-macro",
9195
"frame/contracts/primitives",
9296
"frame/conviction-voting",
9397
"frame/democracy",
9498
"frame/fast-unstake",
9599
"frame/try-runtime",
100+
"frame/elections-phragmen",
96101
"frame/election-provider-multi-phase",
97102
"frame/election-provider-support",
98103
"frame/election-provider-support/benchmarking",
@@ -113,6 +118,7 @@ members = [
113118
"frame/nicks",
114119
"frame/node-authorization",
115120
"frame/offences",
121+
"frame/offences/benchmarking",
116122
"frame/preimage",
117123
"frame/proxy",
118124
"frame/nomination-pools",
@@ -143,6 +149,7 @@ members = [
143149
"frame/support/procedural/tools/derive",
144150
"frame/support/test",
145151
"frame/support/test/compile_pass",
152+
"frame/support/test/pallet",
146153
"frame/system",
147154
"frame/system/benchmarking",
148155
"frame/system/rpc/runtime-api",
@@ -174,6 +181,7 @@ members = [
174181
"primitives/consensus/babe",
175182
"primitives/consensus/common",
176183
"primitives/consensus/pow",
184+
"primitives/consensus/slots",
177185
"primitives/consensus/vrf",
178186
"primitives/core",
179187
"primitives/core/hashing",
@@ -215,6 +223,7 @@ members = [
215223
"primitives/version/proc-macro",
216224
"primitives/wasm-interface",
217225
"primitives/weights",
226+
"test-utils",
218227
"test-utils/client",
219228
"test-utils/derive",
220229
"test-utils/runtime",

bin/node/bench/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ edition = "2021"
77
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
88
homepage = "https://substrate.io"
99
repository = "https://github.com/paritytech/substrate/"
10+
publish = false
1011

1112
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1213

bin/node/cli/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
99
default-run = "substrate"
1010
homepage = "https://substrate.io"
1111
repository = "https://github.com/paritytech/substrate/"
12+
publish = false
1213

1314
[package.metadata.wasm-pack.profile.release]
1415
# `wasm-opt` has some problems on linux, see

bin/node/executor/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ edition = "2021"
77
license = "Apache-2.0"
88
homepage = "https://substrate.io"
99
repository = "https://github.com/paritytech/substrate/"
10+
publish = false
1011

1112
[package.metadata.docs.rs]
1213
targets = ["x86_64-unknown-linux-gnu"]

bin/node/inspect/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ edition = "2021"
77
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
88
homepage = "https://substrate.io"
99
repository = "https://github.com/paritytech/substrate/"
10+
publish = false
1011

1112
[package.metadata.docs.rs]
1213
targets = ["x86_64-unknown-linux-gnu"]

bin/node/primitives/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ edition = "2021"
77
license = "Apache-2.0"
88
homepage = "https://substrate.io"
99
repository = "https://github.com/paritytech/substrate/"
10+
publish = false
1011

1112
[package.metadata.docs.rs]
1213
targets = ["x86_64-unknown-linux-gnu"]

bin/node/rpc/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ edition = "2021"
77
license = "Apache-2.0"
88
homepage = "https://substrate.io"
99
repository = "https://github.com/paritytech/substrate/"
10+
publish = false
1011

1112
[package.metadata.docs.rs]
1213
targets = ["x86_64-unknown-linux-gnu"]

bin/node/runtime/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ build = "build.rs"
88
license = "Apache-2.0"
99
homepage = "https://substrate.io"
1010
repository = "https://github.com/paritytech/substrate/"
11+
publish = false
1112

1213
[package.metadata.docs.rs]
1314
targets = ["x86_64-unknown-linux-gnu"]

bin/node/testing/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ edition = "2021"
77
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
88
homepage = "https://substrate.io"
99
repository = "https://github.com/paritytech/substrate/"
10-
publish = true
10+
publish = false
1111

1212
[package.metadata.docs.rs]
1313
targets = ["x86_64-unknown-linux-gnu"]

client/merkle-mountain-range/rpc/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ license = "Apache-2.0"
77
homepage = "https://substrate.io"
88
repository = "https://github.com/paritytech/substrate/"
99
description = "Node-specific RPC methods for interaction with Merkle Mountain Range pallet."
10-
publish = false
1110

1211
[package.metadata.docs.rs]
1312
targets = ["x86_64-unknown-linux-gnu"]

client/network/bitswap/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ edition = "2021"
88
homepage = "https://substrate.io"
99
repository = "https://github.com/paritytech/substrate/"
1010
documentation = "https://docs.rs/sc-network-bitswap"
11-
readme = "README.md"
1211

1312
[package.metadata.docs.rs]
1413
targets = ["x86_64-unknown-linux-gnu"]

client/network/common/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ edition = "2021"
88
homepage = "https://substrate.io"
99
repository = "https://github.com/paritytech/substrate/"
1010
documentation = "https://docs.rs/sc-network-sync"
11-
readme = "README.md"
1211

1312
[package.metadata.docs.rs]
1413
targets = ["x86_64-unknown-linux-gnu"]

client/network/light/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ edition = "2021"
88
homepage = "https://substrate.io"
99
repository = "https://github.com/paritytech/substrate/"
1010
documentation = "https://docs.rs/sc-network-light"
11-
readme = "README.md"
1211

1312
[package.metadata.docs.rs]
1413
targets = ["x86_64-unknown-linux-gnu"]

client/network/sync/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ edition = "2021"
88
homepage = "https://substrate.io"
99
repository = "https://github.com/paritytech/substrate/"
1010
documentation = "https://docs.rs/sc-network-sync"
11-
readme = "README.md"
1211

1312
[package.metadata.docs.rs]
1413
targets = ["x86_64-unknown-linux-gnu"]

client/network/transactions/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ edition = "2021"
88
homepage = "https://substrate.io"
99
repository = "https://github.com/paritytech/substrate/"
1010
documentation = "https://docs.rs/sc-network-transactions"
11-
readme = "README.md"
1211

1312
[package.metadata.docs.rs]
1413
targets = ["x86_64-unknown-linux-gnu"]

client/sync-state-rpc/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ edition = "2021"
77
license = "Apache-2.0"
88
homepage = "https://substrate.io"
99
repository = "https://github.com/paritytech/substrate/"
10-
readme = "README.md"
1110

1211
[package.metadata.docs.rs]
1312
targets = ["x86_64-unknown-linux-gnu"]

frame/bags-list/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ license = "Apache-2.0"
77
homepage = "https://substrate.io"
88
repository = "https://github.com/paritytech/substrate/"
99
description = "FRAME pallet bags list"
10-
readme = "README.md"
1110

1211
[package.metadata.docs.rs]
1312
targets = ["x86_64-unknown-linux-gnu"]

frame/bags-list/fuzzer/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ license = "Apache-2.0"
77
homepage = "https://substrate.io"
88
repository = "https://github.com/paritytech/substrate/"
99
description = "Fuzzer for FRAME pallet bags list"
10-
readme = "README.md"
1110
publish = false
1211

1312
[dependencies]

frame/bags-list/remote-tests/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ license = "Apache-2.0"
77
homepage = "https://substrate.io"
88
repository = "https://github.com/paritytech/substrate/"
99
description = "FRAME pallet bags list remote test"
10-
readme = "README.md"
10+
publish = false
1111

1212
[package.metadata.docs.rs]
1313
targets = ["x86_64-unknown-linux-gnu"]

frame/election-provider-multi-phase/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ license = "Apache-2.0"
77
homepage = "https://substrate.io"
88
repository = "https://github.com/paritytech/substrate/"
99
description = "PALLET two phase election providers"
10-
readme = "README.md"
1110

1211
[package.metadata.docs.rs]
1312
targets = ["x86_64-unknown-linux-gnu"]

frame/election-provider-support/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ license = "Apache-2.0"
77
homepage = "https://substrate.io"
88
repository = "https://github.com/paritytech/substrate/"
99
description = "election provider supporting traits"
10-
readme = "README.md"
1110

1211
[package.metadata.docs.rs]
1312
targets = ["x86_64-unknown-linux-gnu"]

frame/fast-unstake/Cargo.toml

+4-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ license = "Unlicense"
77
homepage = "https://substrate.io"
88
repository = "https://github.com/paritytech/substrate/"
99
description = "FRAME fast unstake pallet"
10-
readme = "README.md"
1110

1211
[package.metadata.docs.rs]
1312
targets = ["x86_64-unknown-linux-gnu"]
@@ -26,7 +25,10 @@ sp-std = { version = "5.0.0", default-features = false, path = "../../primitives
2625
sp-staking = { default-features = false, path = "../../primitives/staking" }
2726
frame-election-provider-support = { default-features = false, path = "../election-provider-support" }
2827

28+
# optional dependencies for cargo features
2929
frame-benchmarking = { version = "4.0.0-dev", default-features = false, optional = true, path = "../benchmarking" }
30+
pallet-staking = { default-features = false, optional = true, path = "../staking" }
31+
pallet-assets = { default-features = false, optional = true, path = "../assets" }
3032

3133
[dev-dependencies]
3234
pallet-staking-reward-curve = { version = "4.0.0-dev", path = "../staking/reward-curve" }
@@ -36,6 +38,7 @@ sp-tracing = { version = "6.0.0", path = "../../primitives/tracing" }
3638
pallet-staking = { path = "../staking" }
3739
pallet-balances = { path = "../balances" }
3840
pallet-timestamp = { path = "../timestamp" }
41+
pallet-assets = { path = "../assets" }
3942

4043

4144
[features]

frame/lottery/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ license = "Apache-2.0"
77
homepage = "https://substrate.io"
88
repository = "https://github.com/paritytech/substrate/"
99
description = "FRAME Participation Lottery Pallet"
10-
readme = "README.md"
1110

1211
[package.metadata.docs.rs]
1312
targets = ["x86_64-unknown-linux-gnu"]

frame/nomination-pools/benchmarking/Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ sp-runtime = { version = "7.0.0", default-features = false, path = "../../../pri
3131
sp-runtime-interface = { version = "7.0.0", default-features = false, path = "../../../primitives/runtime-interface" }
3232
sp-staking = { version = "4.0.0-dev", default-features = false, path = "../../../primitives/staking" }
3333
sp-std = { version = "5.0.0", default-features = false, path = "../../../primitives/std" }
34+
sp-io = { optional = true, default-features = false, path = "../../../primitives/io" }
3435

3536
[dev-dependencies]
3637
pallet-balances = { version = "4.0.0-dev", default-features = false, path = "../../balances" }
@@ -54,7 +55,7 @@ std = [
5455
"sp-runtime-interface/std",
5556
"sp-io/std",
5657
"sp-staking/std",
57-
"sp-std/std",
58+
"sp-std/std",
5859
]
5960

6061
runtime-benchmarks = [

frame/nomination-pools/test-staking/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ license = "Apache-2.0"
77
homepage = "https://substrate.io"
88
repository = "https://github.com/paritytech/substrate/"
99
description = "FRAME nomination pools pallet tests with the staking pallet"
10+
publish = false
1011

1112
[package.metadata.docs.rs]
1213
targets = ["x86_64-unknown-linux-gnu"]

frame/preimage/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ license = "Apache-2.0"
77
homepage = "https://substrate.io"
88
repository = "https://github.com/paritytech/substrate/"
99
description = "FRAME pallet for storing preimages of hashes"
10-
readme = "README.md"
1110

1211
[dependencies]
1312
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] }

frame/root-testing/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ homepage = "https://substrate.io"
88
repository = "https://github.com/paritytech/substrate/"
99
description = "FRAME root testing pallet"
1010
readme = "README.md"
11+
publish = false
1112

1213
[package.metadata.docs.rs]
1314
targets = ["x86_64-unknown-linux-gnu"]

frame/staking/Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@ sp-application-crypto = { version = "7.0.0", default-features = false, path = ".
3232
frame-election-provider-support = { version = "4.0.0-dev", default-features = false, path = "../election-provider-support" }
3333
log = { version = "0.4.17", default-features = false }
3434

35-
# Optional imports for benchmarking
35+
# optional dependencies for cargo features
3636
frame-benchmarking = { version = "4.0.0-dev", default-features = false, path = "../benchmarking", optional = true }
3737
rand_chacha = { version = "0.2", default-features = false, optional = true }
38+
pallet-bags-list = { default-features = false, optional = true, path = "../bags-list" }
3839

3940
[dev-dependencies]
4041
sp-tracing = { version = "6.0.0", path = "../../primitives/tracing" }

frame/state-trie-migration/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ license = "Apache-2.0"
77
homepage = "https://substrate.io"
88
repository = "https://github.com/paritytech/substrate/"
99
description = "FRAME pallet migration of trie"
10-
readme = "README.md"
1110

1211
[package.metadata.docs.rs]
1312
targets = ["x86_64-unknown-linux-gnu"]

frame/transaction-payment/asset-tx-payment/Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@ sp-io = { version = "7.0.0", default-features = false, path = "../../../primitiv
1919
sp-runtime = { version = "7.0.0", default-features = false, path = "../../../primitives/runtime" }
2020
sp-std = { version = "5.0.0", default-features = false, path = "../../../primitives/std" }
2121

22+
# optional dependencies for cargo features
2223
frame-support = { version = "4.0.0-dev", default-features = false, path = "../../support" }
2324
frame-system = { version = "4.0.0-dev", default-features = false, path = "../../system" }
2425
pallet-transaction-payment = { version = "4.0.0-dev", default-features = false, path = ".." }
2526
frame-benchmarking = { version = "4.0.0-dev", default-features = false, path = "../../benchmarking", optional = true }
27+
pallet-assets = { default-features = false, optional = true, path = "../../assets" }
2628

2729
# Other dependencies
2830
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] }

frame/try-runtime/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ license = "Apache-2.0"
77
homepage = "https://substrate.io"
88
repository = "https://github.com/paritytech/substrate/"
99
description = "FRAME pallet for democracy"
10-
readme = "README.md"
1110

1211
[package.metadata.docs.rs]
1312
targets = ["x86_64-unknown-linux-gnu"]

frame/whitelist/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ license = "Apache-2.0"
77
homepage = "https://substrate.io"
88
repository = "https://github.com/paritytech/substrate/"
99
description = "FRAME pallet for whitelisting call, and dispatch from specific origin"
10-
readme = "README.md"
1110

1211
[package.metadata.docs.rs]
1312
targets = ["x86_64-unknown-linux-gnu"]

primitives/beefy/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ license = "Apache-2.0"
77
homepage = "https://substrate.io"
88
repository = "https://github.com/paritytech/substrate"
99
description = "Primitives for BEEFY protocol."
10-
readme = "README.md"
1110

1211
[package.metadata.docs.rs]
1312
targets = ["x86_64-unknown-linux-gnu"]

0 commit comments

Comments
 (0)