Skip to content

Commit

Permalink
Merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
sudipghimire533 committed Mar 28, 2023
2 parents 6e2f875 + 9a84c28 commit ca39ade
Show file tree
Hide file tree
Showing 44 changed files with 13,102 additions and 10,050 deletions.
109 changes: 95 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,36 +18,47 @@ jobs:
- name: Add wasm toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2021-12-15
toolchain: nightly-2022-08-10
target: wasm32-unknown-unknown
override: true

- name: Initialize environment and build
- name: Build and zip
run: |
rustup update stable
rustup toolchain install nightly-2021-12-15
rustup default nightly-2021-12-15
rustup target add wasm32-unknown-unknown --toolchain nightly-2021-12-15
rustup override set nightly-2021-12-15
cargo build --release
cp ./target/release/datahighway-collator .
gzip datahighway-collator
- name: get version
run: echo "::set-output name=version::$(./target/release/datahighway-collator --version)"
id: version

- name: create release
uses: actions/create-release@v1
id: create_release
with:
draft: false
prerelease: false
release_name: ${{ steps.version.outputs.version }}
release_name: Datahighway-${{ github.ref }}
tag_name: ${{ github.ref }}
body_path: CHANGELOG.md
env:
GITHUB_TOKEN: ${{ github.token }}

- name: generate raw kusama chainspec
run: |
./target/release/datahighway-collator build-spec --chain kusama --disable-default-bootnode > plain-parachain-chainspec.json
./target/release/datahighway-collator build-spec --chain plain-parachain-chainspec.json --disable-default-bootnode --raw > kusama-parachain-raw.json
- name: generate raw rococo chainspec
run: ./target/release/datahighway-collator build-spec --chain rococo --disable-default-bootnode > rococo-parachain-chainspec.json

- name: fetch kusama chainspec
run: wget https://github.com/DataHighway-DHX/DataHighway-Parachain/releases/download/v3.7.1/kusama.json

- name: fetch rococo chainspec
run: wget https://raw.githubusercontent.com/DataHighway-DHX/DataHighway-Parachain/2c7ee5ddffffee8a7f8867694e791647e38a8fa1/res/rococo/rococo.json

- name: fetch tanganika chainspec
run: wget https://raw.githubusercontent.com/DataHighway-DHX/DataHighway-Parachain/v3.6.0/res/kusama/kusama-parachain-raw.json -O ./tanganika-parachain-raw.json

- name: fetch spreehafen chainspec
run: wget https://raw.githubusercontent.com/DataHighway-DHX/DataHighway-Parachain/2c7ee5ddffffee8a7f8867694e791647e38a8fa1/res/rococo/rococo-parachain-raw.json -O ./spreehafen-parachain-raw.json

- name: upload linux artifact
uses: actions/upload-release-asset@v1
Expand All @@ -56,5 +67,75 @@ jobs:
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: datahighway-collator.gz
asset_name: datahighway-collator-amd64.gz
asset_content_type: application/gzip
asset_name: datahighway-collator.gz
asset_content_type: application/gzip

- name: upload compressed runtime wasm
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./target/release/wbuild/datahighway-parachain-runtime/datahighway_parachain_runtime.compact.compressed.wasm
asset_name: datahighway_parachain_runtime.compact.compressed.wasm
asset_content_type: application/octet-stream

- name: upload kusama relay chainspec
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./kusama.json
asset_name: kusama.json
asset_content_type: application/json

- name: upload rococo relay chainspec
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./rococo.json
asset_name: rococo.json
asset_content_type: application/json

- name: upload kusama parachain spec
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./kusama-parachain-raw.json
asset_name: kusama-parachain-raw.json
asset_content_type: application/json

- name: upload parachain spec (v3.6.0)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./tanganika-parachain-raw.json
asset_name: tanganika-parachain-raw.json
asset_content_type: application/json

- name: upload rococo parachain spec
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./rococo-parachain-chainspec.json
asset_name: rococo-parachain-chainspec.json
asset_content_type: application/json

