-
Notifications
You must be signed in to change notification settings - Fork 13
146 lines (130 loc) · 4.12 KB
/
suins-build-tx.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
---
name: Build SuiNS TX
on:
workflow_dispatch:
inputs:
transaction_type:
description: 'select transaction type to create'
type: choice
options:
- Publish Discounts
- Authorize Discounts
- Withdraw Auction Profits
- Transfer Reserved Names
- Main package upgrade
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: '0x7a261dae36d8be1e30955540a9dbd2ff13922d87129c675b82aeb45e36eb89ed'
jobs:
suins:
name: suins create tx
runs-on: ubuntu-latest
steps:
- name: Selected transaction type
run: |
echo ${{ inputs.transaction_type }}
- name: Check out code
uses: actions/checkout@v3
- name: Create client.yaml and keystore
working-directory: .
env:
NETWORK: mainnet
RPC: ${{ inputs.rpc }}
run: |
mkdir sui_config
touch sui_config/sui.keystore
cat <<EOF > sui_config/sui.keystore
[
"AJJqjgjU5B9vG2xV2c5kd51eyLYJ0yuEcSYRjzCKIQhT"
]
EOF
cat <<EOF > sui_config/client.yaml
---
keystore:
File: $HOME/.sui/sui_config/sui.keystore
envs:
- alias: $NETWORK
rpc: "$RPC"
ws: ~
EOF
mkdir $HOME/.sui
cp -r sui_config $HOME/.sui/sui_config
- name: Set up sui environment
working-directory: .
run: |
docker pull docker.io/${{ inputs.sui_tools_image }}
docker create --name tmp_cont docker.io/${{ inputs.sui_tools_image }}
docker cp tmp_cont:/usr/local/bin/sui sui
- name: NPM BUILD TX Environment
uses: actions/setup-node@v3
with:
node-version: 18.16
- name: Do a global PNPM install
run: |
npm install -g pnpm
- name: Set up working directory
run: |
cd scripts && pnpm install
- name: Main Package Upgrade
if: ${{ inputs.transaction_type == 'Main package upgrade' }}
env:
NODE_ENV: production
GAS_OBJECT: ${{ inputs.gas_object_id }}
NETWORK: mainnet
ORIGIN: gh_action
run: |
cd scripts && pnpm transactions::main_package::upgrade
- 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: Withdraw Auction Profits
if: ${{ inputs.transaction_type == 'Withdraw Auction Profits' }}
env:
NODE_ENV: production
GAS_OBJECT: ${{ inputs.gas_object_id }}
NETWORK: mainnet
ORIGIN: gh_action
run: |
cd scripts && pnpm withdraw:auction:profits
- name: Publish Discounts
if: ${{ inputs.transaction_type == 'Publish Discounts' }}
env:
NODE_ENV: production
GAS_OBJECT: ${{ inputs.gas_object_id }}
NETWORK: mainnet
ORIGIN: gh_action
run: |
cd scripts && pnpm publish-discounts
- name: Authorize Discounts
if: ${{ inputs.transaction_type == 'Authorize Discounts' }}
env:
NODE_ENV: production
GAS_OBJECT: ${{ inputs.gas_object_id }}
NETWORK: mainnet
ORIGIN: gh_action
run: |
cd scripts && pnpm authorize-discounts
- 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