Skip to content

Commit

Permalink
release note action (#1483)
Browse files Browse the repository at this point in the history
* init release note action

* run-on ubunut

* default env

* disable inputs

* fix action link

* update action

* update template

* create issue

* remove assignees

* archive files

* update the way output is handled

* update run cmd

* write file action

* disable pinata

* fix version

* enable pinata

* update actions version

* fix argument

* test subwasm info

* fix run node

* change order

* change order

* build step

* template support env

* wasm_diff

* update action

* disable issue for testing

* run on self-host

* Revert "run on self-host"
This reverts commit 460699e.

* disable not allowed actions

* save release note

* enable issue action

* update versions

* move acala run into subwasm step
  • Loading branch information
ermalkaleci authored Oct 27, 2021
1 parent 6672266 commit 4541887
Showing 1 changed file with 127 additions and 0 deletions.
127 changes: 127 additions & 0 deletions .github/workflows/release-notes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
name: Release Notes

env:
SUBWASM_VERSION: 0.14.1
SRTOOL_TAG: 1.53.0

on:
workflow_dispatch:
inputs:
chain:
description: Network [mandala | karura | acala]
default: karura
required: true
scope:
description: Release scope [client | runtime | full]
default: full
required: true

jobs:
release-notes:
name: Crate release note
runs-on: [self-hosted, linux]
env:
CHAIN: ${{ github.event.inputs.chain }}
SCOPE: ${{ github.event.inputs.scope }}
steps:
- uses: actions/checkout@v2
with:
submodules: recursive

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-2021-06-17
components: rustfmt
target: wasm32-unknown-unknown
default: true

- name: Build node
run: cargo build --release --features=with-${{ env.CHAIN }}-runtime --features=rococo-native

# We now get extra information thanks to subwasm,
- name: Install subwasm ${{ env.SUBWASM_VERSION }}
run: |
wget https://github.com/chevdor/subwasm/releases/download/v${{ env.SUBWASM_VERSION }}/subwasm_linux_amd64_v${{ env.SUBWASM_VERSION }}.deb
sudo dpkg -i subwasm_linux_amd64_v${{ env.SUBWASM_VERSION }}.deb
subwasm --version
- name: Subwasm info
run: |
./target/release/acala --chain=${{ env.CHAIN }}-dev --rpc-cors=all --ws-external &
sleep 30
subwasm info ws://localhost:9944 > ${{ env.CHAIN }}-subwam-info.txt
pkill acala
- name: Srtool build
id: srtool_build
uses: chevdor/[email protected]
with:
chain: ${{ env.CHAIN }}
tag: ${{ github.event.inputs.srtool_tag || env.SRTOOL_TAG }}

- name: Summary
run: |
echo '${{ steps.srtool_build.outputs.json }}' | jq > ${{ env.CHAIN }}-srtool-digest.json
cat ${{ env.CHAIN }}-srtool-digest.json
echo "Runtime location: ${{ steps.srtool_build.outputs.wasm }}"
- name: Extract the metadata
run: |
subwasm meta ${{ steps.srtool_build.outputs.wasm }}
subwasm --json meta ${{ steps.srtool_build.outputs.wasm }} > ${{ env.CHAIN }}-metadata.json
- name: Check the metadata diff
run: |
subwasm get wss://karura-rpc-2.aca-api.network/ws --output runtime_mainnet.wasm
subwasm diff ${{ steps.srtool_build.outputs.wasm }} runtime_mainnet.wasm | tee ${{ env.CHAIN }}-diff.txt
- name: Archive Artifacts for ${{ env.CHAIN }}
uses: actions/upload-artifact@v2
with:
name: ${{ env.CHAIN }}-runtime
path: |
${{ steps.srtool_build.outputs.wasm }}
${{ steps.srtool_build.outputs.wasm_compressed }}
${{ env.CHAIN }}-srtool-digest.json
- name: Archive Subwasm results
uses: actions/upload-artifact@v2
with:
name: ${{ env.CHAIN }}-runtime
path: |
${{ env.CHAIN }}-info.json
${{ env.CHAIN }}-info_compressed.json
${{ env.CHAIN }}-metadata.json
${{ env.CHAIN }}-diff.txt
${{ env.CHAIN }}-subwam-info.txt
# - name: Upload wasm to pinata
# if: ${{ !env.ACT }}
# uses: aquiladev/[email protected]
# with:
# path: ${{ steps.srtool_build.outputs.wasm_compressed }}
# service: pinata
# pinataKey: ${{ secrets.PINATA_KEY }}
# pinataSecret: ${{ secrets.PINATA_SECRET }}

- name: Generate note
id: generate-note
uses: AcalaNetwork/acala-release-note-action@master
with:
scope: ${{ env.SCOPE }}
chain: ${{ env.CHAIN }}
subwasm_info: ${{ env.CHAIN }}-subwam-info.txt
srtool_details: ${{ env.CHAIN }}-srtool-digest.json
wasm_diff: ${{ env.CHAIN }}-diff.txt

- name: Save release note
run: echo "${{ steps.generate-note.outputs.release-note }}" >> release_note.md

- name: Crate Release Checklist issue
if: ${{ !env.ACT }}
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
filename: release_note.md

0 comments on commit 4541887

Please sign in to comment.