- name: upload spreehafen spec
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./spreehafen-parachain-raw.json
asset_name: spreehafen-parachain-raw.json
asset_content_type: application/json
36 changes: 18 additions & 18 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ jobs:
- name: Initialize WASM build environment
run: |
rustup update stable
rustup toolchain install nightly-2021-12-15
rustup default nightly-2021-12-15
rustup target add wasm32-unknown-unknown --toolchain nightly-2021-12-15
rustup toolchain install nightly-2022-08-10
rustup default nightly-2022-08-10
rustup target add wasm32-unknown-unknown --toolchain nightly-2022-08-10
- name: Run cargo check
run: cargo +nightly-2021-12-15 check
run: cargo +nightly-2022-08-10 check

test:
name: Test Suite
Expand All @@ -56,16 +56,16 @@ jobs:
- name: Initialize WASM build environment
run: |
rustup update stable
rustup toolchain install nightly-2021-12-15
rustup default nightly-2021-12-15
rustup target add wasm32-unknown-unknown --toolchain nightly-2021-12-15
rustup toolchain install nightly-2022-08-10
rustup default nightly-2022-08-10
rustup target add wasm32-unknown-unknown --toolchain nightly-2022-08-10
# Runs integration tests in the runtime/tests folder
# To run tests in a specific package run
# `cargo +nightly-2021-12-15 test -p <package name> (i.e. datahighway-runtime)
# `cargo +nightly-2022-08-10 test -p <package name> (i.e. datahighway-runtime)
- name: Run All Tests
run: |
cargo +nightly-2021-12-15 test
cargo +nightly-2022-08-10 test
lints:
name: Lints
Expand All @@ -90,19 +90,19 @@ jobs:
override: true
components: rustfmt, clippy

# nightly-2021-12-15-x86_64-unknown-linux-gnu
# nightly-2022-08-10-x86_64-unknown-linux-gnu
- name: Initialize WASM build environment
run: |
rustup update stable
rustup toolchain install nightly-2021-12-15
rustup default nightly-2021-12-15
rustup target add wasm32-unknown-unknown --toolchain nightly-2021-12-15
rustup toolchain install nightly-2022-08-10
rustup default nightly-2022-08-10
rustup target add wasm32-unknown-unknown --toolchain nightly-2022-08-10
# Ignore use of Rust Linting since rearranging makes it challenging to update to latest Substrate
# - name: Run cargo fmt
# run: |
# rustup component add rustfmt --toolchain nightly-2021-12-15-x86_64-unknown-linux-gnu
# cargo +nightly-2021-12-15 fmt --all -- --check
# rustup component add rustfmt --toolchain nightly-2022-08-10-x86_64-unknown-linux-gnu
# cargo +nightly-2022-08-10 fmt --all -- --check

# Ignore use of Clippy until a clippy.toml file may be used. See README.md
# - name: Run cargo clippy
Expand All @@ -112,6 +112,6 @@ jobs:
# # args: --release -- -D warnings
# # FIXME - temporary fix below. See https://github.com/rust-lang/rust-clippy/issues/5094#issuecomment-579116431
# run: |
# rustup component add clippy --toolchain nightly-2021-12-15-x86_64-unknown-linux-gnu
# rustup component add clippy-preview --toolchain nightly-2021-12-15-x86_64-unknown-linux-gnu
# cargo +nightly-2021-12-15 clippy-preview -Zunstable-options
# rustup component add clippy --toolchain nightly-2022-08-10-x86_64-unknown-linux-gnu
# rustup component add clippy-preview --toolchain nightly-2022-08-10-x86_64-unknown-linux-gnu
# cargo +nightly-2022-08-10 clippy-preview -Zunstable-options
97 changes: 97 additions & 0 deletions .maintain/pallet_weight.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
//! Autogenerated weights for {{pallet}}
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION {{version}}
//! DATE: {{date}}, STEPS: `{{cmd.steps}}`, REPEAT: {{cmd.repeat}}, LOW RANGE: `{{cmd.lowest_range_values}}`, HIGH RANGE: `{{cmd.highest_range_values}}`
//! HOSTNAME: `{{hostname}}`, CPU: `{{cpuname}}`
//! EXECUTION: {{cmd.execution}}, WASM-EXECUTION: {{cmd.wasm_execution}}, CHAIN: {{cmd.chain}}, DB CACHE: {{cmd.db_cache}}

