Deploy #16
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: Deploy | |
concurrency: | |
group: ci-${{ github.ref }} | |
cancel-in-progress: true | |
on: | |
workflow_dispatch: | |
inputs: | |
network: | |
type: choice | |
description: Which network to deploy to | |
required: true | |
default: devnet | |
options: | |
- devnet | |
- testnet | |
- finney | |
env: | |
CARGO_TERM_COLOR: always | |
RUST_BACKTRACE: 1 | |
jobs: | |
deploy: | |
name: Deploy to ${{ github.event.inputs.network }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Dependencies | |
run: | | |
sudo apt-get update && | |
sudo apt-get install -y curl jq nodejs clang curl libssl-dev llvm \ | |
libudev-dev protobuf-compiler && | |
npm install -g wscat | |
- name: Check-out repository under $GITHUB_WORKSPACE | |
uses: actions/checkout@v4 | |
- name: Install Rust | |
uses: actions-rs/[email protected] | |
with: | |
toolchain: stable | |
- name: try on its own | |
run: | | |
wscat -c wss://test.finney.opentensor.ai:443 -x '{"id":1, "jsonrpc":"2.0", "method": "state_getRuntimeVersion"}' -w 1 | |
- name: Get live spec_version for ${{ github.event.inputs.network }} | |
run: | | |
spec_version=$(wscat -c wss://test.finney.opentensor.ai:443 -x '{"id":1, "jsonrpc":"2.0", "method": "state_getRuntimeVersion"}' -w 1 | jq -r '.result.specVersion' | tr -d '\n') | |
echo "spec_version: |$spec_version|" | |
: ${spec_version:?bad spec version} | |
echo "spec_version=$spec_version" >> $GITHUB_OUTPUT | |
- name: cargo build --release -p node-subtensor | |
run: echo "hey" # cargo build --release -p node-subtensor |