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

Fix deployment scripts (release) #16

Merged
merged 1 commit into from
Nov 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/check_artifacts_size.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Check Artifacts Size
on:
pull_request:

jobs:
check-artifacts-size:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cargo/bin
~/.cargo/git/checkouts
~/.cargo/git/db
~/.cargo/registry/cache
~/.cargo/registry/index
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Check Artifacts Size
run: |
$GITHUB_WORKSPACE/scripts/check_artifacts_size.sh
19 changes: 19 additions & 0 deletions .github/workflows/release_artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Release Artifacts
on:
push:
tags:
- '*'

jobs:
release-artifacts:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build Artifacts
run: |
$GITHUB_WORKSPACE/scripts/build_release.sh
tar -zcvf cosmwasm-artifacts.tar.gz artifacts
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: cosmwasm-artifacts.tar.gz
63 changes: 63 additions & 0 deletions .github/workflows/tests_and_checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Contract tests and checks

on:
pull_request:
push:
branches:
- release

env:
CARGO_TERM_COLOR: always

jobs:
test_and_check:
name: Test and check
runs-on: ubuntu-latest

steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.1
with:
access_token: ${{ github.token }}

- name: Checkout sources
uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cargo/bin
~/.cargo/git/checkouts
~/.cargo/git/db
~/.cargo/registry/cache
~/.cargo/registry/index
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.64.0
override: true
components: rustfmt, clippy

- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --no-fail-fast --locked
env:
RUST_BACKTRACE: 1

- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings

- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# IDEs
*.iml
.idea
.vscode

/artifacts/

Expand Down
19 changes: 10 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 50 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,50 @@
## Astroport IBC enabled contracts
# Astroport IBC

This repo contains Astroport IBC related contracts.

## Contracts

| Name | Description |
| ------------------------------ | -------------------------------- |
| [`controller`](contracts/controller) | IBC controller contract intended to be hosted on the main chain |
| [`cw20-ics20`](contracts/cw20-ics20) | IBC Enabled contract that receives CW20 tokens and sends them over IBC channel to a remote chain |
| [`satellite`](contracts/satellite) | IBC enabled astroport satellite contract intended to be hosted on a remote chain |

## Building Contracts

You will need Rust 1.64.0+ with wasm32-unknown-unknown target installed.

### You can compile each contract:
Go to contract directory and run

```
cargo wasm
cp ../../target/wasm32-unknown-unknown/release/astroport_token.wasm .
ls -l astroport_token.wasm
sha256sum astroport_token.wasm
```

### You can run tests for all contracts
Run the following from the repository root

```
cargo test
```

### For a production-ready (compressed) build:
Run the following from the repository root

```
./scripts/build_release.sh
```

The optimized contracts are generated in the artifacts/ directory.

## Branches

We use [main](https://github.com/astroport-fi/astroport-ibc/tree/main) branch for new feature development and [release](https://github.com/astroport-fi/astroport-ibc/tree/release) one for collecting features which are ready for deployment. You can find the version and commit for actually deployed contracts [here](https://github.com/astroport-fi/astroport-changelog).

## Docs

Docs can be generated using `cargo doc --no-deps`

5 changes: 4 additions & 1 deletion contracts/cw20-ics20/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "cw20-ics20"
name = "astroport-cw20-ics20"
version = "0.15.1"
edition = "2021"

Expand All @@ -8,3 +8,6 @@ crate-type = ["cdylib", "rlib"]

[dependencies]
cw20-ics20-orig = { package = "cw20-ics20", version = "0.15.1" }

[dev-dependencies]
cosmwasm-schema = "1.1"
2 changes: 2 additions & 0 deletions contracts/satellite/src/ibc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ mod tests {
main_maker: None,
transfer_channel: None,
timeout: None,
accept_new_connections: None,
}),
)
.unwrap();
Expand Down Expand Up @@ -313,6 +314,7 @@ mod tests {
main_maker: None,
transfer_channel: None,
timeout: None,
accept_new_connections: None,
}),
)
.unwrap();
Expand Down
Loading