More improvements for the crate publishing pipeline (#13153)

* more improvements for the crate publishing pipeline

* move default definitions to the publish-crates script

* add script to check the crate publishing pipeline at the start

* fix yaml references

* move more variables to .crates-publishing-pipeline

* separate .crates-publishing-pipeline from .crates-publishing-variables

* clean up redundant and unused code
This commit is contained in:
JP
2023-01-16 11:03:46 -03:00
committed by GitHub
parent 52a56e5f3d
commit 21141f5d4c
3 changed files with 41 additions and 33 deletions
+24 -15
View File
@@ -229,19 +229,21 @@ variables:
# 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"
.crate-publishing-pipeline:
rules:
- if: $CI_COMMIT_REF_NAME != "master"
when: never
.crates-publishing-variables:
variables:
CRATESIO_CRATES_OWNER: parity-crate-owner
REPO: substrate
REPO_OWNER: paritytech
.scheduled-crate-publishing-pipeline:
.crates-publishing-pipeline:
extends: .crates-publishing-variables
rules:
- !reference [.crate-publishing-pipeline, rules]
- if: $CI_PIPELINE_SOURCE == "schedule" && $PIPELINE == "automatic-crate-publishing"
- if: $CI_PIPELINE_SOURCE == "schedule" && $CI_COMMIT_REF_NAME == "master" && $PIPELINE == "automatic-crate-publishing"
.crates-publishing-template:
stage: test
extends: .docker-env
extends:
- .docker-env
- .crates-publishing-variables
# 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:
@@ -251,12 +253,7 @@ variables:
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
SPUB_TMP: artifacts
#### stage: .pre
@@ -274,6 +271,18 @@ skip-if-draft:
- ./scripts/ci/gitlab/skip_if_draft.sh
allow_failure: true
check-crates-publishing-pipeline:
stage: .pre
extends:
- .kubernetes-env
- .crates-publishing-pipeline
script:
- git clone
--depth 1
--branch "$RELENG_SCRIPTS_BRANCH"
https://github.com/paritytech/releng-scripts.git
- ONLY_CHECK_PIPELINE=true ./releng-scripts/publish-crates
include:
# check jobs
- scripts/ci/gitlab/pipeline/check.yml