diff --git a/.github/workflows/build-artifacts.yml b/.github/workflows/build-artifacts.yml deleted file mode 100644 index 77ed58e7e16..00000000000 --- a/.github/workflows/build-artifacts.yml +++ /dev/null @@ -1,128 +0,0 @@ -name: "Build Artifacts" - -on: - workflow_dispatch: - push: - branches: - - update-benchmark-workflow - 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 2a2b1123cb5..2d821850d75 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -91,15 +91,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 11eb9128c3d..c99521a2cfa 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -4,13 +4,99 @@ on: branches: - releases jobs: - update_release_draft: - runs-on: ubuntu-latest + build-and-publish: + runs-on: + - self-hosted + - linux + - x64 + - sre + strategy: + fail-fast: true steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - uses: release-drafter/release-drafter@v5 - env: - GITHUB_TOKEN: ${{ secrets.COMPOSABLE_GITHUB_TOKEN }} + - 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 + + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + + - name: Install srtool + run: | + cargo install --git https://github.com/chevdor/srtool-cli + cargo install --locked --git https://github.com/chevdor/subwasm --tag v0.16.1 + + - name: Runtime wasm builds + id: runtime_release + run: | + .maintain/runtime_release.sh + + - uses: release-drafter/release-drafter@v5 + id: release_drafter + + - name: Set Permission + continue-on-error: true + run: | + sudo su runner + + - uses: actions/setup-node@v2 + with: + node-version: '16' + + - name: Add runtime metadata to release body + run: | + cd scripts/github && npm install + printf "\n%s" "${{ steps.release_drafter.outputs.body }}" >> $GITHUB_WORKSPACE/release.md + npm run update-release-body -- --id=${{ steps.release_drafter.outputs.id }} --repo=composableFi/composable --body="$GITHUB_WORKSPACE/release.md" + cd $GITHUB_WORKSPACE + + - name: Upload Dali wasm + id: upload-dali-wasm + if: env.dali_wasm == 1 + uses: actions/upload-release-asset@v1 + with: + upload_url: ${{ steps.release_drafter.outputs.upload_url }} + asset_path: ./runtime/dali/target/srtool/release/wbuild/dali-runtime/dali_runtime.compact.wasm + asset_name: dali_runtime.compact.wasm + asset_content_type: application/octet-stream + + - name: Upload Picasso wasm + id: upload-picasso-wasm + if: env.picasso_wasm == 1 + uses: actions/upload-release-asset@v1 + with: + upload_url: ${{ steps.release_drafter.outputs.upload_url }} + asset_path: ./runtime/picasso/target/srtool/release/wbuild/picasso-runtime/picasso_runtime.compact.wasm + asset_name: picasso_runtime.compact.wasm + asset_content_type: application/octet-stream + + - name: Upload Composable wasm + id: upload-composable-wasm + if: env.composable_wasm == 1 + uses: actions/upload-release-asset@v1 + with: + upload_url: ${{ steps.release_drafter.outputs.upload_url }} + asset_path: ./runtime/composable/target/srtool/release/wbuild/composable-runtime/composable_runtime.compact.wasm + asset_name: composable_runtime.compact.wasm + asset_content_type: application/octet-stream + + - name: 🔨 Build Composable Binary + run: | + .maintain/client_release.sh + + - name: Upload Composable Node Binaries + id: upload-composable-binary + if: env.client_release == 1 + uses: actions/upload-release-asset@v1 + + with: + upload_url: ${{ steps.release_drafter.outputs.upload_url }} + asset_path: ./target/release/composable + asset_name: composable + asset_content_type: application/octet-stream diff --git a/.maintain/check_runtime.sh b/.maintain/check_runtime.sh index 943d4200686..fbe276cf70b 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