Switch to compressed runtimes (#4061)

* Remove the upload of the non compressed runtimes

* Fix template

* Add loggin for local testing

* Keep simple logger but remove the need for another dependency
This commit is contained in:
Chevdor
2021-10-13 15:31:47 +02:00
committed by GitHub
parent 769595eea5
commit 109d10dd32
3 changed files with 33 additions and 14 deletions
@@ -9,8 +9,34 @@ require 'octokit'
require 'toml'
require_relative './lib.rb'
# A logger only active when NOT running in CI
def logger(s)
puts "▶ DEBUG: %s" % [s] if ENV['CI'] != 'true'
end
# Check if all the required ENV are set
# This is especially convenient when testing locally
def check_env()
if ENV['CI'] != 'true' then
logger("Running locally")
vars = ['GITHUB_REF', 'GITHUB_TOKEN', 'GITHUB_WORKSPACE', 'GITHUB_REPOSITORY', 'RUSTC_STABLE', 'RUSTC_NIGHTLY']
vars.each { |x|
env = (ENV[x] || "")
if env.length > 0 then
logger("- %s:\tset: %s, len: %d" % [x, env.length > 0 || false, env.length])
else
logger("- %s:\tset: %s, len: %d" % [x, env.length > 0 || false, env.length])
end
}
end
end
check_env()
current_ref = ENV['GITHUB_REF']
token = ENV['GITHUB_TOKEN']
logger("Connecting to Github")
github_client = Octokit::Client.new(
access_token: token
)
@@ -19,13 +45,15 @@ polkadot_path = ENV['GITHUB_WORKSPACE'] + '/polkadot/'
# Generate an ERB renderer based on the template .erb file
renderer = ERB.new(
File.read(ENV['GITHUB_WORKSPACE'] + '/polkadot/scripts/github/polkadot_release.erb'),
File.read(File.join(polkadot_path, 'scripts/github/polkadot_release.erb')),
trim_mode: '<>'
)
# get ref of last polkadot release
last_ref = 'refs/tags/' + github_client.latest_release(ENV['GITHUB_REPOSITORY']).tag_name
logger("Last ref: " + last_ref)
logger("Generate changelog for Polkadot")
polkadot_cl = Changelog.new(
'paritytech/polkadot', last_ref, current_ref, token: token
)
@@ -47,6 +75,7 @@ end
substrate_prev_sha = get_substrate_commit(github_client, last_ref)
substrate_cur_sha = get_substrate_commit(github_client, current_ref)
logger("Generate changelog for Substrate")
substrate_cl = Changelog.new(
'paritytech/substrate', substrate_prev_sha, substrate_cur_sha,
token: token,
+3 -3
View File
@@ -11,11 +11,11 @@ This release was tested against the following versions of `rustc`. Other version
- <%= rustc_stable %>
- <%= rustc_nightly %>
WASM runtimes built with [srtool](https://github.com/paritytech/srtool) using `<%= polkadot_json['rustc'] %>`.
WASM runtimes built with [<%= polkadot_json['info']['generator']['name'] %> v<%= polkadot_json['info']['generator']['version'] %>](https://github.com/paritytech/srtool) using `<%= polkadot_json['rustc'] %>`.
Proposal hashes:
* `polkadot_runtime-v<%= polkadot_runtime %>.compact.wasm - <%= polkadot_json['prop'] %>`
* `kusama_runtime-v<%= kusama_runtime %>.compact.wasm - <%= kusama_json['prop'] %>`
* `polkadot_runtime-v<%= polkadot_runtime %>.compact.compressed.wasm`: `<%= polkadot_json['runtimes']['compressed']['prop'] %>`
* `kusama_runtime-v<%= kusama_runtime %>.compact.compressed.wasm`: `<%= kusama_json['runtimes']['compressed']['prop'] %>`
<% unless misc_changes.empty? %>
## Changes