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

Commit ae5b7a3

Browse files
committed
Merge branch 'master' of github.com:paritytech/polkadot into seun-sc-cli-subkey
2 parents 5ee5bd8 + 013c4a8 commit ae5b7a3

File tree

305 files changed

+36018
-15253
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

305 files changed

+36018
-15253
lines changed

.editorconfig

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,26 @@
11
root = true
2-
[*]
2+
3+
[*.rs]
34
indent_style=tab
45
indent_size=tab
56
tab_width=4
7+
max_line_length=120
68
end_of_line=lf
79
charset=utf-8
810
trim_trailing_whitespace=true
9-
max_line_length=120
1011
insert_final_newline=true
1112

1213
[*.yml]
1314
indent_style=space
1415
indent_size=2
1516
tab_width=8
1617
end_of_line=lf
18+
charset=utf-8
19+
trim_trailing_whitespace=true
20+
insert_final_newline=true
21+
22+
[*.sh]
23+
indent_style=space
24+
indent_size=2
25+
tab_width=8
26+
end_of_line=lf
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Notify devops when burn-in label applied
2+
on:
3+
pull_request:
4+
types: [labeled]
5+
6+
jobs:
7+
notify-devops:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Notify devops
11+
if: github.event.label.name == 'A1-needsburnin'
12+
uses: s3krit/[email protected]
13+
with:
14+
room_id: ${{ secrets.POLKADOT_DEVOPS_MATRIX_ROOM_ID }}
15+
access_token: ${{ secrets.POLKADOT_DEVOPS_MATRIX_ACCESS_TOKEN }}
16+
message: "@room Burn-in request received for the following PR: ${{ github.event.pull_request.html_url }}"
17+
server: "matrix.parity.io"
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
name: Publish draft release
2+
3+
on:
4+
push:
5+
tags:
6+
- v**.**.**
7+
8+
jobs:
9+
build-runtimes:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
runtime: ['polkadot', 'kusama']
14+
container:
15+
image: chevdor/srtool:nightly-2020-07-20
16+
volumes:
17+
- ${{ github.workspace }}:/build
18+
env:
19+
PACKAGE: ${{ matrix.runtime }}-runtime
20+
RUSTC_VERSION: nightly-2020-07-20
21+
steps:
22+
- uses: actions/checkout@v2
23+
- name: Cache target dir
24+
uses: actions/cache@v2
25+
with:
26+
path: '${{ github.workspace }}/target'
27+
key: srtool-target-${{ matrix.runtime }}-${{ github.sha }}
28+
restore-keys: |
29+
srtool-target-${{ matrix.runtime }}-
30+
srtool-target-
31+
- name: Build ${{ matrix.runtime }} runtime
32+
id: build-runtime
33+
shell: bash
34+
run: |
35+
cd /build
36+
pwd
37+
ls -la
38+
build --json | tee srtool_output.json
39+
cat srtool_output.json
40+
while IFS= read -r line; do
41+
echo "::set-output name=$line::$(jq -r ".$line" < srtool_output.json)"
42+
done <<< "$(jq -r 'keys[]' < srtool_output.json)"
43+
- name: Upload ${{ matrix.runtime }} srtool json
44+
uses: actions/upload-artifact@v2
45+
with:
46+
name: ${{ matrix.runtime }}-srtool-json
47+
path: srtool_output.json
48+
- name: Upload ${{ matrix.runtime }} runtime
49+
uses: actions/upload-artifact@v2
50+
with:
51+
name: ${{ matrix.runtime }}-runtime
52+
path: "${{ steps.build-runtime.outputs.wasm }}"
53+
54+
get-rust-versions:
55+
runs-on: ubuntu-latest
56+
container:
57+
image: paritytech/ci-linux:production
58+
outputs:
59+
rustc-stable: ${{ steps.get-rust-versions.outputs.stable }}
60+
rustc-nightly: ${{ steps.get-rust-versions.outputs.nightly }}
61+
steps:
62+
- id: get-rust-versions
63+
run: |
64+
echo "::set-output name=stable::$(rustc +stable --version)"
65+
echo "::set-output name=nightly::$(rustc +nightly --version)"
66+
67+
publish-draft-release:
68+
runs-on: ubuntu-latest
69+
needs: ['get-rust-versions', 'build-runtimes']
70+
outputs:
71+
release_url: ${{ steps.create-release.outputs.html_url }}
72+
asset_upload_url: ${{ steps.create-release.outputs.upload_url }}
73+
steps:
74+
- uses: actions/checkout@v2
75+
with:
76+
fetch-depth: 0
77+
path: polkadot
78+
- name: Set up Ruby 2.7
79+
uses: actions/setup-ruby@v1
80+
with:
81+
ruby-version: 2.7
82+
- name: Download srtool json output
83+
uses: actions/download-artifact@v2
84+
- name: Generate release text
85+
env:
86+
RUSTC_STABLE: ${{ needs.get-rust-versions.outputs.rustc-stable }}
87+
RUSTC_NIGHTLY: ${{ needs.get-rust-versions.outputs.rustc-nightly }}
88+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
89+
run: |
90+
gem install changelogerator git toml
91+
ruby $GITHUB_WORKSPACE/polkadot/scripts/github/generate_release_text.rb | tee release_text.md
92+
- name: Create draft release
93+
id: create-release
94+
uses: actions/create-release@v1
95+
env:
96+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
97+
with:
98+
tag_name: ${{ github.ref }}
99+
release_name: Polkadot ${{ github.ref }}
100+
body_path: ./release_text.md
101+
draft: true
102+
103+
post_to_matrix:
104+
runs-on: ubuntu-latest
105+
needs: publish-draft-release
106+
steps:
107+
- name: Internal polkadot channel
108+
uses: s3krit/[email protected]
109+
with:
110+
room_id: ${{ secrets.INTERNAL_POLKADOT_MATRIX_ROOM_ID }}
111+
access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }}
112+
message: "**New version of polkadot tagged**: ${{ github.ref }}<br/>Gav: Draft release created: ${{ needs.publish-draft-release.outputs.release_url }}"
113+
server: "matrix.parity.io"
114+
115+
publish-runtimes:
116+
runs-on: ubuntu-latest
117+
needs: ['publish-draft-release']
118+
strategy:
119+
matrix:
120+
runtime: ['polkadot', 'kusama']
121+
steps:
122+
- uses: actions/checkout@v2
123+
- uses: actions/download-artifact@v2
124+
with:
125+
name: ${{ matrix.runtime }}-runtime
126+
- name: Set up Ruby 2.7
127+
uses: actions/setup-ruby@v1
128+
with:
129+
ruby-version: 2.7
130+
- name: Get runtime version
131+
id: get-runtime-ver
132+
run: |
133+
runtime_ver="$(ruby -e 'require "./scripts/github/lib.rb"; puts get_runtime("${{ matrix.runtime }}")')"
134+
echo "::set-output name=runtime_ver::$runtime_ver"
135+
- name: Upload ${{ matrix.runtime }} wasm
136+
uses: actions/upload-release-asset@v1
137+
env:
138+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
139+
with:
140+
upload_url: ${{ needs.publish-draft-release.outputs.asset_upload_url }}
141+
asset_path: ./${{ matrix.runtime }}_runtime.compact.wasm
142+
asset_name: ${{ matrix.runtime }}_runtime-v${{ steps.get-runtime-ver.outputs.runtime_ver }}.compact.wasm
143+
asset_content_type: application/wasm

