diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2cef2d8badcc9..dd153f79efd7f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -41,7 +41,6 @@ variables: &default-vars CI_IMAGE: "paritytech/ci-linux:production" # FIXME set to release CARGO_UNLEASH_INSTALL_PARAMS: "--version 1.0.0-alpha.12" - CARGO_UNLEASH_PKG_DEF: "--skip node node-* pallet-template pallet-example pallet-example-* subkey chain-spec-builder" default: cache: {} @@ -337,12 +336,15 @@ unleash-check: <<: *test-refs-no-trigger script: - cargo install cargo-unleash ${CARGO_UNLEASH_INSTALL_PARAMS} + # TODO: Don't specify crates version in dev-dependencies - cargo automatically + # prunes such dependencies from the manifest. Otherwise we form a package + # cycle and cannot proceed with publishing/checking - cargo unleash de-dev-deps # Reuse build artifacts when running checks (cuts down check time by 3x) # TODO: Implement this optimization in cargo-unleash rather than here - mkdir -p target/unleash - export CARGO_TARGET_DIR=target/unleash - - cargo unleash check ${CARGO_UNLEASH_PKG_DEF} + - cargo unleash check test-frame-examples-compile-to-wasm: # into one job @@ -670,14 +672,22 @@ publish-draft-release: allow_failure: true publish-to-crates-io: + # `cargo unleash em-dragons` first syncs the latest crates.io versions, then checks the local + # tree against them. Only the crates that locally have a version not found on crates.io (and + # don't have a `publish = false` flag in their `Cargo.toml`) will be attempted to be released. + # If the PR didn't change any version (for the majority of PRs) – no matter what others changes + # have occurred – this does exactly nothing, states that all is fine and quits. stage: publish + needs: + - job: unleash-check <<: *docker-env - rules: - - if: $CI_COMMIT_REF_NAME =~ /^ci-release-.*$/ - - if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1 script: - cargo install cargo-unleash ${CARGO_UNLEASH_INSTALL_PARAMS} - - cargo unleash em-dragons --no-check --owner github:paritytech:core-devs ${CARGO_UNLEASH_PKG_DEF} + # TODO: Don't specify crates version in dev-dependencies - cargo automatically + # prunes such dependencies from the manifest. Otherwise we form a package + # cycle and cannot proceed with publishing/checking + - cargo unleash de-dev-deps + - cargo unleash em-dragons --no-check --owner github:paritytech:core-devs --dry-run allow_failure: true #### stage: deploy diff --git a/bin/node/bench/Cargo.toml b/bin/node/bench/Cargo.toml index ac643a1109c5a..4c64f97de1ca5 100644 --- a/bin/node/bench/Cargo.toml +++ b/bin/node/bench/Cargo.toml @@ -5,6 +5,7 @@ authors = ["Parity Technologies "] description = "Substrate node integration benchmarks." edition = "2018" license = "GPL-3.0-or-later WITH Classpath-exception-2.0" +publish = false # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/bin/node/browser-testing/Cargo.toml b/bin/node/browser-testing/Cargo.toml index 17b3966766b9b..d34efc497d771 100644 --- a/bin/node/browser-testing/Cargo.toml +++ b/bin/node/browser-testing/Cargo.toml @@ -5,6 +5,7 @@ authors = ["Parity Technologies "] description = "Tests for the in-browser light client." edition = "2018" license = "Apache-2.0" +publish = false [dependencies] futures-timer = "3.0.2" diff --git a/bin/node/cli/Cargo.toml b/bin/node/cli/Cargo.toml index 7c8c2d0e3d863..11ad0b7c1858e 100644 --- a/bin/node/cli/Cargo.toml +++ b/bin/node/cli/Cargo.toml @@ -9,6 +9,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0" default-run = "substrate" homepage = "https://substrate.dev" repository = "https://github.com/paritytech/substrate/" +publish = false [package.metadata.wasm-pack.profile.release] # `wasm-opt` has some problems on linux, see diff --git a/bin/node/executor/Cargo.toml b/bin/node/executor/Cargo.toml index 5b0617d6af8e0..febe36d3c5c78 100644 --- a/bin/node/executor/Cargo.toml +++ b/bin/node/executor/Cargo.toml @@ -7,6 +7,7 @@ edition = "2018" license = "Apache-2.0" homepage = "https://substrate.dev" repository = "https://github.com/paritytech/substrate/" +publish = false [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/bin/node/inspect/Cargo.toml b/bin/node/inspect/Cargo.toml index abd54cdbcd957..21b6f568f1c6d 100644 --- a/bin/node/inspect/Cargo.toml +++ b/bin/node/inspect/Cargo.toml @@ -6,6 +6,7 @@ edition = "2018" license = "GPL-3.0-or-later WITH Classpath-exception-2.0" homepage = "https://substrate.dev" repository = "https://github.com/paritytech/substrate/" +publish = false [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/bin/node/primitives/Cargo.toml b/bin/node/primitives/Cargo.toml index 170983d7e0964..1a53eb6e1d62f 100644 --- a/bin/node/primitives/Cargo.toml +++ b/bin/node/primitives/Cargo.toml @@ -6,6 +6,7 @@ edition = "2018" license = "Apache-2.0" homepage = "https://substrate.dev" repository = "https://github.com/paritytech/substrate/" +publish = false [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/bin/node/rpc-client/Cargo.toml b/bin/node/rpc-client/Cargo.toml index 9ccb6c0817fd0..bdab95c83477d 100644 --- a/bin/node/rpc-client/Cargo.toml +++ b/bin/node/rpc-client/Cargo.toml @@ -6,6 +6,7 @@ edition = "2018" license = "Apache-2.0" homepage = "https://substrate.dev" repository = "https://github.com/paritytech/substrate/" +publish = false [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/bin/node/rpc/Cargo.toml b/bin/node/rpc/Cargo.toml index 464971379c492..e119a9c401c19 100644 --- a/bin/node/rpc/Cargo.toml +++ b/bin/node/rpc/Cargo.toml @@ -6,6 +6,7 @@ edition = "2018" license = "Apache-2.0" homepage = "https://substrate.dev" repository = "https://github.com/paritytech/substrate/" +publish = false [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/bin/node/runtime/Cargo.toml b/bin/node/runtime/Cargo.toml index 78e46edbd64e4..5823f85de697b 100644 --- a/bin/node/runtime/Cargo.toml +++ b/bin/node/runtime/Cargo.toml @@ -7,6 +7,7 @@ build = "build.rs" license = "Apache-2.0" homepage = "https://substrate.dev" repository = "https://github.com/paritytech/substrate/" +publish = false [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/bin/node/testing/Cargo.toml b/bin/node/testing/Cargo.toml index e2a4555e6797c..cecda40bc72fd 100644 --- a/bin/node/testing/Cargo.toml +++ b/bin/node/testing/Cargo.toml @@ -7,7 +7,7 @@ edition = "2018" license = "GPL-3.0-or-later WITH Classpath-exception-2.0" homepage = "https://substrate.dev" repository = "https://github.com/paritytech/substrate/" -publish = true +publish = false [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/frame/example-offchain-worker/Cargo.toml b/frame/example-offchain-worker/Cargo.toml index c6b13d1109511..75d7fbdffedf8 100644 --- a/frame/example-offchain-worker/Cargo.toml +++ b/frame/example-offchain-worker/Cargo.toml @@ -8,6 +8,7 @@ homepage = "https://substrate.dev" repository = "https://github.com/paritytech/substrate/" description = "FRAME example pallet for offchain worker" readme = "README.md" +publish = false [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/frame/example-parallel/Cargo.toml b/frame/example-parallel/Cargo.toml index 761d0e4ff14d9..874737f2d8991 100644 --- a/frame/example-parallel/Cargo.toml +++ b/frame/example-parallel/Cargo.toml @@ -7,6 +7,7 @@ license = "Unlicense" homepage = "https://substrate.dev" repository = "https://github.com/paritytech/substrate/" description = "FRAME example pallet using runtime worker threads" +publish = false [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/frame/example/Cargo.toml b/frame/example/Cargo.toml index 08d7af4ef673f..2ae8bb050097e 100644 --- a/frame/example/Cargo.toml +++ b/frame/example/Cargo.toml @@ -8,6 +8,7 @@ homepage = "https://substrate.dev" repository = "https://github.com/paritytech/substrate/" description = "FRAME example pallet" readme = "README.md" +publish = false [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"]