diff --git a/.circleci/config.yml b/.circleci/config.yml index ae9e6566f..ae8b5648f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,6 +1,7 @@ version: 2 jobs: + # All checks on the codebase that can run in parallel to build_library sanity: docker: # We don't use this Rust version but need an image with a Rust environment @@ -25,11 +26,14 @@ jobs: - run: name: Run linter command: cargo clippy -- -D warnings + - run: + name: Run unit tests + command: cargo test - run: name: Run shellcheck command: find . -name "*.sh" -exec shellcheck {} + - build_libwasmvm: + build_library: docker: # We don't use this Rust version but need an image with a Rust environment - image: circleci/rust:1.47.0-buster @@ -41,9 +45,6 @@ jobs: - run: name: Show version information command: rustc --version; cargo --version; rustup --version - - run: - name: Run tests - command: cargo test - run: name: Create release build of libwasmvm command: make build-rust @@ -115,15 +116,53 @@ jobs: git commit --allow-empty -m '[skip ci] Built release libraries' git push origin $CIRCLE_BRANCH + deploy_to_github_releases: + machine: + image: ubuntu-1604:202010-01 + steps: + - checkout + - run: + name: Install ghr + command: | + go get github.com/tcnksm/ghr + ghr --version + - run: + name: Build static library for Alpine + command: make release-build-alpine + - run: + name: Debug build results + command: ls -l ./api + - run: + name: Collect artifacts + command: | + mkdir artifacts + cp ./api/libwasmvm_muslc.a artifacts + - run: + name: Create checksums + working_directory: artifacts + command: sha256sum * > checksums.txt && cat checksums.txt + - run: + name: Publish artifacts on GitHub + command: | + TAG="$CIRCLE_TAG" + TITLE="$TAG" + BODY="Build artifacts generated at this tag." + ghr -t "$GITHUB_TOKEN" \ + -u "$CIRCLE_PROJECT_USERNAME" -r "$CIRCLE_PROJECT_REPONAME" \ + -c "$CIRCLE_SHA1" \ + -n "$TITLE" -b "$BODY" \ + -delete \ + "$TAG" ./artifacts/ + workflows: version: 2 build_and_test: jobs: - sanity - - build_libwasmvm + - build_library - test: requires: - - build_libwasmvm + - build_library # This is long running, so only double-check on merge commits # ensures that all code works on alpine linux - test_alpine_build: @@ -136,6 +175,9 @@ workflows: - master # Run only on master, not on tags (auto-build on merge PR) - deploy_to_git: + requires: + - sanity + - test filters: tags: ignore: @@ -143,3 +185,12 @@ workflows: branches: only: - master + - deploy_to_github_releases: + requires: + - sanity + - test + filters: + tags: + only: /^v[0-9]+\.[0-9]+\.[0-9]+.*/ + branches: + ignore: /.*/ diff --git a/.gitignore b/.gitignore index 5f67694a3..1335c639a 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ lib*.a # artifacts from compile tests +artifacts/ muslc.exe tmp a.out diff --git a/Cargo.lock b/Cargo.lock index 15951ad16..15781428e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1130,7 +1130,7 @@ checksum = "aeb1956b19469d1c5e63e459d29e7b5aa0f558d9f16fcef09736f8a265e6c10a" [[package]] name = "wasmvm" -version = "0.12.0-alpha1" +version = "0.12.0-alpha2" dependencies = [ "cbindgen", "cosmwasm-std", diff --git a/Cargo.toml b/Cargo.toml index e474ab7b1..4701a3286 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "wasmvm" -version = "0.12.0-alpha1" +version = "0.12.0-alpha2" authors = ["Ethan Frey "] edition = "2018" description = "Go bindings for cosmwasm contracts"