mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 11:07:56 +00:00
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:
@@ -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:
|
||||
@@ -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:
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user