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

Commit

Permalink
attempt to name runtimes according to version
Browse files Browse the repository at this point in the history
  • Loading branch information
s3krit committed Jul 30, 2020
1 parent 1f5ec29 commit 82f7b4d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/publish-draft-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@ jobs:
runs-on: ubuntu-latest
needs: get-rust-versions
outputs:
release_id: ${{ steps.create-release.outputs.id }}
release_url: ${{ steps.create-release.outputs.html_url }}
asset_upload_url: ${{ steps.create-release.outputs.upload_url }}
polkadot_runtime_version: ${{ steps.generate-release-text.polkadot_runtime }}
kusama_runtime_version: ${{ steps.generate-release-text.kusama_runtime }}
westend_runtime_version: ${{ steps.generate-release-text.westend_runtime }}
steps:
- uses: actions/checkout@v2
with:
Expand All @@ -35,12 +39,13 @@ jobs:
with:
ruby-version: 2.7
- name: Generate release text
id: generate-release-text
env:
RUSTC_STABLE: ${{ needs.get-rust-versions.outputs.rustc-stable }}
RUSTC_NIGHTLY: ${{ needs.get-rust-versions.outputs.rustc-nightly }}
run: |
gem install changelogerator git toml
ruby $GITHUB_WORKSPACE/polkadot/scripts/github/generate_release_text.rb > release_text.md
ruby $GITHUB_WORKSPACE/polkadot/scripts/github/generate_release_text.rb
- uses: actions/upload-artifact@v2
with:
name: release_text
Expand Down Expand Up @@ -121,12 +126,15 @@ jobs:
- uses: actions/download-artifact@v2
with:
name: ${{ matrix.runtime }}-runtime
- name: Rename asset according to runtime version
run: |
mv ./${{ matrix.runtime }}_runtime.compact-wasm ./${{ matrix.runtime }}-${{ needs.publish-draft-release.outputs.${{ matrix.runtime }}_runtime_version }}_runtime.compact.wasm
- name: Upload ${{ 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.compact.wasm
asset_path: ./${{ matrix.runtime }}-${{ needs.publish-draft-release.outputs.${{ matrix.runtime }}_runtime_version}}_runtime.compact.wasm
asset_name: ${{ matrix.runtime }} runtime
asset_content_type: application/wasm
6 changes: 6 additions & 0 deletions scripts/github/generate_release_text.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,17 @@
polkadot_runtime = File.open(polkadot_path + '/runtime/polkadot/src/lib.rs') do |f|
f.find { |l| l =~ /spec_version/ }.match(/[0-9]+/)[0]
end
puts "::set-output name=polkadot_runtime::#{polkadot_runtime}"
kusama_runtime = File.open(polkadot_path + '/runtime/kusama/src/lib.rs') do |f|
f.find { |l| l =~ /spec_version/ }.match(/[0-9]+/)[0]
end
puts "::set-output name=kusama_runtime::#{kusama_runtime}"
westend_runtime = File.open(polkadot_path + '/runtime/westend/src/lib.rs') do |f|
f.find { |l| l =~ /spec_version/ }.match(/[0-9]+/)[0]
end
puts "::set-output name=westend_runtime::#{westend_runtime}"

puts '========'
puts renderer.result

File.open('release_text.md', 'w') { |f| f.write(renderer.result) }

0 comments on commit 82f7b4d

Please sign in to comment.