From 16ac299e3a695c7cdbd540c7375dabf0cbca25e1 Mon Sep 17 00:00:00 2001 From: DeepakBomjan <44976635+DeepakBomjan@users.noreply.github.com> Date: Thu, 24 Oct 2024 12:13:46 +0545 Subject: [PATCH 1/7] ci: test release pipeline --- .github/release.yml | 25 ++++++++++ .github/workflows/release.yml | 91 +++++++++++++++++++++++++++++++++++ 2 files changed, 116 insertions(+) create mode 100644 .github/release.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 0000000..ebc794d --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,25 @@ +# .github/release.yml + +changelog: + exclude: + labels: + - cicd + - scripts + - test + categories: + - title: Breaking Changes ๐Ÿ›  + labels: + - Major + - breaking-change + - title: New Features ๐ŸŽ‰ + labels: + - Minor + - enhancement + - Feature + - title: Bug Fixes ๐Ÿ› + labels: + - Patch + - bug + - title: Other Changes ๐Ÿ“ + labels: + - "*" \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..636041e --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,91 @@ +name: Pre-release +on: + push: + tags: + - '*' + branches: + - '**' +permissions: + contents: write + packages: write + repository-projects: write + +jobs: + build_javascore: + name: Build Javascore Contracts + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + submodules: true + + build_wasm: + name: Build Cosmwasm Contracts + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v3 + with: + submodules: true + + - name: Cache Rust dependencies + uses: Swatinem/rust-cache@v2 + - name: Compile WASM + run: | + # rustup component add rustfmt --toolchain 1.78.0-x86_64-unknown-linux-gnu + # rustup component add clippy --toolchain 1.78.0-x86_64-unknown-linux-gnu + bash ./scripts/optimize-cosmwasm.sh + cd artifacts/archway && zip -r ../../cosmwasm-contracts.zip . -j + + - name: Upload Artifacts + uses: actions/upload-artifact@v4 + with: + name: cosmwasm-contracts + path: cosmwasm-contracts.zip + + release: + name: Release and Publish + runs-on: ubuntu-latest + needs: + - build_wasm + steps: + - name: Initialize variables + id: vars + run: | + echo ยซ::set-output name=date::$(date +'%Y-%m-%d')ยป + echo ยซ::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)ยป + + - name: Download Cosmwasm Artifacts + uses: actions/download-artifact@v4 + with: + name: cosmwasm-contracts + path: cosmwasm-contracts + + - name: Unzip Cosmwasm Artifacts + run: unzip cosmwasm-contracts/cosmwasm-contracts.zip -d cosmwasm-contracts && rm -rf cosmwasm-contracts/cosmwasm-contracts.zip + + - name: Changelog + uses: scottbrenner/generate-changelog-action@master + id: Changelog + env: + REPO: ${{ github.repository }} + + - name: Generate checksum + uses: jmgilman/actions-generate-checksum@v1 + with: + patterns: | + ./cosmwasm-contracts/* + output: check256sums.txt + + - name: Create Release + id: create_release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + token: ${{ secrets.GITHUB_TOKEN }} + body: | + ${{ steps.Changelog.outputs.changelog }} + files: | + ./cosmwasm-contracts/* + check256sums.txt \ No newline at end of file From 8609f3b1d39da504524a8b80fc431951d4feaeed Mon Sep 17 00:00:00 2001 From: DeepakBomjan <44976635+DeepakBomjan@users.noreply.github.com> Date: Thu, 24 Oct 2024 12:22:17 +0545 Subject: [PATCH 2/7] ci: debug build --- .github/workflows/release.yml | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 636041e..cb5abae 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,15 +11,6 @@ permissions: repository-projects: write jobs: - build_javascore: - name: Build Javascore Contracts - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 - with: - submodules: true - build_wasm: name: Build Cosmwasm Contracts runs-on: ubuntu-latest @@ -33,9 +24,9 @@ jobs: uses: Swatinem/rust-cache@v2 - name: Compile WASM run: | - # rustup component add rustfmt --toolchain 1.78.0-x86_64-unknown-linux-gnu - # rustup component add clippy --toolchain 1.78.0-x86_64-unknown-linux-gnu - bash ./scripts/optimize-cosmwasm.sh + sudo chmod -R 777 artifacts + sudo chmod -R 777 scripts + bash ./scripts/generate_wasm.sh cd artifacts/archway && zip -r ../../cosmwasm-contracts.zip . -j - name: Upload Artifacts From 08f2d5e7bf7ad9ea12c755c23ebce00ffb83414f Mon Sep 17 00:00:00 2001 From: DeepakBomjan <44976635+DeepakBomjan@users.noreply.github.com> Date: Thu, 24 Oct 2024 14:09:39 +0545 Subject: [PATCH 3/7] ci: debug --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cb5abae..cf5b951 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,6 +27,8 @@ jobs: sudo chmod -R 777 artifacts sudo chmod -R 777 scripts bash ./scripts/generate_wasm.sh + ls -la + ls artifacts cd artifacts/archway && zip -r ../../cosmwasm-contracts.zip . -j - name: Upload Artifacts From 6e096c681bef94ecd8967e5b8f3f073856692969 Mon Sep 17 00:00:00 2001 From: DeepakBomjan <44976635+DeepakBomjan@users.noreply.github.com> Date: Thu, 24 Oct 2024 14:11:23 +0545 Subject: [PATCH 4/7] ci: debug --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cf5b951..14081d3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,8 +24,8 @@ jobs: uses: Swatinem/rust-cache@v2 - name: Compile WASM run: | - sudo chmod -R 777 artifacts - sudo chmod -R 777 scripts + # sudo chmod -R 777 artifacts + # sudo chmod -R 777 scripts bash ./scripts/generate_wasm.sh ls -la ls artifacts From 8b55e3110b12052034dd56fafa786edceaf407be Mon Sep 17 00:00:00 2001 From: DeepakBomjan <44976635+DeepakBomjan@users.noreply.github.com> Date: Thu, 24 Oct 2024 14:17:46 +0545 Subject: [PATCH 5/7] ci: fix rust version --- .github/workflows/release.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 14081d3..63d6494 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,6 +22,18 @@ jobs: - name: Cache Rust dependencies uses: Swatinem/rust-cache@v2 + + - name: Install stable toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: 1.69.0 + target: wasm32-unknown-unknown + override: true + profile: minimal + + - name: Install cw-check + run: | + cargo install cosmwasm-check@1.4.1 --locked - name: Compile WASM run: | # sudo chmod -R 777 artifacts From 8dad31dbe3926e16a3d6287727e650289639b519 Mon Sep 17 00:00:00 2001 From: DeepakBomjan <44976635+DeepakBomjan@users.noreply.github.com> Date: Thu, 24 Oct 2024 14:27:14 +0545 Subject: [PATCH 6/7] ci: update rust to 1.70.0 --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 63d6494..b0a56c2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,11 +22,11 @@ jobs: - name: Cache Rust dependencies uses: Swatinem/rust-cache@v2 - + - name: Install stable toolchain uses: actions-rs/toolchain@v1 with: - toolchain: 1.69.0 + toolchain: 1.70.0 target: wasm32-unknown-unknown override: true profile: minimal From 91859492cf08f894377c47c4ea10228c841ac6d7 Mon Sep 17 00:00:00 2001 From: DeepakBomjan <44976635+DeepakBomjan@users.noreply.github.com> Date: Thu, 24 Oct 2024 14:41:09 +0545 Subject: [PATCH 7/7] ci: cleanup --- .github/workflows/release.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b0a56c2..4cade3b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,8 +3,6 @@ on: push: tags: - '*' - branches: - - '**' permissions: contents: write packages: write @@ -39,8 +37,6 @@ jobs: # sudo chmod -R 777 artifacts # sudo chmod -R 777 scripts bash ./scripts/generate_wasm.sh - ls -la - ls artifacts cd artifacts/archway && zip -r ../../cosmwasm-contracts.zip . -j - name: Upload Artifacts