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

Commit

Permalink
Implement crate publishing on CI (#12768)
Browse files Browse the repository at this point in the history
* 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 <vladimir@parity.io>
  • Loading branch information
joao-paulo-parity and rcny committed Dec 7, 2022
1 parent 0a27e54 commit b99f2bc
Show file tree
Hide file tree
Showing 48 changed files with 137 additions and 36 deletions.
19 changes: 19 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,25 @@ default:
# this job runs only on nightly pipeline with the mentioned variable, against `master` branch
- if: $CI_COMMIT_REF_NAME == "master" && $CI_PIPELINE_SOURCE == "schedule" && $PIPELINE == "nightly"

.crates-publishing-template:
stage: test
extends: .docker-env
# collect artifacts even on failure so that we know how the crates were generated (they'll be
# generated to the artifacts folder according to SPUB_TMP further down)
artifacts:
name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}"
when: always
expire_in: 7 days
paths:
- artifacts/
variables:
CRATESIO_API: https://crates.io/api
CRATESIO_CRATES_OWNER: parity-crate-owner
GH_API: https://api.github.com
REPO: substrate
REPO_OWNER: paritytech
SPUB_TMP: artifacts

#### stage: .pre

skip-if-draft:
Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ members = [
"bin/node/bench",
"bin/node/cli",
"bin/node/executor",
"bin/node/inspect",
"bin/node/primitives",
"bin/node/rpc",
"bin/node/runtime",
Expand Down Expand Up @@ -39,11 +40,13 @@ members = [
"client/executor/wasmi",
"client/executor/wasmtime",
"client/finality-grandpa",
"client/finality-grandpa/rpc",
"client/informant",
"client/keystore",
"client/merkle-mountain-range",
"client/merkle-mountain-range/rpc",
"client/network",
"client/network/transactions",
"client/network-gossip",
"client/network/bitswap",
"client/network/common",
Expand Down Expand Up @@ -88,11 +91,13 @@ members = [
"frame/child-bounties",
"frame/collective",
"frame/contracts",
"frame/contracts/proc-macro",
"frame/contracts/primitives",
"frame/conviction-voting",
"frame/democracy",
"frame/fast-unstake",
"frame/try-runtime",
"frame/elections-phragmen",
"frame/election-provider-multi-phase",
"frame/election-provider-support",
"frame/election-provider-support/benchmarking",
Expand All @@ -113,6 +118,7 @@ members = [
"frame/nicks",
"frame/node-authorization",
"frame/offences",
"frame/offences/benchmarking",
"frame/preimage",
"frame/proxy",
"frame/nomination-pools",
Expand Down Expand Up @@ -143,6 +149,7 @@ members = [
"frame/support/procedural/tools/derive",
"frame/support/test",
"frame/support/test/compile_pass",
"frame/support/test/pallet",
"frame/system",
"frame/system/benchmarking",
"frame/system/rpc/runtime-api",
Expand Down Expand Up @@ -174,6 +181,7 @@ members = [
"primitives/consensus/babe",
"primitives/consensus/common",
"primitives/consensus/pow",
"primitives/consensus/slots",
"primitives/consensus/vrf",
"primitives/core",
"primitives/core/hashing",
Expand Down Expand Up @@ -215,6 +223,7 @@ members = [
"primitives/version/proc-macro",
"primitives/wasm-interface",
"primitives/weights",
"test-utils",
"test-utils/client",
"test-utils/derive",
"test-utils/runtime",
Expand Down
1 change: 1 addition & 0 deletions bin/node/bench/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
publish = false

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

Expand Down
1 change: 1 addition & 0 deletions bin/node/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
default-run = "substrate"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
publish = false

[package.metadata.wasm-pack.profile.release]
# `wasm-opt` has some problems on linux, see
Expand Down
1 change: 1 addition & 0 deletions bin/node/executor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
publish = false

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
Expand Down
1 change: 1 addition & 0 deletions bin/node/inspect/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
publish = false

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
Expand Down
1 change: 1 addition & 0 deletions bin/node/primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
publish = false

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
Expand Down
1 change: 1 addition & 0 deletions bin/node/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
publish = false

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
Expand Down
1 change: 1 addition & 0 deletions bin/node/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ build = "build.rs"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
publish = false

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
Expand Down
2 changes: 1 addition & 1 deletion bin/node/testing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
publish = true
publish = false

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
Expand Down
1 change: 0 additions & 1 deletion client/merkle-mountain-range/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
description = "Node-specific RPC methods for interaction with Merkle Mountain Range pallet."
publish = false

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
Expand Down
1 change: 0 additions & 1 deletion client/network/bitswap/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ edition = "2021"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
documentation = "https://docs.rs/sc-network-bitswap"
readme = "README.md"

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
Expand Down
1 change: 0 additions & 1 deletion client/network/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ edition = "2021"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
documentation = "https://docs.rs/sc-network-sync"
readme = "README.md"

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
Expand Down
1 change: 0 additions & 1 deletion client/network/light/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ edition = "2021"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
documentation = "https://docs.rs/sc-network-light"
readme = "README.md"

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
Expand Down
1 change: 0 additions & 1 deletion client/network/sync/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ edition = "2021"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
documentation = "https://docs.rs/sc-network-sync"
readme = "README.md"

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
Expand Down
1 change: 0 additions & 1 deletion client/network/transactions/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ edition = "2021"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
documentation = "https://docs.rs/sc-network-transactions"
readme = "README.md"

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
Expand Down
1 change: 0 additions & 1 deletion client/sync-state-rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
readme = "README.md"

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
Expand Down
1 change: 0 additions & 1 deletion frame/bags-list/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
description = "FRAME pallet bags list"
readme = "README.md"

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
Expand Down
1 change: 0 additions & 1 deletion frame/bags-list/fuzzer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
description = "Fuzzer for FRAME pallet bags list"
readme = "README.md"
publish = false

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion frame/bags-list/remote-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
description = "FRAME pallet bags list remote test"
readme = "README.md"
publish = false

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
Expand Down
1 change: 0 additions & 1 deletion frame/election-provider-multi-phase/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
description = "PALLET two phase election providers"
readme = "README.md"

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
Expand Down
1 change: 0 additions & 1 deletion frame/election-provider-support/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
description = "election provider supporting traits"
readme = "README.md"

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
Expand Down
5 changes: 4 additions & 1 deletion frame/fast-unstake/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ license = "Unlicense"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
description = "FRAME fast unstake pallet"
readme = "README.md"

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

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

[dev-dependencies]
pallet-staking-reward-curve = { version = "4.0.0-dev", path = "../staking/reward-curve" }
Expand All @@ -36,6 +38,7 @@ sp-tracing = { version = "6.0.0", path = "../../primitives/tracing" }
pallet-staking = { path = "../staking" }
pallet-balances = { path = "../balances" }
pallet-timestamp = { path = "../timestamp" }
pallet-assets = { path = "../assets" }


[features]
Expand Down
1 change: 0 additions & 1 deletion frame/lottery/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
description = "FRAME Participation Lottery Pallet"
readme = "README.md"

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
Expand Down
3 changes: 2 additions & 1 deletion frame/nomination-pools/benchmarking/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ sp-runtime = { version = "7.0.0", default-features = false, path = "../../../pri
sp-runtime-interface = { version = "7.0.0", default-features = false, path = "../../../primitives/runtime-interface" }
sp-staking = { version = "4.0.0-dev", default-features = false, path = "../../../primitives/staking" }
sp-std = { version = "5.0.0", default-features = false, path = "../../../primitives/std" }
sp-io = { optional = true, default-features = false, path = "../../../primitives/io" }

[dev-dependencies]
pallet-balances = { version = "4.0.0-dev", default-features = false, path = "../../balances" }
Expand All @@ -54,7 +55,7 @@ std = [
"sp-runtime-interface/std",
"sp-io/std",
"sp-staking/std",
"sp-std/std",
"sp-std/std",
]

runtime-benchmarks = [
Expand Down
1 change: 1 addition & 0 deletions frame/nomination-pools/test-staking/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
description = "FRAME nomination pools pallet tests with the staking pallet"
publish = false

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
Expand Down
1 change: 0 additions & 1 deletion frame/preimage/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
description = "FRAME pallet for storing preimages of hashes"
readme = "README.md"

[dependencies]
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] }
Expand Down
1 change: 1 addition & 0 deletions frame/root-testing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
description = "FRAME root testing pallet"
readme = "README.md"
publish = false

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
Expand Down
3 changes: 2 additions & 1 deletion frame/staking/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ sp-application-crypto = { version = "7.0.0", default-features = false, path = ".
frame-election-provider-support = { version = "4.0.0-dev", default-features = false, path = "../election-provider-support" }
log = { version = "0.4.17", default-features = false }

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

[dev-dependencies]
sp-tracing = { version = "6.0.0", path = "../../primitives/tracing" }
Expand Down
1 change: 0 additions & 1 deletion frame/state-trie-migration/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
description = "FRAME pallet migration of trie"
readme = "README.md"

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
Expand Down
2 changes: 2 additions & 0 deletions frame/transaction-payment/asset-tx-payment/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ sp-io = { version = "7.0.0", default-features = false, path = "../../../primitiv
sp-runtime = { version = "7.0.0", default-features = false, path = "../../../primitives/runtime" }
sp-std = { version = "5.0.0", default-features = false, path = "../../../primitives/std" }

# optional dependencies for cargo features
frame-support = { version = "4.0.0-dev", default-features = false, path = "../../support" }
frame-system = { version = "4.0.0-dev", default-features = false, path = "../../system" }
pallet-transaction-payment = { version = "4.0.0-dev", default-features = false, path = ".." }
frame-benchmarking = { version = "4.0.0-dev", default-features = false, path = "../../benchmarking", optional = true }
pallet-assets = { default-features = false, optional = true, path = "../../assets" }

# Other dependencies
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] }
Expand Down
1 change: 0 additions & 1 deletion frame/try-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
description = "FRAME pallet for democracy"
readme = "README.md"

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
Expand Down
1 change: 0 additions & 1 deletion frame/whitelist/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
description = "FRAME pallet for whitelisting call, and dispatch from specific origin"
readme = "README.md"

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
Expand Down
1 change: 0 additions & 1 deletion primitives/beefy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate"
description = "Primitives for BEEFY protocol."
readme = "README.md"

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
Expand Down
Loading

0 comments on commit b99f2bc

Please sign in to comment.