Build SuiNS TX #152
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: Build SuiNS TX | |
on: | |
workflow_dispatch: | |
inputs: | |
transaction_type: | |
description: 'select transaction type to create' | |
type: choice | |
options: | |
- Disable Discounts | |
- Disable Free Claims | |
- Profits to Treasury | |
- Transfer Reserved Names | |
- SuiLink Discount | |
- Bulk Coupons | |
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: '0x5cc6e842a17918ad7ce5e4e333309b387f1d5151bc3c89682abda460a700c2f5' | |
jobs: | |
suins: | |
name: suins 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: 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 | |
run: | | |
pnpm install | |
- name: Transfer Reserved Names | |
if: ${{ inputs.transaction_type == 'Transfer Reserved Names' }} | |
env: | |
NODE_ENV: production | |
GAS_OBJECT: ${{ inputs.gas_object_id }} | |
NETWORK: mainnet | |
ORIGIN: gh_action | |
run: | | |
cd scripts && pnpm transfer::names | |
- name: Profits to Treasury | |
if: ${{ inputs.transaction_type == 'Profits to Treasury' }} | |
env: | |
NODE_ENV: production | |
GAS_OBJECT: ${{ inputs.gas_object_id }} | |
NETWORK: mainnet | |
ORIGIN: gh_action | |
run: | | |
cd scripts && pnpm withdraw:profits | |
- name: Disable Free Claims | |
if: ${{ inputs.transaction_type == 'Disable Free Claims' }} | |
env: | |
NODE_ENV: production | |
GAS_OBJECT: ${{ inputs.gas_object_id }} | |
NETWORK: mainnet | |
ORIGIN: gh_action | |
run: | | |
cd scripts && pnpm disable-free-claims | |
- name: Disable Discounts | |
if: ${{ inputs.transaction_type == 'Disable Discounts' }} | |
env: | |
NODE_ENV: production | |
GAS_OBJECT: ${{ inputs.gas_object_id }} | |
NETWORK: mainnet | |
ORIGIN: gh_action | |
run: | | |
cd scripts && pnpm disable-discounts | |
- name: Create Deepbook Pools | |
if: ${{ inputs.transaction_type == 'Create Deepbook Pools' }} | |
env: | |
NODE_ENV: production | |
GAS_OBJECT: ${{ inputs.gas_object_id }} | |
NETWORK: mainnet | |
ORIGIN: gh_action | |
run: | | |
cd scripts && pnpm create-deepbook-pools | |
- name: Bulk Coupons | |
if: ${{ inputs.transaction_type == 'Bulk Coupons' }} | |
env: | |
NODE_ENV: production | |
GAS_OBJECT: ${{ inputs.gas_object_id }} | |
NETWORK: mainnet | |
ORIGIN: gh_action | |
RPC_URL: ${{ inputs.rpc }} | |
run: | | |
cd scripts && pnpm ts-node transactions/create-bulk-coupons.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 |