Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updates for CI for release #90

Merged
merged 10 commits into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
47 changes: 44 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,26 @@ workflows:
equal: [ "build_wasms", << pipeline.parameters.GHA_Meta >>]
jobs:
- build

modules-coverage:
when:
equal: [ "modules_coverage", << pipeline.parameters.GHA_Meta >>]
jobs:
- coverage
# Add this to give green CI when nothing is ran
# add this to give green ci when nothing is ran
pass:
jobs:
- pass

build-commit-deploy:
when:
equal: ["build_commit_deploy", << pipeline.parameters.GHA_Meta >>]
jobs:
- build
- deploy:
requires:
- build

jobs:
build:
docker:
Expand All @@ -52,13 +62,44 @@ jobs:
command: |
git config --global user.name 'CircleCI'
git config --global user.email 'circleci@example.com'
# Check for changes
git add framework/artifacts --force
git add modules/artifacts --force
git commit -m 'Update WASM artifacts [skip ci]'
git commit -m 'Update WASM binaries [skip ci]'
git push origin $CIRCLE_BRANCH

deploy:
docker:
- image: cimg/rust:1.72.0
resource_class: large
steps:
- checkout
- run:
name: Decode and Deploy
command: |
decoded_value=$(echo "$TEST_MNEMONIC_BASE64" | base64 --decode)
export TEST_MNEMONIC="$decoded_value"
cd framework
cargo run --bin full_deploy -- --network-ids $NETWORKS
- run:
name: Commit and push deploy file
command: |
git config --global user.name 'CircleCI'
git config --global user.email 'circleci@example.com'
git add framework/scripts --force
git commit -m 'Update deploy deploy file [skip ci]'
git push origin $CIRCLE_BRANCH
- run:
name: Commit and push state file
command: |
git config --global user.name 'CircleCI'
git config --global user.email 'circleci@example.com'
cp ~/.cw-orchestrator/state.json ./framework/scripts/
git add ./framework/scripts/state.json
git commit -m 'Update deploy deploy file [skip ci]'
git push origin $CIRCLE_BRANCH

coverage:
# https://circleci.com/developer/images?imageType=machine
docker:
- image: cimg/rust:1.72.0
resource_class: xlarge
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/manual-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Manual CircleCI Wasm Builder

# Job that updates the wasms of the mono-repo only if it is triggered manually.

on:
workflow_dispatch: # Trigger manually on any branch

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Tickle CircleCI
env:
CCI_TOKEN: ${{ secrets.CCI_TOKEN }}
run: |
curl -X POST \
-H "Circle-Token: ${CCI_TOKEN}" \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"branch": "${{ github.ref }}",
"parameters": {
"GHA_Meta": "build_wasms"
}
}' https://circleci.com/api/v2/project/gh/AbstractSDK/abstract/pipeline
38 changes: 10 additions & 28 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
name: release-deploy-publish

# Job that updates the wasms of the mono-repo after a PR is merged to main.
# Or if it is triggerd manually.
name: Release and Publish

on:
workflow_dispatch:
Expand All @@ -14,38 +11,23 @@ on:
jobs:
build:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch'
if: startsWith(github.ref, 'refs/heads/release/') || github.event_name == 'workflow_dispatch'
steps:
- name: Tickle CircleCI
- name: Tickle CircleCI to Build Wasm Binaries
env:
CCI_TOKEN: ${{ secrets.CCI_TOKEN }}
run: |
curl -X POST \
BRANCH_NAME=$(echo "${GITHUB_REF}" | sed -e "s/refs\/heads\///")
RESPONSE=$(curl -s -X POST \
-H "Circle-Token: ${CCI_TOKEN}" \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"branch": "release",
"parameters": {
"GHA_Meta": "build_wasms"
}
}' https://circleci.com/api/v2/project/gh/AbstractSDK/abstract/pipeline
"branch": "'"$BRANCH_NAME"'",

deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: Tickle CircleCI for Deploy
env:
CCI_TOKEN: ${{ secrets.CCI_TOKEN }}
run: |
curl -X POST \
-H "Circle-Token: ${CCI_TOKEN}" \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"branch": "release",
"parameters": {
"GHA_Meta": "deploy_all"
"GHA_Meta": "build_commit_deploy"
}
}' https://circleci.com/api/v2/project/gh/AbstractSDK/abstract/pipeline
}' https://circleci.com/api/v2/project/gh/AbstractSDK/abstract/pipeline)