.gitlab-ci.yml

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -94,16 +94,12 @@ check-line-width:
9494
interruptible: true
9595
allow_failure: true
9696

97-
publish-draft-release:
97+
test-deterministic-wasm:
9898
stage: test
99-
only:
100-
- tags
101-
- /^v[0-9]+\.[0-9]+\.[0-9]+.*$/ # i.e. v1.0.1, v2.1.0rc1
99+
<<: *docker-env
100+
except:
102101
script:
103-
- apt-get -y update; apt-get -y install jq
104-
- ./scripts/gitlab/publish_draft_release.sh
105-
interruptible: true
106-
allow_failure: true
102+
- ./scripts/gitlab/test_deterministic_wasm.sh
107103

108104
test-linux-stable: &test
109105
stage: test
@@ -117,7 +113,7 @@ test-linux-stable: &test
117113
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
118114
TARGET: native
119115
script:
120-
- time cargo test --all --release --verbose --locked --features runtime-benchmarks
116+
- ./scripts/gitlab/test_linux_stable.sh
121117
- sccache -s
122118

123119
check-web-wasm: &test
@@ -128,14 +124,7 @@ check-web-wasm: &test
128124
script:
129125
# WASM support is in progress. As more and more crates support WASM, we
130126
# should add entries here. See https://github.com/paritytech/polkadot/issues/625
131-
- time cargo build --locked --target=wasm32-unknown-unknown --manifest-path runtime/polkadot/Cargo.toml
132-
- time cargo build --locked --target=wasm32-unknown-unknown --manifest-path runtime/kusama/Cargo.toml
133-
- time cargo build --locked --target=wasm32-unknown-unknown --manifest-path erasure-coding/Cargo.toml
134-
- time cargo build --locked --target=wasm32-unknown-unknown --manifest-path parachain/Cargo.toml
135-
- time cargo build --locked --target=wasm32-unknown-unknown --manifest-path primitives/Cargo.toml
136-
- time cargo build --locked --target=wasm32-unknown-unknown --manifest-path rpc/Cargo.toml
137-
- time cargo build --locked --target=wasm32-unknown-unknown --manifest-path statement-table/Cargo.toml
138-
- time cargo build --locked --target=wasm32-unknown-unknown --manifest-path cli/Cargo.toml --no-default-features --features browser
127+
- ./scripts/gitlab/check_web_wasm.sh
139128
- sccache -s
140129

141130
check-runtime-benchmarks: &test
@@ -145,7 +134,7 @@ check-runtime-benchmarks: &test
145134
<<: *compiler_info
146135
script:
147136
# Check that the node will compile with `runtime-benchmarks` feature flag.
148-
- time cargo check --features runtime-benchmarks
137+
- ./scripts/gitlab/check_runtime_benchmarks.sh
149138
- sccache -s
150139

151140
build-wasm-release:
@@ -195,7 +184,7 @@ generate-impl-guide:
195184
name: michaelfbryan/mdbook-docker-image:latest
196185
entrypoint: [""]
197186
script:
198-
- mdbook build roadmap/implementors-guide
187+
- mdbook build roadmap/implementers-guide
199188

200189
.publish-build: &publish-build
201190
stage: publish
@@ -253,8 +242,8 @@ publish-s3-release:
253242
- echo "uploading objects to https://${BUCKET}/${PREFIX}/${VERSION}"
254243
- aws s3 sync ./artifacts/ s3://${BUCKET}/${PREFIX}/${VERSION}/
255244
- echo "update objects at https://${BUCKET}/${PREFIX}/${EXTRATAG}"
256-
- for file in ./artifacts/*; do
257-
name="$(basename ${file})";
245+
- find ./artifacts -type f | while read file; do
246+
name="${file#./artifacts/}";
258247
aws s3api copy-object
259248
--copy-source ${BUCKET}/${PREFIX}/${VERSION}/${name}
260249
--bucket ${BUCKET} --key ${PREFIX}/${EXTRATAG}/${name};

0 commit comments

Comments
 (0)