Release WASM #49
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release WASM | |
on: | |
workflow_dispatch: | |
inputs: | |
network: | |
description: "Network" | |
required: true | |
type: choice | |
options: | |
- mainnet | |
- testnet | |
tag: | |
description: "Release tag" | |
type: string | |
env: | |
MATERIAL_LINK: https://raw.githubusercontent.com/darwinia-network/darwinia-releases/main/.github | |
PYTHON_VERSION: 3.12 | |
RUNTIME_OVERRIDES_LINK: https://github.com/darwinia-network/runtime-override/releases/download/v0.5.4/rtor.tar.zst | |
jobs: | |
mainnet: | |
name: Release WASM mainnet | |
runs-on: ubuntu-latest | |
if: github.event.inputs.network == 'mainnet' | |
strategy: | |
matrix: | |
network: [darwinia, crab] | |
features: [evm-tracing, force-debug] | |
steps: | |
- name: Setup build environment | |
run: sudo apt update -y && sudo apt install --no-install-recommends -y protobuf-compiler | |
- name: Install Python ${{ env.PYTHON_VERSION }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Install runtime-override ${{ env.RUNTIME_OVERRIDES_VERSION }} | |
run: | | |
curl -L ${{ env.RUNTIME_OVERRIDES_LINK }} | tar --zst -xv | |
sudo mv rtor /usr/bin | |
sudo chmod u+x /usr/bin/rtor | |
- name: Fetch latest code | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ matrix.network }} | |
- name: Run | |
run: | | |
curl -o ../wasm.py ${{ env.MATERIAL_LINK }}/wasm.py | |
python3 ../wasm.py ${{ github.event.inputs.tag }} ${{ matrix.network }} ${{ matrix.features }} | |
- name: Push | |
run: | | |
git config --global user.email "action@github.com" | |
git config --global user.name "GitHub Action" | |
git add . | |
git commit -am "Release \`${{ github.event.inputs.tag }}\`" | |
git pull --rebase origin ${{ matrix.network }} | |
git push origin ${{ matrix.network }} | |
testnet: | |
name: Release WASM testnet | |
runs-on: ubuntu-latest | |
if: github.event.inputs.network == 'testnet' | |
strategy: | |
matrix: | |
network: [koi] | |
features: [evm-tracing, force-debug] | |
steps: | |
- name: Setup build environment | |
run: sudo apt update -y && sudo apt install --no-install-recommends -y protobuf-compiler | |
- name: Install Python ${{ env.PYTHON_VERSION }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Install runtime-override ${{ env.RUNTIME_OVERRIDES_VERSION }} | |
run: | | |
curl -L ${{ env.RUNTIME_OVERRIDES_LINK }} | tar --zst -xv | |
sudo mv rtor /usr/bin | |
sudo chmod u+x /usr/bin/rtor | |
- name: Fetch latest code | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ matrix.network }} | |
- name: Run | |
run: | | |
curl -o ../wasm.py ${{ env.MATERIAL_LINK }}/wasm.py | |
python3 ../wasm.py ${{ github.event.inputs.tag }} ${{ matrix.network }} ${{ matrix.features }} | |
- name: Push | |
run: | | |
git config --global user.email "action@github.com" | |
git config --global user.name "GitHub Action" | |
git add . | |
git commit -am "Release \`${{ github.event.inputs.tag }}\`" | |
git pull --rebase origin ${{ matrix.network }} | |
git push origin ${{ matrix.network }} |