chore(v1.0.0): Remove pallet-sudo
from production Vara (#3279)
#44
Workflow file for this run
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 | |
on: | |
push: | |
tags: ["*"] | |
env: | |
CARGO_INCREMENTAL: 0 | |
CARGO_TERM_COLOR: always | |
TERM: xterm-256color | |
jobs: | |
generate-changelog: | |
name: Generate changelog | |
runs-on: ubuntu-latest | |
outputs: | |
release_body: ${{ steps.git-cliff.outputs.content }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Update config | |
shell: bash | |
run: sed -E -i "s/\s+\#\s(.*)\s\#\sreplace issue numbers/\\t\1/g" cliff.toml | |
- name: Generate a changelog | |
uses: orhun/git-cliff-action@v2 | |
id: git-cliff | |
with: | |
config: cliff.toml | |
args: -vv --latest --strip header | |
env: | |
OUTPUT: CHANGES.md | |
prepare: | |
needs: generate-changelog | |
runs-on: ubuntu-latest | |
steps: | |
- id: version | |
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT | |
- name: Show version | |
run: echo ${{ steps.version.outputs.VERSION }} | |
outputs: | |
version: ${{ steps.version.outputs.VERSION }} | |
build: | |
needs: prepare | |
runs-on: [kuberunner] | |
steps: | |
- name: "Actions: Checkout" | |
uses: actions/checkout@v4 | |
- name: "Environment: Cargo path" | |
run: > | |
echo "/tmp/cargo/bin" >> $GITHUB_PATH | |
- name: "Install: Rust toolchain" | |
uses: dsherret/rust-toolchain-file@v1 | |
- name: "Install: Build dependencies" | |
run: | | |
sudo apt update -y | |
sudo apt install -y git clang curl libssl-dev llvm libudev-dev cmake protobuf-compiler wget bzip2 | |
- name: "Environment: Export versions" | |
run: | | |
export GEAR_SPEC="$(cat runtime/gear/src/lib.rs | grep "spec_version: " | awk -F " " '{print substr($2, 1, length($2)-1)}')" | |
export VARA_SPEC="$(cat runtime/vara/src/lib.rs | grep "spec_version: " | awk -F " " '{print substr($2, 1, length($2)-1)}')" | |
- name: "Artifact: Make `artifact` directory" | |
run: > | |
mkdir -p artifact | |
- name: "Build: `wasm-proc`" | |
run: | | |
cargo build -p wasm-proc --release | |
cp -vf target/release/wasm-proc ./ | |
- name: "Build: Production `gear-cli`" | |
run: > | |
cargo build -p gear-cli --profile production | |
- name: "Test: Production runtimes" | |
run: | | |
./wasm-proc --check-runtime-imports target/production/wbuild/gear-runtime/gear_runtime.wasm | |
./wasm-proc --check-runtime-imports target/production/wbuild/vara-runtime/vara_runtime.wasm | |
- name: "Artifact: Production binaries" | |
run: | | |
cp target/production/wbuild/gear-runtime/gear_runtime.compact.compressed.wasm "artifact/gear_v$GEAR_SPEC.wasm" | |
cp target/production/wbuild/vara-runtime/vara_runtime.compact.compressed.wasm "artifact/vara_v$VARA_SPEC.wasm" | |
cp target/production/gear artifact/gear | |
strip artifact/gear || true | |
- name: "Build: Development `gear-cli`" | |
run: > | |
cargo build -p gear-cli --profile production -F dev | |
- name: "Test: Development runtimes" | |
run: | | |
./wasm-proc --check-runtime-imports target/production/wbuild/gear-runtime/gear_runtime.wasm | |
./wasm-proc --check-runtime-imports target/production/wbuild/vara-runtime/vara_runtime.wasm | |
- name: "Artifact: Development binaries" | |
run: | | |
cp target/production/wbuild/gear-runtime/gear_runtime.compact.compressed.wasm "artifact/dev_gear_v$GEAR_SPEC.wasm" | |
cp target/production/wbuild/vara-runtime/vara_runtime.compact.compressed.wasm "artifact/dev_vara_v$VARA_SPEC.wasm" | |
cp target/production/gear artifact/dev-gear | |
strip artifact/dev-gear || true | |
- name: Publish | |
uses: softprops/action-gh-release@v1 | |
with: | |
body: "${{ needs.generate-changelog.outputs.release_body }}" | |
files: artifact/* | |
tag_name: ${{ steps.version.outputs.VERSION }} | |
draft: true |