echo "CircleCI Response: $RESPONSE"
Binary file modified framework/artifacts/abstract_account_factory.wasm
Binary file not shown.
Binary file modified framework/artifacts/abstract_ans_host.wasm
Binary file not shown.
Binary file modified framework/artifacts/abstract_ibc_client.wasm
Binary file not shown.
Binary file modified framework/artifacts/abstract_manager.wasm
Binary file not shown.
Binary file modified framework/artifacts/abstract_module_factory.wasm
Binary file not shown.
Binary file modified framework/artifacts/abstract_proxy.wasm
Binary file not shown.
Binary file modified framework/artifacts/abstract_version_control.wasm
Binary file not shown.
14 changes: 7 additions & 7 deletions framework/artifacts/checksums.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
77a3a7aa5cd300b1a0434df006084c294001a5be116a8b0353905db9f0c542a6 abstract_account_factory.wasm
5704cbda61ef42ef1fd44311fb6501a3479ce745495f79b2e992f270f7e1b70d abstract_ans_host.wasm
1e9289627b0b1fd4fb49e9b86fb10bb9c3be8ca0a774a7ff1e0147a1bfcb2eb3 abstract_ibc_client.wasm
da7d3ae2efa47b7fc90dc80af8a21f39243ceaed31a155c4e0ec0fc75f444978 abstract_manager.wasm
c65e7a82085d4a2057f4f97617b8e8390d6029c20aba1b9a4e8475758c5685f3 abstract_module_factory.wasm
ae462782ce15466c6c30908f8d10b53caea746950ae5b1e064489ffdf9525207 abstract_proxy.wasm
500278664f67799cef530fc37238eb479727864da619c80381818fb1f393323b abstract_version_control.wasm
f7750d3cdbcc88fd778ab52b8848a2c856341f6cc4f5e4e4c8bac1097a1a57d8 abstract_account_factory.wasm
6778124e0e686569e6bf32556ae453fa6f11612eac5f173c6500cd9f5db76330 abstract_ans_host.wasm
68db689904f7ddf3e75275be127dfa3261acd96a67ebeb1abffcb4ba4d4e9e16 abstract_ibc_client.wasm
8f6d455aa2ffd7304a0f7a932b6a8743103c34487c5dc0afdd100ddbb9e5d6cc abstract_manager.wasm
563032c3b249142685f3e836ade62d17fa43f66f99eb0a9c2495843659a5ad50 abstract_module_factory.wasm
74a45fd1288266609450b46c548d02d2abf8458e4f88fd1591137b7c0c966409 abstract_proxy.wasm
b540e7299fb41d3bc73ac1b958dd06575e603c1a45b2d4343937c01e75583aed abstract_version_control.wasm
14 changes: 7 additions & 7 deletions framework/artifacts/checksums_intermediate.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
a2aceb3c995e1b6fd1b1892fc1525e5a9e1453a1617452a32d45d3588459a219 target/wasm32-unknown-unknown/release/abstract_account_factory.wasm
f0c60b90b8665539892dc1bf0c84836f558833fbe2a0b00c7bc46fc2e45e16e2 target/wasm32-unknown-unknown/release/abstract_ans_host.wasm
c6ee94ec4cede630cc90d723be7a222e175b94b5f0c6ea8be13ae865be31f4cb target/wasm32-unknown-unknown/release/abstract_ibc_client.wasm
0c03ffd6a8a11391f12dbc3eebde6dba8a8d23d8154182db812b3461f033e0f1 target/wasm32-unknown-unknown/release/abstract_manager.wasm
206b3c241234c27b60a8f4c4ff70085867830ef764d1872d535bd3f12f13fe51 target/wasm32-unknown-unknown/release/abstract_module_factory.wasm
be4b0bcc91e30359f9327a7172259dd041f14342d1ee42ab8e3e798533c2503c target/wasm32-unknown-unknown/release/abstract_proxy.wasm
103242ef9d10d5d412b4c00d474d05bc36b591fbe52b750058891b6da78dd58e target/wasm32-unknown-unknown/release/abstract_version_control.wasm
b37945c0f758e3b6b926e992dac882fce086d15fe6c12052bfb7bcf0bcbf1c25 target/wasm32-unknown-unknown/release/abstract_account_factory.wasm
9ac13adeac5142dbbfd592468913053c1f03e046915ca3528da224a52a3f30dc target/wasm32-unknown-unknown/release/abstract_ans_host.wasm
6d4938a798bf174df19cf0403a33e0b34cac39e9f806ce50c207bbc075c285bd target/wasm32-unknown-unknown/release/abstract_ibc_client.wasm
51c784d2fd94f7fbd469e11ca00fe4f797a1ae8e62579318257d498603122da0 target/wasm32-unknown-unknown/release/abstract_manager.wasm
904378992a46348b7ed0b7ec41873b5ad4435e64b9de4cb6f7647636a723c6a8 target/wasm32-unknown-unknown/release/abstract_module_factory.wasm
22c8f76ce751ad24588d5e272b74e6bc96d078a2a4d8ee0183572e7a8845f250 target/wasm32-unknown-unknown/release/abstract_proxy.wasm
2e71cd17cfefb2508f522df9102b9074770859d386425c93d1c7584207e7ef88 target/wasm32-unknown-unknown/release/abstract_version_control.wasm
55 changes: 53 additions & 2 deletions framework/scripts/src/bin/full_deploy.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
use reqwest::Url;
use std::{fs, net::TcpStream, path::Path};

