mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-30 22:27:56 +00:00
[CI] Build wasm blob with srtool and include prop hashes and blobs in release notes (#1506)
* initial build-wasms commit * fix wasm builds * add caching and artifact upload * test for git dir * Revert "test for git dir" This reverts commit 295e4655484691aed9162f479a87f09c1b1c9317. * fix git version incompability * attempt to fix caching * Revert "fix git version incompability" This reverts commit 1d22ffd26b7eff635c5abcc9bd04cb3c88629a1d. * add kusama job * use a build matrix for building runtimes * combine build-wasms and publish draft release * attempt to name runtimes according to version * Revert "attempt to name runtimes according to version" This reverts commit 82f7b4dc0aea995f2599293bba9f11b879f459e5. Failed experiment * name runtimes according to version #2 * fix asset path and name * build wasms first, include prop hash
This commit is contained in:
@@ -4,6 +4,8 @@ require 'changelogerator'
|
||||
require 'git'
|
||||
require 'erb'
|
||||
require 'toml'
|
||||
require 'json'
|
||||
require_relative './lib.rb'
|
||||
|
||||
version = ENV['GITHUB_REF']
|
||||
token = ENV['GITHUB_TOKEN']
|
||||
@@ -61,14 +63,23 @@ release_priority = Changelog.highest_priority_for_changes(all_changes)
|
||||
rustc_stable = ENV['RUSTC_STABLE']
|
||||
rustc_nightly = ENV['RUSTC_NIGHTLY']
|
||||
|
||||
polkadot_runtime = File.open(polkadot_path + '/runtime/polkadot/src/lib.rs') do |f|
|
||||
f.find { |l| l =~ /spec_version/ }.match(/[0-9]+/)[0]
|
||||
end
|
||||
kusama_runtime = File.open(polkadot_path + '/runtime/kusama/src/lib.rs') do |f|
|
||||
f.find { |l| l =~ /spec_version/ }.match(/[0-9]+/)[0]
|
||||
end
|
||||
westend_runtime = File.open(polkadot_path + '/runtime/westend/src/lib.rs') do |f|
|
||||
f.find { |l| l =~ /spec_version/ }.match(/[0-9]+/)[0]
|
||||
end
|
||||
polkadot_runtime = get_runtime('polkadot', polkadot_path)
|
||||
kusama_runtime = get_runtime('kusama', polkadot_path)
|
||||
westend_runtime = get_runtime('westend', polkadot_path)
|
||||
|
||||
# These json files should have been downloaded as part of the build-runtimes
|
||||
# github action
|
||||
|
||||
polkadot_json = JSON.parse(
|
||||
File.read(
|
||||
ENV['GITHUB_WORKSPACE'] + '/polkadot-srtool-json/srtool_output.json'
|
||||
)
|
||||
)
|
||||
|
||||
kusama_json = JSON.parse(
|
||||
File.read(
|
||||
ENV['GITHUB_WORKSPACE'] + '/kusama-srtool-json/srtool_output.json'
|
||||
)
|
||||
)
|
||||
|
||||
puts renderer.result
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# A collection of helper functions that might be useful for various scripts
|
||||
|
||||
# Gets the runtime version for a given runtime.
|
||||
# Optionally accepts a path that is the root of the project which defaults to
|
||||
# the current working directory
|
||||
def get_runtime(runtime, path = '.')
|
||||
File.open(path + "/runtime/#{runtime}/src/lib.rs") do |f|
|
||||
f.find { |l| l =~ /spec_version/ }.match(/[0-9]+/)[0]
|
||||
end
|
||||
end
|
||||
@@ -11,6 +11,12 @@ This release was tested against the following versions of `rustc`. Other version
|
||||
- <%= rustc_stable %>
|
||||
- <%= rustc_nightly %>
|
||||
|
||||
WASM runtimes built with [srtool](https://gitlab.com/chevdor/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'] %>`
|
||||
|
||||
<% unless misc_changes.empty? %>
|
||||
## Changes
|
||||
|
||||
|
||||
Reference in New Issue
Block a user