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

Switch to compressed runtimes #4061

Merged
4 commits merged into from
Oct 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions .github/workflows/publish-draft-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ jobs:
with:
name: ${{ matrix.runtime }}-runtime
path: |
${{ steps.srtool_build.outputs.wasm }}
${{ steps.srtool_build.outputs.wasm_compressed }}

publish-draft-release:
Expand Down Expand Up @@ -114,15 +113,6 @@ jobs:
ls "${{ matrix.runtime }}-runtime"
runtime_ver="$(ruby -e 'require "./scripts/github/lib.rb"; puts get_runtime("${{ matrix.runtime }}")')"
echo "::set-output name=runtime_ver::$runtime_ver"
- name: Upload compact ${{ matrix.runtime }} wasm
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.publish-draft-release.outputs.asset_upload_url }}
asset_path: "${{ matrix.runtime }}-runtime/${{ matrix.runtime }}_runtime.compact.wasm"
asset_name: ${{ matrix.runtime }}_runtime-v${{ steps.get-runtime-ver.outputs.runtime_ver }}.compact.wasm
asset_content_type: application/wasm
- name: Upload compressed ${{ matrix.runtime }} wasm
uses: actions/upload-release-asset@v1
env:
Expand Down
31 changes: 30 additions & 1 deletion scripts/github/generate_release_text.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,34 @@
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
)
Expand All @@ -19,13 +45,15 @@

# 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
)
Expand All @@ -47,6 +75,7 @@ def get_substrate_commit(client, ref)
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,
Expand Down
6 changes: 3 additions & 3 deletions scripts/github/polkadot_release.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down