use abstract_core::objects::gov_type::GovernanceDetails;
use abstract_interface::Abstract;

use abstract_interface_scripts::assert_wallet_balance;
use abstract_interface_scripts::{assert_wallet_balance, DeploymentStatus};
use clap::Parser;
use cw_orch::{
deploy::Deploy,
Expand All @@ -21,12 +24,34 @@ fn full_deploy(networks: Vec<ChainInfo>) -> anyhow::Result<()> {
let networks = rt.block_on(assert_wallet_balance(&networks));

for network in networks {
let urls = network.grpc_urls.to_vec();
for url in urls {
rt.block_on(ping_grpc(url))?;
}

let chain = DaemonBuilder::default()
.handle(rt.handle())
.chain(network.clone())
.build()?;

let sender = chain.sender();
let deployment = Abstract::deploy_on(chain, sender.to_string())?;

let mut deployment_status = DeploymentStatus {
chain_id: network.chain_id.to_string(),
success: false, // Default to false
};

let deployment = match Abstract::deploy_on(chain, sender.to_string()) {
Ok(deployment) => {
deployment_status.success = true;
write_deployment(&deployment_status)?;
deployment
}
Err(e) => {
write_deployment(&deployment_status)?;
return Err(e.into());
}
};

// Create the Abstract Account because it's needed for the fees for the dex module
deployment
Expand All @@ -38,6 +63,32 @@ fn full_deploy(networks: Vec<ChainInfo>) -> anyhow::Result<()> {
Ok(())
}

async fn ping_grpc(url_str: &str) -> anyhow::Result<()> {
let parsed_url = Url::parse(url_str)?;

let host = parsed_url
.host_str()
.ok_or_else(|| anyhow::anyhow!("No host in url"))?;

let port = parsed_url.port_or_known_default().ok_or_else(|| {
anyhow::anyhow!(
"No port in url, and no default for scheme {:?}",
parsed_url.scheme()
)
})?;
let socket_addr = format!("{}:{}", host, port);

let _ = TcpStream::connect(socket_addr);
Ok(())
}

fn write_deployment(status: &DeploymentStatus) -> anyhow::Result<()> {
let path = Path::new("scripts").join("deployments.json");
let status_str = serde_json::to_string_pretty(status)?;
fs::write(path, status_str)?;
Ok(())
}

#[derive(Parser, Default, Debug)]
#[command(author, version, about, long_about = None)]
struct Arguments {
Expand Down
7 changes: 7 additions & 0 deletions framework/scripts/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use cw_orch::{
*,
},
};
use serde::{Deserialize, Serialize};

const GAS_TO_DEPLOY: u64 = 60_000_000;
pub const SUPPORTED_CHAINS: &[ChainInfo] =
Expand All @@ -21,6 +22,12 @@ pub const NEUTRON_1: ChainInfo = ChainInfo {
fcd_url: None,
};

#[derive(Debug, Serialize, Deserialize)]
pub struct DeploymentStatus {
pub chain_id: String,
pub success: bool,
}

pub async fn assert_wallet_balance<'a>(mut chains: &'a [ChainInfo<'a>]) -> &'a [ChainInfo<'a>] {
if chains.is_empty() {
chains = SUPPORTED_CHAINS;
Expand Down
Binary file modified modules/artifacts/abstract_challenge_app.wasm
Binary file not shown.
Binary file modified modules/artifacts/abstract_cw_staking-juno.wasm
Binary file not shown.
Binary file modified modules/artifacts/abstract_cw_staking-kujira.wasm
Binary file not shown.
Binary file modified modules/artifacts/abstract_cw_staking-neutron.wasm
Binary file not shown.
Binary file modified modules/artifacts/abstract_cw_staking-osmosis.wasm
Binary file not shown.
Binary file modified modules/artifacts/abstract_cw_staking-terra.wasm
Binary file not shown.
Binary file modified modules/artifacts/abstract_cw_staking.wasm
Binary file not shown.
Binary file modified modules/artifacts/abstract_dca_app.wasm
Binary file not shown.
Binary file modified modules/artifacts/abstract_dex_adapter-juno.wasm
Binary file not shown.
Binary file modified modules/artifacts/abstract_dex_adapter-kujira.wasm
Binary file not shown.
Binary file modified modules/artifacts/abstract_dex_adapter-neutron.wasm
Binary file not shown.
Binary file modified modules/artifacts/abstract_dex_adapter-osmosis.wasm
Binary file not shown.
Binary file modified modules/artifacts/abstract_dex_adapter-terra.wasm
Binary file not shown.
Binary file modified modules/artifacts/abstract_dex_adapter.wasm
Binary file not shown.
Binary file modified modules/artifacts/abstract_etf.wasm
Binary file not shown.
Binary file modified modules/artifacts/abstract_tendermint_staking_adapter.wasm
Binary file not shown.
34 changes: 17 additions & 17 deletions modules/artifacts/checksums.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
c9a458fd09568cfb0d0333b8af93dc957af83f77445139f8d872796aff1ae6a8 abstract_challenge_app.wasm
73c1615a33238981a9ee9fecfae43c69257c778a8482d9ab4fc7db3b97fd3e2c abstract_cw_staking-juno.wasm
024e36c4279b39e85c8d42014bafc06270a10bc1a25f18d2ce667498a0f02f46 abstract_cw_staking-kujira.wasm
11db040f736e857c9e223e23f2b2b05de864b1452f92b5e77863af4cf3222de0 abstract_cw_staking-neutron.wasm
0ac9cf8ea16116b12a77b91e77908fd7a38cfd624f1bdad5b92065191f9823d6 abstract_cw_staking-osmosis.wasm
f7acb8a6c34a5ca16c78468b58b3ceaee3845c3daabd03a5c69e92caa6543674 abstract_cw_staking-terra.wasm
73c8a33f3ccc9bdff14e0a6c4640c1c8b59e86d46c526a9584807b584cfbb92d abstract_cw_staking.wasm
85afe226a62e04eb4d33de61c1f2e713409051dfa496b7a0ba832685b4db569a abstract_dca_app.wasm
671d167c6c67e661b6e3ab0eb1d635dee3a8401ced2db54281b0d77cb8149f06 abstract_dex_adapter-juno.wasm
7b1d3fac951010973c23c167f8b65a1dd317cbdcade34e5ddd014d25b95a1b55 abstract_dex_adapter-kujira.wasm
02e51dff329df58d8306c8cda811959d5d7974c1804361dcbcafe67a187c8d1d abstract_dex_adapter-neutron.wasm
b9bea61c9b4fe24c6f569dd3e1e5ac5e22f57c24fe51a0c8c1ad3419650fb169 abstract_dex_adapter-osmosis.wasm
316f7b9c1b3558379c8c874e8ce6c6d5ce546132d06de65688e275dc3e5e062c abstract_dex_adapter-terra.wasm
4b4db0743a2a6f8a73bb0f0c63753b0d22b6a3dc9c212e1861c9cbb14c64d14d abstract_dex_adapter.wasm
10fe217efe34e6fca44a47ec30a24afa3617a838139167fa8bbf7afca7961137 abstract_etf.wasm
0c3cb751fe7f9ed27f1fdde47e699686b24e2491b185c607303f73b713d24642 abstract_tendermint_staking_adapter.wasm
105469894506e88b255fcad9fefcdcc790fdad412f408d89559ad789d99d5f8b croncat_app.wasm
354c35e2ffaa951c64c3801f00532680517b5520a9046159f778e4dc0e1480fa abstract_challenge_app.wasm
00d9945d659cb969d11f9cc350a2201c2ecde46e3263f6e4c9bd8492439fd9d9 abstract_cw_staking-juno.wasm
b2c22aefdab72ece234a32b154fefadb61669b0811c452c0364f19ebf6448a1a abstract_cw_staking-kujira.wasm
4160cf02d973117da571d8541faf634c2f94bc9197ddb440de8bb9b7372e0e15 abstract_cw_staking-neutron.wasm
5b4ff0134bddd603887f9aac3ab5039f140a6a438d3e5ffea4157a8278a4207a abstract_cw_staking-osmosis.wasm
9cf5d062af3bc49c713792e8cc544552ea6e35a35cbf47813cb0cfc5dc46792e abstract_cw_staking-terra.wasm
0c0d707c497c42443b0ca906af0a88d1e59ff2b54c1bade2646520fbc4de1ce5 abstract_cw_staking.wasm
ff0a1e009f275265f714bf43f596434bcddbabe3b8cd0e43329537b911a68d64 abstract_dca_app.wasm
8ee77a770017a54bbc3927cdce4cd4fc44f5828a626c829fe931dcc72ecc1d78 abstract_dex_adapter-juno.wasm
bfcc3c8c050db67cb96fb4cc4e2b6f09230b9a23059e648136463ff553380327 abstract_dex_adapter-kujira.wasm
61995f395aad8b5d078482cfc0ee960467b8a7892dc0b9eb53116d7172a7ea7f abstract_dex_adapter-neutron.wasm
c7086e516a9438eb69b021b02e9c409bd59a231935a5dd48be64a5ac9568ae54 abstract_dex_adapter-osmosis.wasm
e157b1f643cc736b4fc2507e7c0ff229d5eb793f3b720a3de69817d1a16a34d2 abstract_dex_adapter-terra.wasm
54ad8f9f1fe5406b28f43ca5adde7495e654d9ac00716af798c87f4da5775def abstract_dex_adapter.wasm
9c22c8179a45e23c3a87aa451c3fb09d471fac7920dc81a52db0c8187396a8bf abstract_etf.wasm
eddbd3a6096a00d2d7cc76af7ad3b71dc577fd7e86976f5a7c0a264e116e57a5 abstract_tendermint_staking_adapter.wasm
f5ae321588c4e8927de140c40ffbea5edc9de5bbc43b968b32163f760e34ba61 croncat_app.wasm
14 changes: 7 additions & 7 deletions modules/artifacts/checksums_intermediate.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
f5f3c298d485ce5c357e2eec0d3e412e21920e0d583eb5e8a2ee14660c8aee4c target/wasm32-unknown-unknown/release/abstract_challenge_app.wasm
2c1b36678582171781bd17cbc01f8041d5e1abd363538ea14c83c0fc08e37c5a target/wasm32-unknown-unknown/release/abstract_cw_staking.wasm
4c76612139dd760cfd8a8438dc8e4bf5fdb480272f2bcdbc0a4669a184e35c5c target/wasm32-unknown-unknown/release/abstract_dca_app.wasm
e0798cb4a5756723c6545623ac2b10ff7af049993c24e709709dbf0ddc04558b target/wasm32-unknown-unknown/release/abstract_dex_adapter.wasm
0e93825a3741d8db1d05624131f0f2524043917cf814bc3b4ef61087541b1835 target/wasm32-unknown-unknown/release/abstract_etf.wasm
9c2bd81fcad35d07e861e259ce3a742ef5a009464e57f624f3376fb23d08c108 target/wasm32-unknown-unknown/release/abstract_tendermint_staking_adapter.wasm
600ae906e57c77ea8ed9308dffca0ce91e24fc199a82554f6307cd561104fd1d target/wasm32-unknown-unknown/release/croncat_app.wasm
5cf4de430e7e04df8e77d697454028fb6248182c47e2e5a2002d936f34900d6c target/wasm32-unknown-unknown/release/abstract_challenge_app.wasm
2e98d43c8be5449fa418b6e2b65294765dd8973a50d14cb3edc7ce4f9028b390 target/wasm32-unknown-unknown/release/abstract_cw_staking.wasm
b09a312fab29079401a7ce10b3012621dccdc464d7f7ac4b919ca1a3aa2be4eb target/wasm32-unknown-unknown/release/abstract_dca_app.wasm
57f5fabecd111773ce80a77040f1e9c448a1748e099e69567bf615db4228ba1c target/wasm32-unknown-unknown/release/abstract_dex_adapter.wasm
203b98ea9bc396136fab8f363a36dac9ff5f7c1709f78fd6ae5a54d858f5951b target/wasm32-unknown-unknown/release/abstract_etf.wasm
93c29495e3ddb34f77b37c74a8145aca968adabbd01e7f6d83440b64b1971720 target/wasm32-unknown-unknown/release/abstract_tendermint_staking_adapter.wasm
94183300730ee27df2e958a1b59f9215b57e04ec70fdfbc4c02b2ad9c98dab4f target/wasm32-unknown-unknown/release/croncat_app.wasm
Binary file modified modules/artifacts/croncat_app.wasm
Binary file not shown.