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

Commit

Permalink
Merge branch 'master' into delegatecall
Browse files Browse the repository at this point in the history
  • Loading branch information
yarikbratashchuk committed Feb 2, 2022
2 parents b6e7948 + 6611740 commit 6df51c3
Show file tree
Hide file tree
Showing 384 changed files with 6,617 additions and 4,873 deletions.
58 changes: 6 additions & 52 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -209,18 +209,6 @@ default:
AWS_SECRET_ACCESS_KEY:
vault: cicd/gitlab/$CI_PROJECT_PATH/AWS_SECRET_ACCESS_KEY@kv
file: false
AWX_TOKEN:
vault: cicd/gitlab/$CI_PROJECT_PATH/AWX_TOKEN@kv
file: false
CRATES_TOKEN:
vault: cicd/gitlab/$CI_PROJECT_PATH/CRATES_TOKEN@kv
file: false
DOCKER_CHAOS_TOKEN:
vault: cicd/gitlab/$CI_PROJECT_PATH/DOCKER_CHAOS_TOKEN@kv
file: false
DOCKER_CHAOS_USER:
vault: cicd/gitlab/$CI_PROJECT_PATH/DOCKER_CHAOS_USER@kv
file: false
GITHUB_EMAIL:
vault: cicd/gitlab/$CI_PROJECT_PATH/GITHUB_EMAIL@kv
file: false
Expand All @@ -239,22 +227,13 @@ default:
MATRIX_ROOM_ID:
vault: cicd/gitlab/$CI_PROJECT_PATH/MATRIX_ROOM_ID@kv
file: false
PIPELINE_TOKEN:
vault: cicd/gitlab/$CI_PROJECT_PATH/PIPELINE_TOKEN@kv
file: false
VALIDATOR_KEYS:
vault: cicd/gitlab/$CI_PROJECT_PATH/VALIDATOR_KEYS@kv
file: false
VALIDATOR_KEYS_CHAOS:
vault: cicd/gitlab/$CI_PROJECT_PATH/VALIDATOR_KEYS_CHAOS@kv
file: false


#### stage: .pre

