-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: split testnet and release CI workflows (#1094)
* Revert "fixing version upgrades (#1090)" This reverts commit 2fc6e9a. * chore: minor * ci: split release and deploy to testnet * fix: introduce upgrade version * test: fix tests * ci: use upgrade version * ci: update localnet version
- Loading branch information
1 parent
0267787
commit ce37d90
Showing
9 changed files
with
159 additions
and
40 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Create release | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
release: | ||
name: Create release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
ref: ${{ github.event.inputs.release_tag }} | ||
|
||
- name: Make release | ||
run: | | ||
sudo rm -rf dist | ||
make release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: TestNet deploy in 2 hours | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
release: | ||
name: Deploy to TestNet in 2 hours | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Create software upgrade proposal | ||
run: | | ||
# Get latest release version using GitHub API | ||
ELYS_VERSION=$(curl -s https://api.github.com/repos/elys-network/elys/releases/latest | grep -Po '"tag_name": "\K.*?(?=")') | ||
echo "Latest elys version: $ELYS_VERSION" | ||
# Download latest binary | ||
DOWNLOAD_BINARY_URL=https://github.com/elys-network/elys/releases/download/${ELYS_VERSION}/elysd-${ELYS_VERSION}-linux-amd64 | ||
DOWNLOAD_SHA256_URL=https://github.com/elys-network/elys/releases/download/${ELYS_VERSION}/sha256sum.txt | ||
ELYSD=/tmp/elysd-${ELYS_VERSION} | ||
SHA256SUM=/tmp/sha256sum.txt | ||
curl -L $DOWNLOAD_BINARY_URL -o $ELYSD && chmod +x $ELYSD | ||
curl -L $DOWNLOAD_SHA256_URL -o $SHA256SUM | ||
# helper functions | ||
extract_txhash() { awk -F 'txhash: ' '/txhash:/{print $2; exit}'; } | ||
extract_proposal_id() { awk -F 'key: proposal_id|value: ' '/key: proposal_id/ { getline; gsub(/"/, "", $2); print $2; exit }'; } | ||
extract_and_calc_upgrade_height() { awk -F'"latest_block_height":"' '{ split($2,a,"\""); print a[1]+2600; exit }'; } | ||
extract_checksum() { awk "/elysd-${ELYS_VERSION}-linux-amd64.tar.gz/ {print \$1; exit}"; } | ||
# environment variables | ||
NODE=https://rpc.testnet.elys.network:443 | ||
OPTIONS="--node $NODE --chain-id elysicstestnet-1 --keyring-backend=test -b=sync --fees=20000uelys --gas=300000 -y" | ||
# import proposers key | ||
${ELYSD} keys import-hex proposer1 ${{ secrets.TESTNET_PROPOSER_PRIVATE_KEY_1 }} --keyring-backend=test | ||
${ELYSD} keys import-hex proposer2 ${{ secrets.TESTNET_PROPOSER_PRIVATE_KEY_2 }} --keyring-backend=test | ||
${ELYSD} keys import-hex proposer3 ${{ secrets.TESTNET_PROPOSER_PRIVATE_KEY_3 }} --keyring-backend=test | ||
${ELYSD} keys import-hex proposer4 ${{ secrets.TESTNET_PROPOSER_PRIVATE_KEY_4 }} --keyring-backend=test | ||
# get checksum | ||
checksum=$(cat $SHA256SUM | extract_checksum) | ||
# query and upgrade height | ||
height=$(${ELYSD} status --node $NODE | extract_and_calc_upgrade_height) | ||
# generate upgrade version | ||
upgrade_version=$(echo ${ELYS_VERSION} | cut -d'.' -f1) | ||
echo "current version: ${ELYS_VERSION}" | ||
echo "upgrade_version: $upgrade_version" | ||
# create proposal | ||
txhash=$( | ||
${ELYSD} software-upgrade-tx \ | ||
$upgrade_version \ | ||
$height \ | ||
10000000uelys \ | ||
"Elys Network ${upgrade_version} released. Focuses on enhancements and codebase improvements." \ | ||
"{\"binaries\":{\"linux/amd64\":\"https://github.com/elys-network/elys/releases/download/${ELYS_VERSION}/elysd-${ELYS_VERSION}-linux-amd64.tar.gz?checksum=$checksum\"}}" \ | ||
true \ | ||
--from=proposer1 \ | ||
$OPTIONS | extract_txhash | ||
) | ||
sleep 10 | ||
proposalid=$(${ELYSD} q tx $txhash --node $NODE | extract_proposal_id) | ||
# vote on proposal | ||
${ELYSD} tx gov vote $proposalid yes --from=proposer1 $OPTIONS | ||
${ELYSD} tx gov vote $proposalid yes --from=proposer2 $OPTIONS | ||
${ELYSD} tx gov vote $proposalid yes --from=proposer3 $OPTIONS | ||
${ELYSD} tx gov vote $proposalid yes --from=proposer4 $OPTIONS | ||
sleep 10 |
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
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
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
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