-
Notifications
You must be signed in to change notification settings - Fork 2.7k
WIP: Enable continuous package release to crates.io #9417
Changes from all commits
71e7e22
9ef1b1f
e05a582
26ba28c
48c847d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -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 | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
| script: | ||||||||
| - cargo install cargo-unleash ${CARGO_UNLEASH_INSTALL_PARAMS} | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it mature enough to be installed into CI image?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably - until it's not v1 I'd prefer not to; the time savings is miniscule I'd say comparing to the actual checking done by the tool later on
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not on every commit tho |
||||||||
| # 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 | ||||||||
Xanewok marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||
| needs: | ||||||||
| - job: unleash-check | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Either you should list the jobs necessary to be green in order to start this job, because this way it starts right after
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we somehow make it so that it runs at
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. By
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can run
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can move this to the
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's worth it, the test stage already brings a lot of concurrent jobs. The longest job in the test stage is |
||||||||
| <<: *docker-env | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
| rules: | ||||||||
| - if: $CI_COMMIT_REF_NAME =~ /^ci-release-.*$/ | ||||||||
| - if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1 | ||||||||
TriplEight marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||
| 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 | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this may be removed as soon as it will publish stably. |
||||||||
|
|
||||||||
| #### stage: deploy | ||||||||
|
|
||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,7 @@ authors = ["Parity Technologies <[email protected]>"] | |
| 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 | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,7 @@ authors = ["Parity Technologies <[email protected]>"] | |
| description = "Tests for the in-browser light client." | ||
| edition = "2018" | ||
| license = "Apache-2.0" | ||
| publish = false | ||
|
|
||
| [dependencies] | ||
| futures-timer = "3.0.2" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you really want to publish before the tests are green?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the
unleash-check- I think it should be run early/at the same time as tests; only publishing should be done after every test is greenThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my view (I actually do not know what does it check,
Check whether crates can be packagedin the docs is probably not enough) it's an overkill to run these checks on every commit. We should run them before the release target, so maybe on master, or even nightly?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand this correctly, what you propose may lead to the PR checks being green at first but only discovered to be red once merged. If that's the case, then won't be much incentive to fix this once a PR is merged and it'll just hang around being red until someone disables it again - I'd rather we catch that early.
If this is deemed to expensive to run on every commit, we might want to run this as an extra step for
bot mergeto not merge a given PR until we know for sure that this check is green.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is expensive, the job takes 30 minutes. Any possible way to combine it with something to reuse the cache?
Ideally, it will run on the pre-merge pipeline and a merge-train, but they are not ready yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it's better to either check only if certain files are changed or versions got bumped?