skip-if-draft:
image: paritytech/tools:latest
<<: *kubernetes-env
<<: *vault-secrets
stage: .pre
rules:
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
Expand All @@ -270,7 +249,6 @@ check-runtime:
stage: check
image: paritytech/tools:latest
<<: *kubernetes-env
<<: *vault-secrets
rules:
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
variables:
Expand All @@ -285,7 +263,6 @@ check-signed-tag:
stage: check
image: paritytech/tools:latest
<<: *kubernetes-env
<<: *vault-secrets
rules:
- if: $CI_COMMIT_REF_NAME =~ /^ci-release-.*$/
- if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1
Expand Down Expand Up @@ -548,7 +525,6 @@ cargo-check-macos:
stage: build
<<: *docker-env
<<: *test-refs-no-trigger-prs-only
<<: *vault-secrets
script:
- git clone
--depth=1
Expand Down Expand Up @@ -747,13 +723,7 @@ publish-rustdoc:
image: node:16
variables:
GIT_DEPTH: 100
# --- Following variables are for rustdocs deployment ---
# Space separated values of branches and tags to generate rustdocs
RUSTDOCS_DEPLOY_REFS: "master monthly-2021-09+1 monthly-2021-08 v3.0.0"
# Location of the docs index template
INDEX_TPL: ".maintain/docs-index-tpl.ejs"
# Where the `/latest` symbolic link links to. One of the $RUSTDOCS_DEPLOY_REFS value.
LATEST: "monthly-2021-09+1"
RUSTDOCS_DEPLOY_REFS: "master"
rules:
- if: $CI_PIPELINE_SOURCE == "pipeline"
when: never
Expand Down Expand Up @@ -783,34 +753,18 @@ publish-rustdoc:
- git config remote.origin.url "git@github.com:/paritytech/${CI_PROJECT_NAME}.git"
- git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
- git fetch origin gh-pages
# Install `ejs` and generate index.html based on RUSTDOCS_DEPLOY_REFS
- yarn global add ejs
- 'ejs ${INDEX_TPL} -i "{\"deploy_refs\":\"${RUSTDOCS_DEPLOY_REFS}\",\"repo_name\":\"${CI_PROJECT_NAME}\",\"latest\":\"${LATEST}\"}" > /tmp/index.html'
# Save README and docs
- cp -r ./crate-docs/ /tmp/doc/
- cp README.md /tmp/doc/
- git checkout gh-pages
# Remove directories no longer necessary, as specified in $RUSTDOCS_DEPLOY_REFS.
# Also ensure $RUSTDOCS_DEPLOY_REFS is not just empty spaces.
# Even though this block spans multiple lines, they are concatenated to run as a single line
# command, so note for the semi-colons in the inner-most code block.
- if [[ ! -z ${RUSTDOCS_DEPLOY_REFS// } ]]; then
for FILE in *; do
if [[ ! " $RUSTDOCS_DEPLOY_REFS " =~ " $FILE " ]]; then
echo "Removing ${FILE}...";
rm -rf $FILE;
fi
done
fi
# Move the index page & built back
- mv -f /tmp/index.html .
# Install `index-tpl-crud` and generate index.html based on RUSTDOCS_DEPLOY_REFS
- which index-tpl-crud &> /dev/null || yarn global add @substrate/index-tpl-crud
- index-tpl-crud upsert ./index.html ${CI_COMMIT_REF_NAME}
# Ensure the destination dir doesn't exist.
- rm -rf ${CI_COMMIT_REF_NAME}
- mv -f /tmp/doc ${CI_COMMIT_REF_NAME}
# Add the symlink
- '[[ -e "$LATEST" ]] && ln -sf "${LATEST}" latest'
# Upload files
- git add --all --force
- git add --all
# `git commit` has an exit code of > 0 if there is nothing to commit.
# This causes GitLab to exit immediately and marks this job failed.
# We don't want to mark the entire job failed if there's nothing to
Expand Down
2 changes: 1 addition & 1 deletion .maintain/node-template-release/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ license = "GPL-3.0"
toml = "0.4"
tar = "0.4"
glob = "0.2"
structopt = "0.3"
clap = { version = "3.0", features = ["derive"] }
tempfile = "3"
fs_extra = "1"
git2 = "0.8"
Expand Down
13 changes: 6 additions & 7 deletions .maintain/node-template-release/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use structopt::StructOpt;
use clap::Parser;

use std::{
collections::HashMap,
Expand Down Expand Up @@ -26,13 +26,13 @@ const SUBSTRATE_GIT_URL: &str = "https://github.com/paritytech/substrate.git";

type CargoToml = HashMap<String, toml::Value>;

#[derive(StructOpt)]
#[derive(Parser)]
struct Options {
/// The path to the `node-template` source.
#[structopt(parse(from_os_str))]
#[clap(parse(from_os_str))]
node_template: PathBuf,
/// The path where to output the generated `tar.gz` file.
#[structopt(parse(from_os_str))]
#[clap(parse(from_os_str))]
output: PathBuf,
}

Expand Down Expand Up @@ -209,7 +209,7 @@ fn build_and_test(path: &Path, cargo_tomls: &[PathBuf]) {
}

fn main() {
let options = Options::from_args();
let options = Options::parse();

let build_dir = tempfile::tempdir().expect("Creates temp build dir");

Expand Down Expand Up @@ -261,8 +261,7 @@ fn main() {

// adding root rustfmt to node template build path
let node_template_rustfmt_toml_path = node_template_path.join("rustfmt.toml");
let root_rustfmt_toml =
&options.node_template.join("../../rustfmt.toml");
let root_rustfmt_toml = &options.node_template.join("../../rustfmt.toml");
if root_rustfmt_toml.exists() {
fs::copy(&root_rustfmt_toml, &node_template_rustfmt_toml_path)
.expect("Copying rustfmt.toml.");
Expand Down
Loading

0 comments on commit 6df51c3

Please sign in to comment.