Skip to content

feat: add terms and conditions block height to add_proposal (#117) #91

feat: add terms and conditions block height to add_proposal (#117)

feat: add terms and conditions block height to add_proposal (#117) #91

Workflow file for this run

name: Release
on:
push:
branches: [ main ]
workflow_dispatch:
inputs:
environment:
description: 'Account to deploy'
type: environment
required: true
jobs:
deploy-devhub-contract:
runs-on: ubuntu-latest
name: Deploy contract to mainnet
env:
NEAR_NETWORK_CONNECTION: mainnet
NEAR_DEVHUB_ACCOUNT_ID: ${{ vars.NEAR_GIGSBOARD_ACCOUNT_ID }}
NEAR_DEVHUB_ACCOUNT_PUBLIC_KEY: ${{ vars.NEAR_GIGSBOARD_ACCOUNT_PUBLIC_KEY }}
NEAR_DEVHUB_ACCOUNT_PRIVATE_KEY: ${{ secrets.NEAR_GIGSBOARD_ACCOUNT_PRIVATE_KEY }}
environment: ${{ inputs.environment || 'devhub.near' }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v1
- name: Install cargo-near
run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/cargo-near/releases/latest/download/cargo-near-installer.sh | sh
- name: Build discussions contract
run: cd discussions && cargo near build
- name: Build community contract
run: cd community && cargo near build
- name: Build community factory contract
run: cd community-factory && cargo near build
- name: Build devhub contract
run: cargo near build
- name: Install near CLI
run: |
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/near-cli-rs/releases/download/v0.3.1/near-cli-rs-v0.3.1-installer.sh | sh
- name: Deploy contract
run: |
output=$(near contract call-function as-transaction "$NEAR_DEVHUB_ACCOUNT_ID" unsafe_self_upgrade file-args ./target/near/devhub.wasm prepaid-gas '200 TeraGas' attached-deposit '0 NEAR' sign-as "$NEAR_DEVHUB_ACCOUNT_ID" network-config "$NEAR_NETWORK_CONNECTION" sign-with-plaintext-private-key --signer-public-key "$NEAR_DEVHUB_ACCOUNT_PUBLIC_KEY" --signer-private-key "$NEAR_DEVHUB_ACCOUNT_PRIVATE_KEY" send)
while [[ ! "$output" == *"Migration done."* ]]; do
echo "$output"
sleep 5
output=$(near contract call-function as-transaction "$NEAR_DEVHUB_ACCOUNT_ID" unsafe_migrate json-args '{}' prepaid-gas '100 TeraGas' attached-deposit '0 NEAR' sign-as "$NEAR_DEVHUB_ACCOUNT_ID" network-config "$NEAR_NETWORK_CONNECTION" sign-with-plaintext-private-key --signer-public-key "$NEAR_DEVHUB_ACCOUNT_PUBLIC_KEY" --signer-private-key "$NEAR_DEVHUB_ACCOUNT_PRIVATE_KEY" send)
done
echo "$output"