Skip to content

Commit

Permalink
ci: use previous version to raise proposal (#948)
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmic-vagabond authored Nov 14, 2024
1 parent 1565897 commit 4873d1f
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,27 +39,35 @@ jobs:
NODE=https://rpc.testnet.elys.network:443
OPTIONS="--node $NODE --chain-id elystestnet-1 --keyring-backend=test -b=sync --fees=100000uelys --gas=300000 -y"
# TODO: remove this block after the next release
OLD_VERSION=v0.49.4
DOWNLOAD_URL=https://github.com/elys-network/elys/releases/download/${OLD_VERSION}/elysd-${OLD_VERSION}-linux-amd64
OLD_BINARY_PATH=/tmp/elysd-${OLD_VERSION}
# download binary from release
curl -L $DOWNLOAD_URL -o ${OLD_BINARY_PATH} && chmod +x ${OLD_BINARY_PATH}
# save private keys to files
echo "${{ secrets.PRIVATE_KEY_1 }}" > /tmp/private_key_1.txt
echo "${{ secrets.PRIVATE_KEY_2 }}" > /tmp/private_key_2.txt
echo "${{ secrets.PRIVATE_KEY_3 }}" > /tmp/private_key_3.txt
echo "${{ secrets.PRIVATE_KEY_4 }}" > /tmp/private_key_4.txt
# recover keys
echo "${{ secrets.PASSPHRASE_1 }}" | $ELYSD keys import key_1 --keyring-backend test /tmp/private_key_1.txt
echo "${{ secrets.PASSPHRASE_2 }}" | $ELYSD keys import key_2 --keyring-backend test /tmp/private_key_2.txt
echo "${{ secrets.PASSPHRASE_3 }}" | $ELYSD keys import key_3 --keyring-backend test /tmp/private_key_3.txt
echo "${{ secrets.PASSPHRASE_4 }}" | $ELYSD keys import key_4 --keyring-backend test /tmp/private_key_4.txt
echo "${{ secrets.PASSPHRASE_1 }}" | ${OLD_BINARY_PATH} keys import key_1 --keyring-backend test /tmp/private_key_1.txt
echo "${{ secrets.PASSPHRASE_2 }}" | ${OLD_BINARY_PATH} keys import key_2 --keyring-backend test /tmp/private_key_2.txt
echo "${{ secrets.PASSPHRASE_3 }}" | ${OLD_BINARY_PATH} keys import key_3 --keyring-backend test /tmp/private_key_3.txt
echo "${{ secrets.PASSPHRASE_4 }}" | ${OLD_BINARY_PATH} keys import key_4 --keyring-backend test /tmp/private_key_4.txt
# get checksum
checksum=$(cat dist/sha256sum.txt | extract_checksum)
# query and upgrade height
height=$($ELYSD status --node $NODE | extract_and_calc_upgrade_height)
height=$(${OLD_BINARY_PATH} status --node $NODE | extract_and_calc_upgrade_height)
# create proposal
txhash=$(
$ELYSD tx gov submit-legacy-proposal software-upgrade \
${OLD_BINARY_PATH} tx gov submit-legacy-proposal software-upgrade \
${{ github.ref_name }} \
--deposit=10000000uelys \
--upgrade-height=$height \
Expand All @@ -71,11 +79,11 @@ jobs:
$OPTIONS | extract_txhash
)
sleep 10
proposalid=$($ELYSD q tx $txhash --node $NODE | extract_proposal_id)
proposalid=$(${OLD_BINARY_PATH} q tx $txhash --node $NODE | extract_proposal_id)
# vote on proposal
$ELYSD tx gov vote $proposalid yes --from=key_1 $OPTIONS
$ELYSD tx gov vote $proposalid yes --from=key_2 $OPTIONS
$ELYSD tx gov vote $proposalid yes --from=key_3 $OPTIONS
$ELYSD tx gov vote $proposalid yes --from=key_4 $OPTIONS
${OLD_BINARY_PATH} tx gov vote $proposalid yes --from=key_1 $OPTIONS
${OLD_BINARY_PATH} tx gov vote $proposalid yes --from=key_2 $OPTIONS
${OLD_BINARY_PATH} tx gov vote $proposalid yes --from=key_3 $OPTIONS
${OLD_BINARY_PATH} tx gov vote $proposalid yes --from=key_4 $OPTIONS
sleep 10

0 comments on commit 4873d1f

Please sign in to comment.