// Executed Command:
{{#each args as |arg|}}
// {{arg}}
{{/each}}

#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]

use frame_support::{traits::Get, weights::{constants::RocksDbWeight, Weight}};
use sp_std::marker::PhantomData;

/// Weight functions needed for {{pallet}}.
pub trait WeightInfo {
{{#each benchmarks as |benchmark|}}
fn {{benchmark.name~}}({{~#each benchmark.components as |c| ~}}{{c.name}}: u32, {{/each}}) -> Weight;
{{/each}}
}

/// Weight functions for `{{pallet}}`.
pub struct SubstrateWeight<T>(PhantomData<T>);
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
{{#each benchmarks as |benchmark|}}
{{#each benchmark.comments as |comment|}}
// {{comment}}
{{/each}}
{{#each benchmark.component_ranges as |range|}}
/// The range of component `{{range.name}}` is `[{{range.min}}, {{range.max}}]`.
{{/each}}
fn {{benchmark.name~}}
(
{{~#each benchmark.components as |c| ~}}
{{~#if (not c.is_used)}}_{{/if}}{{c.name}}: u32, {{/each~}}
) -> Weight {
// Minimum execution time: {{underscore benchmark.min_execution_time}} nanoseconds.
Weight::from_ref_time({{underscore benchmark.base_weight}}_u64)
{{#each benchmark.component_weight as |cw|}}
// Standard Error: {{underscore cw.error}}
.saturating_add(Weight::from_ref_time({{underscore cw.slope}}_u64).saturating_mul({{cw.name}} as u64))
{{/each}}
{{#if (ne benchmark.base_reads "0")}}
.saturating_add(T::DbWeight::get().reads({{benchmark.base_reads}}_u64))
{{/if}}
{{#each benchmark.component_reads as |cr|}}
.saturating_add(T::DbWeight::get().reads(({{cr.slope}}_u64).saturating_mul({{cr.name}} as u64)))
{{/each}}
{{#if (ne benchmark.base_writes "0")}}
.saturating_add(T::DbWeight::get().writes({{benchmark.base_writes}}_u64))
{{/if}}
{{#each benchmark.component_writes as |cw|}}
.saturating_add(T::DbWeight::get().writes(({{cw.slope}}_u64).saturating_mul({{cw.name}} as u64)))
{{/each}}
}
{{/each}}
}

impl WeightInfo for () {
{{#each benchmarks as |benchmark|}}
{{#each benchmark.comments as |comment|}}
// {{comment}}
{{/each}}
{{#each benchmark.component_ranges as |range|}}
/// The range of component `{{range.name}}` is `[{{range.min}}, {{range.max}}]`.
{{/each}}
fn {{benchmark.name~}}
(
{{~#each benchmark.components as |c| ~}}
{{~#if (not c.is_used)}}_{{/if}}{{c.name}}: u32, {{/each~}}
) -> Weight {
// Minimum execution time: {{underscore benchmark.min_execution_time}} nanoseconds.
Weight::from_ref_time({{underscore benchmark.base_weight}}_u64)
{{#each benchmark.component_weight as |cw|}}
// Standard Error: {{underscore cw.error}}
.saturating_add(Weight::from_ref_time({{underscore cw.slope}}_u64).saturating_mul({{cw.name}} as u64))
{{/each}}
{{#if (ne benchmark.base_reads "0")}}
.saturating_add(RocksDbWeight::get().reads({{benchmark.base_reads}}_u64))
{{/if}}
{{#each benchmark.component_reads as |cr|}}
.saturating_add(RocksDbWeight::get().reads(({{cr.slope}}_u64).saturating_mul({{cr.name}} as u64)))
{{/each}}
{{#if (ne benchmark.base_writes "0")}}
.saturating_add(RocksDbWeight::get().writes({{benchmark.base_writes}}_u64))
{{/if}}
{{#each benchmark.component_writes as |cw|}}
.saturating_add(RocksDbWeight::get().writes(({{cw.slope}}_u64).saturating_mul({{cw.name}} as u64)))
{{/each}}
}
{{/each}}
}
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Version 3.6.1
Version 3.7.1

Automation
- update the release job to create a release and upload the linux artifact to it
What's changed?
- Automate release creation and assets upload

Loading

0 comments on commit ca39ade

Please sign in to comment.