|
9 | 9 | release: |
10 | 10 | runs-on: ubuntu-latest |
11 | 11 | permissions: |
12 | | - packages: write |
| 12 | + contents: write |
13 | 13 | steps: |
14 | 14 | - name: Checkout sources |
15 | 15 | uses: actions/checkout@v4 |
16 | 16 |
|
17 | | - - name: Install jq |
18 | | - run: sudo apt-get install jq |
19 | | - |
20 | 17 | - name: Install cargo-run-script |
21 | 18 | uses: actions-rs/cargo@v1 |
22 | 19 | with: |
@@ -54,20 +51,31 @@ jobs: |
54 | 51 | - name: Install Neutron & import key |
55 | 52 | run: | |
56 | 53 | wget -O neutrond https://github.com/neutron-org/neutron/releases/download/v3.0.2/neutrond-linux-amd64 |
57 | | - chmod +x neutrond |
58 | | - echo ${{ secrets.TW_CI_NEUTRON_KEY_PASS }} | neutrond keys import tw_ci_neutron tw_ci_neutron.key |
| 54 | + chmod +x ./neutrond |
| 55 | + ./neutrond config chain-id neutron-1 |
| 56 | + ./neutrond config node ${{ vars.NEUTRON_RPC_NODE }} |
| 57 | + ./neutrond config keyring-backend file |
| 58 | + (echo ${{ secrets.TW_CI_NEUTRON_KEY_PASS }}; echo ${{ secrets.TW_CI_NEUTRON_KEY_PASS }}; echo ${{ secrets.TW_CI_NEUTRON_KEY_PASS }}) | ./neutrond keys import tw_ci_neutron tw_ci_neutron.key |
59 | 59 |
|
60 | 60 | - name: Deploy WASM contracts to Neutron |
61 | 61 | run: | |
62 | | - find ./artifacts -name \*.wasm -exec neutrond tx wasm store {} --from tw_ci_neutron --gas auto --gas-prices 0.01untrn --gas-adjustment 1.3 --output json -y \; -exec sleep 5 \; |
| 62 | + echo '' > code_ids.tmp |
| 63 | + for f in ./artifacts/*.wasm |
| 64 | + do |
| 65 | + echo "Processing $f" |
| 66 | + tx_output=$(echo ${{ secrets.TW_CI_NEUTRON_KEY_PASS }} | ./neutrond tx wasm store $f --from ${{ vars.TW_CI_NEUTRON_KEY_ADDR }} --gas auto --gas-prices 0.01untrn --gas-adjustment 1.3 --output json -y) |
| 67 | + echo $tx_output |
| 68 | + sleep 10 |
| 69 | + tx_hash=$(jq -r '.txhash' <<< "$tx_output") |
| 70 | + echo "> TX hash: $tx_hash" |
| 71 | + ./neutrond query tx $tx_hash -o json | jq '.events[] | select(.type == "store_code") | .attributes | {(.[0].key): .[0].value, (.[1].key): .[1].value}' >> code_ids.tmp |
| 72 | + done |
| 73 | + jq -s '.' code_ids.tmp > code_ids.json |
| 74 | + rm code_ids.tmp |
63 | 75 | |
64 | | - - name: Get contract code IDs |
65 | | - run: | |
66 | | - ./neutrond query wasm list-code --reverse --output json | jq -c '.code_infos[] | select(.creator == "${{ tw_ci_neutron }}") | {code_id: .code_id, code_hash: .data_hash|ascii_downcase}' | jq -s . > code_ids.json |
67 | | -
|
68 | 76 | - name: Join code IDs & checksums |
69 | 77 | run: | |
70 | | - jq '[JOIN(INDEX(input[]; .code_hash); .[]; .code_hash; add)]' checksums.json code_ids.json | jq '.[] | [.contract, .code_id] | @tsv' contract_code_ids.txt |
| 78 | + jq '[JOIN(INDEX(input[]; .code_checksum); .[]; .code_hash; add)]' checksums.json code_ids.json | jq -r '.[] | [.contract, .code_id] | @tsv' | column -ts $'\t' > contract_code_ids.txt |
71 | 79 | |
72 | 80 | - name: Append code IDs to release notes |
73 | 81 | uses: softprops/action-gh-release@v2 |
|
0 commit comments