From 632e93e68f1b6e6e5f1d7f4d4e3134e2683ab912 Mon Sep 17 00:00:00 2001 From: Seun Lanlege Date: Sun, 23 Jan 2022 04:59:12 +0100 Subject: [PATCH] clean up release pipeline (#541) (#545) --- .github/workflows/build-artifacts.yml | 126 -------------------------- .github/workflows/check.yml | 8 +- .github/workflows/release-drafter.yml | 10 +- .maintain/check_runtime.sh | 6 +- docker-compose.yml | 21 ----- 5 files changed, 7 insertions(+), 164 deletions(-) delete mode 100644 .github/workflows/build-artifacts.yml delete mode 100644 docker-compose.yml diff --git a/.github/workflows/build-artifacts.yml b/.github/workflows/build-artifacts.yml deleted file mode 100644 index 3085d577e85..00000000000 --- a/.github/workflows/build-artifacts.yml +++ /dev/null @@ -1,126 +0,0 @@ -name: "Build Artifacts" - -on: - workflow_dispatch: - push: - tags: - - '*' - -env: - DOCKER_USER_OPTION: '$UID:$GID' - SCCACHE_GCS_BUCKET: 'composable-build-artefacts' - RUSTC_WRAPPER: "/home/runner/.cargo/bin/sccache" - SCCACHE_GCS_RW_MODE: "READ_WRITE" - -jobs: - build-and-publish: - runs-on: - - self-hosted - - linux - - x64 - - sre - strategy: - fail-fast: true - steps: - - name: Clean up - continue-on-error: true - run: | - sudo chown -R $USER:$USER $GITHUB_WORKSPACE - docker system prune --force --all --volumes - - - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Set env - run: | - echo "RELEASE_VERSION=$(git tag --sort=committerdate | grep -E '^v[0-9]' | tail -1 )" >> $GITHUB_ENV - make version - - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - - - name: 🔨 Build and Upload Composable Binary - id: client_release - run: | - .maintain/client_release.sh - - - name: Echo Output - run: echo ${{ env.picasso-wasm }} - - - name: Build wasm with srtool - id: runtime_release - run: | - .maintain/runtime_release.sh - - - name: Upload Compact Picasso wasm # TODO only upload wasm that has changed - uses: svenstaro/upload-release-action@v2 - if: "${{ env.picasso-wasm }} == 1" - with: - repo_token: ${{ secrets.COMPOSABLE_GITHUB_TOKEN }} - file: ./runtime/picasso/target/srtool/release/wbuild/picasso-runtime/picasso_runtime.compact.wasm - asset_name: picasso_runtime.compact.compressed.wasm - tag: ${{ github.ref }} - overwrite: true - - - name: Upload Compact Dali wasm # TODO only upload wasm that has changed - uses: svenstaro/upload-release-action@v2 - if: "${{ env.dali-wasm }} == 1" - with: - repo_token: ${{ secrets.COMPOSABLE_GITHUB_TOKEN }} - file: ./runtime/dali/target/srtool/release/wbuild/dali-runtime/dali_runtime.compact.wasm - asset_name: dali_runtime.compact.compressed.wasm - tag: ${{ github.ref }} - overwrite: true - - - name: Upload Compact Composable wasm # TODO only upload wasm that has changed - uses: svenstaro/upload-release-action@v2 - if: "${{ env.composable-wasm }} == 1" - with: - repo_token: ${{ secrets.COMPOSABLE_GITHUB_TOKEN }} - file: ./runtime/picasso/target/srtool/release/wbuild/composable-runtime/composable_runtime.compact.wasm - asset_name: composable_runtime.compact.compressed.wasm - tag: ${{ github.ref }} - overwrite: true - - - name: Upload Binary on Release # TODO Only upload binary if client files have changed - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.COMPOSABLE_GITHUB_TOKEN }} - file: target/release/composable - asset_name: composable - tag: ${{ github.ref }} - overwrite: true - - - name: Update Release Note - run: sed -i '1i # Code ' release.md - - - name: Release - uses: softprops/action-gh-release@v1 - if: startsWith(github.ref, 'refs/tags/') - with: - body_path: release.md - token: ${{ secrets.COMPOSABLE_GITHUB_TOKEN }} - - - dali-chacha-client-release: - needs: [build-and-publish] - runs-on: - - self-hosted - - linux - - X64 - - ansible-runner - - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Set env - run: | - echo "RELEASE_VERSION=$(git tag --sort=committerdate | grep -E '^v[0-9]' | tail -1 )" >> $GITHUB_ENV - - - name: Run ansible playbook - run: ansible-playbook -l _environment_testnet client-upgrade.yml -i gcp.yaml --user runner -e 'ansible_python_interpreter=/usr/bin/python3' diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index b43adb518fd..80036954f7b 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -89,15 +89,9 @@ jobs: run: | rustup show - uses: actions/checkout@v2 - - name: Run Test (with coverage) + - name: Run Test run: | SKIP_WASM_BUILD=1 cargo test --workspace --locked --release --verbose --features=runtime-benchmarks --exclude=integration-tests - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1 - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: lcov.info - fail_ci_if_error: false linters: name: Linters diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index 754d166ba03..038a1cdc5c6 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -15,8 +15,6 @@ jobs: - sre strategy: fail-fast: true - matrix: - runtime: [picasso] steps: - name: Clean up continue-on-error: true @@ -61,7 +59,7 @@ jobs: npm run update-release-body -- --id=${{ steps.release_drafter.outputs.id }} --repo=composableFi/composable --body="$GITHUB_WORKSPACE/release.md" cd $GITHUB_WORKSPACE - - name: Upload Compact Dali wasm + - name: Upload Dali wasm id: upload-dali-wasm if: env.dali_wasm == 1 uses: actions/upload-release-asset@v1 @@ -71,7 +69,7 @@ jobs: asset_name: dali_runtime.compact.wasm asset_content_type: application/octet-stream - - name: Upload Compact Picasso wasm + - name: Upload Picasso wasm id: upload-picasso-wasm if: env.picasso_wasm == 1 uses: actions/upload-release-asset@v1 @@ -81,7 +79,7 @@ jobs: asset_name: picasso_runtime.compact.wasm asset_content_type: application/octet-stream - - name: Upload Compact Composable wasm + - name: Upload Composable wasm id: upload-composable-wasm if: env.composable_wasm == 1 uses: actions/upload-release-asset@v1 @@ -91,7 +89,7 @@ jobs: asset_name: composable_runtime.compact.wasm asset_content_type: application/octet-stream - - name: 🔨 Build and Upload Composable Binary + - name: 🔨 Build Composable Binary run: | .maintain/client_release.sh diff --git a/.maintain/check_runtime.sh b/.maintain/check_runtime.sh index a2b14b8bb95..7a797af9aae 100755 --- a/.maintain/check_runtime.sh +++ b/.maintain/check_runtime.sh @@ -24,17 +24,15 @@ simnode_check() { VERSIONS_FILE="$1" if has_runtime_changes "${BASE_BRANCH}" "${GITHUB_REF_NAME}" "$2" && check_runtime "$VERSIONS_FILE" "$2" then - echo "Wasm sources have changed" + echo "Wasm sources have changed for $3" echo "RUNTIME_CHECK=1" >> $GITHUB_ENV - else - echo "RUNTIME_CHECK=0" >> $GITHUB_ENV fi } for i in "${VERSIONS_FILES[@]}"; do while IFS=',' read -r output chain folder; do boldprint "Check if the wasm sources changed for $chain" - simnode_check $output $folder + simnode_check $output $folder $chain done <<< "$i" done diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index f68c3d073b4..00000000000 --- a/docker-compose.yml +++ /dev/null @@ -1,21 +0,0 @@ -services: - dev: - container_name: node-template - image: composablefi/composable:latest - working_dir: /usr/src/app - ports: - - "8000:8000" - environment: - - CARGO_HOME=/usr/src/app/.cargo - volumes: - - .:/usr/src/app/composable - - type: bind - source: ./.local - target: /root/.local - command: cargo build --release - watchtower: - image: containrrr/watchtower - volumes: - - /var/run/docker.sock:/var/run/docker.sock - - ~/.docker/config.json:/config.json - command: --interval 30 \ No newline at end of file