Build Deepbook TX #63
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: Build Deepbook TX | |
on: | |
workflow_dispatch: | |
inputs: | |
transaction_type: | |
description: 'select transaction type to create' | |
type: choice | |
options: | |
- Create Pool | |
- Upgrade Protocol | |
sui_tools_image: | |
description: 'image reference of sui_tools' | |
default: 'mysten/sui-tools:mainnet' | |
rpc: | |
description: 'RPC url' | |
required: true | |
default: 'https://suins-rpc.mainnet.sui.io:443' | |
type: string | |
gas_object_id: | |
description: 'object id to get gas from for multisig transaction' | |
required: true | |
type: string | |
default: '0xb76abcaefff13813adfa61768fac06a13a9bdbe7c86fb75118885364452286cb' | |
jobs: | |
deepbook: | |
name: deepbook create tx | |
runs-on: ubuntu-latest | |
steps: | |
- name: Selected transaction type | |
run: | | |
echo ${{ inputs.transaction_type }} | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Install Homebrew | |
run: | | |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | |
echo "/home/linuxbrew/.linuxbrew/bin" >> $GITHUB_PATH | |
- name: Install Sui using Homebrew | |
run: brew install sui | |
# - name: Set up Sui client config | |
# run: | | |
# mkdir -p ~/.sui/sui_config/ | |
# echo "${{ secrets.SUI_CLIENT_YAML }}" > ~/.sui/sui_config/client.yaml | |
# - name: Test | |
# run: which sui | |
- name: try to upgrade | |
run: | | |
cd packages/deepbook && sui client --yes --client.config client.yaml upgrade --upgrade-capability 0xc3670c420ee0e3cccfae819be4b6780007d56727467d5e5c60c0d3b6e264f5d9 --gas-budget 3000000000 --gas 0xb76abcaefff13813adfa61768fac06a13a9bdbe7c86fb75118885364452286cb --skip-dependency-verification --serialize-unsigned-transaction | |
- name: NPM BUILD TX Environment | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- name: Do a global PNPM install | |
run: | | |
npm install -g pnpm | |
- name: Set up working directory and install dependencies | |
run: | | |
pnpm install | |
- name: Upgrade Protocol | |
if: ${{ inputs.transaction_type == 'Upgrade Protocol' }} | |
env: | |
NODE_ENV: production | |
GAS_OBJECT: ${{ inputs.gas_object_id }} | |
NETWORK: mainnet | |
ORIGIN: gh_action | |
RPC_URL: ${{ inputs.rpc }} | |
run: | | |
cd scripts && pnpm install && pnpm ts-node transactions/mainPackageUpgrade.ts | |
- name: Create Pool | |
if: ${{ inputs.transaction_type == 'Create Pool' }} | |
env: | |
NODE_ENV: production | |
GAS_OBJECT: ${{ inputs.gas_object_id }} | |
NETWORK: mainnet | |
ORIGIN: gh_action | |
run: | | |
cd scripts && pnpm install && pnpm ts-node transactions/createPool.ts | |
- name: Show Transaction Data (To sign) | |
run: | | |
cat scripts/tx/tx-data.txt | |
- name: Upload Transaction Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: transaction-data | |
path: scripts/tx |