diff --git a/.github/workflows/naming-test.full b/.github/workflows/naming-test.full deleted file mode 100644 index 04fe9c0b84..0000000000 --- a/.github/workflows/naming-test.full +++ /dev/null @@ -1,226 +0,0 @@ -name: Test naming -on: - push: - tags: - - name+* - workflow_dispatch: -env: - SUBWASM_VERSION: 0.16.1 - astar_runtime_version: '' - shiden_runtime_version: '' - shibuya_runtime_version: '' - -jobs: - srtool: - runs-on: ubuntu-latest - strategy: - matrix: - chain: ["astar", "shiden", "shibuya"] - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Srtool build - id: srtool_build - uses: chevdor/srtool-actions@v0.7.0 - with: - # TODO: Remove tag field once we uplifted to the latest polkadot 0.9.41. - tag: 1.66.1 - chain: ${{ matrix.chain }} - runtime_dir: runtime/${{ matrix.chain }} - - - name: Summary - run: | - echo '${{ steps.srtool_build.outputs.json }}' | jq > ${{ matrix.chain }}-srtool-digest.json - cat ${{ matrix.chain }}-srtool-digest.json - echo "Compact Runtime: ${{ steps.srtool_build.outputs.wasm }}" - echo "Compressed Runtime: ${{ steps.srtool_build.outputs.wasm_compressed }}" - cp ${{ steps.srtool_build.outputs.wasm }} ${{ matrix.chain }}_runtime.compact.wasm - cp ${{ steps.srtool_build.outputs.wasm_compressed }} ${{ matrix.chain }}_runtime.compact.compressed.wasm - - # it takes a while to build the runtime, so let's save the artifact as soon as we have it - - name: Archive Artifacts for ${{ matrix.chain }} - uses: actions/upload-artifact@v3 - with: - name: ${{ matrix.chain }}-runtime - path: | - ${{ matrix.chain }}_runtime.compact.wasm - ${{ matrix.chain }}_runtime.compact.compressed.wasm - ${{ matrix.chain }}-srtool-digest.json - - # We now get extra information thanks to subwasm - - name: Install subwasm - run: | - wget https://github.com/chevdor/subwasm/releases/download/v${{ env.SUBWASM_VERSION }}/subwasm_linux_amd64_v${{ env.SUBWASM_VERSION }}.deb - sudo dpkg -i subwasm_linux_amd64_v${{ env.SUBWASM_VERSION }}.deb - subwasm --version - - - name: Show Runtime information - shell: bash - run: | - subwasm info ${{ steps.srtool_build.outputs.wasm }} - subwasm info ${{ steps.srtool_build.outputs.wasm_compressed }} - subwasm --json info ${{ steps.srtool_build.outputs.wasm }} > ${{ matrix.chain }}-info.json - subwasm --json info ${{ steps.srtool_build.outputs.wasm_compressed }} > ${{ matrix.chain }}-compressed-info.json - - - name: Extract the metadata - shell: bash - run: | - subwasm meta ${{ steps.srtool_build.outputs.wasm }} - subwasm --json meta ${{ steps.srtool_build.outputs.wasm }} > ${{ matrix.chain }}-metadata.json - - - name: Check the metadata diff - shell: bash - # the following subwasm call will error for chains that are not known and/or live, that includes shell for instance - run: | - subwasm diff ${{ steps.srtool_build.outputs.wasm }} --chain-b ${{ matrix.chain }} || \ - echo "Subwasm call failed, check the logs. This is likely because ${{ matrix.chain }} is not known by subwasm" | \ - tee ${{ matrix.chain }}-diff.txt - - - name: Archive Subwasm results - uses: actions/upload-artifact@v3 - with: - name: ${{ matrix.chain }}-runtime - path: | - ${{ matrix.chain }}-info.json - ${{ matrix.chain }}-compressed-info.json - ${{ matrix.chain }}-metadata.json - ${{ matrix.chain }}-diff.txt - - publish-release-draft: - needs: [native-linux, evm-tracing-native-linux, srtool] - runs-on: ubuntu-latest - outputs: - release_url: ${{ steps.create-release.outputs.html_url }} - upload_url: ${{ steps.create-release.outputs.upload_url }} - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Download astar runtime - uses: actions/download-artifact@v3 - with: - name: astar-runtime - path: runtime-artifacts - - - name: Download shiden runtime - uses: actions/download-artifact@v3 - with: - name: shiden-runtime - path: runtime-artifacts - - - name: Download shibuya runtime - uses: actions/download-artifact@v3 - with: - name: shibuya-runtime - path: runtime-artifacts - - - name: Use Node.js 18.x - uses: actions/setup-node@v2 - with: - node-version: 18.x - - - name: Get the latest release - id: latest-release - uses: pozetroninc/github-action-get-latest-release@v0.5.0 - with: - repository: AstarNetwork/Astar - excludes: "prerelease, draft" - - - name: Generate Release Body - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - id: generate-release-body - run: | - cd .github/scripts - yarn - yarn -s run ts-node generate-release-body.ts generate --owner "${{ github.repository_owner }}" --repo "$(basename ${{ github.repository }})" --from "${{ steps.latest-release.outputs.release }}" --to "${{ github.ref_name }}" --srtool-report-folder '../../runtime-artifacts/' > ../../body.md - - - name: Create Release Draft - id: create-release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref_name }} - release_name: ${{ github.ref_name }} - body_path: body.md - draft: true - - upload-runtimes: - needs: publish-release-draft - runs-on: ubuntu-latest - strategy: - matrix: - chain: ["astar", "shiden", "shibuya"] - steps: - - name: Download runtime - uses: actions/download-artifact@v3 - with: - name: ${{ matrix.chain }}-runtime - - - name: Get runtime version - id: get-runtime-version - run: | - ls -R - chain=${{ matrix.chain }} - runtime_version=$(cat $chain-compressed-info.json | jq '.core_version' | tr -d '"' | cut -d ' ' -f 1) - echo $runtime_version - echo "${{ matrix.chain }}=$(echo $runtime_version)" >> $GITHUB_OUTPUT - - - name: Upload ${{ matrix.chain }} Wasm - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.publish-release-draft.outputs.upload_url }} - asset_path: ${{ matrix.chain }}_runtime.compact.compressed.wasm - asset_name: ${{ steps.get-runtime-version.outputs.astar }}.wasm - asset_content_type: application/wasm - - - name: Upload ${{ matrix.chain }} Metadata - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.publish-release-draft.outputs.upload_url }} - asset_path: ${{ matrix.chain }}-metadata.json - asset_name: ${{ matrix.chain }}-metadata.json - asset_content_type: application/json - - - name: Upload ${{ matrix.chain }} Compressed Info - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.publish-release-draft.outputs.upload_url }} - asset_path: ${{ matrix.chain }}-compressed-info.json - asset_name: ${{ matrix.chain }}-compressed-info.json - asset_content_type: application/json - - - name: Upload ${{ matrix.chain }} Srtool Digest - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.publish-release-draft.outputs.upload_url }} - asset_path: ${{ matrix.chain }}-srtool-digest.json - asset_name: ${{ matrix.chain }}-srtool-digest.json - asset_content_type: application/json - - - name: Print version - run: echo ${{ steps.get-runtime-version.outputs.astar }} - - outputs: - astar_runtime_version: ${{ steps.get-runtime-version.outputs.astar }} - shiden_runtime_version: ${{ steps.get-runtime-version.outputs.shiden }} - shibuya_runtime_version: ${{ steps.get-runtime-version.outputs.shibuya }} - - tracing-runtimes: - needs: upload-runtimes - runs-on: ubuntu-latest - steps: - - name: Get Astar runtime version - run: echo ${{needs.upload-runtimes.outputs.astar_runtime_version}} \ No newline at end of file diff --git a/.github/workflows/release.save b/.github/workflows/release.save new file mode 100644 index 0000000000..86562fa624 --- /dev/null +++ b/.github/workflows/release.save @@ -0,0 +1,440 @@ +name: Release Build +on: + push: + tags: + - v[0-9]+.[0-9]+.[0-9]+* + workflow_dispatch: +env: + SUBWASM_VERSION: 0.16.1 +jobs: + checks-and-tests: + runs-on: [self-hosted, Linux, X64] + steps: + - name: Free disk space + run: | + sudo rm -rf /usr/share/dotnet + sudo rm -rf /usr/local/lib/android + sudo rm -rf /opt/ghc + sudo rm -rf "/usr/local/share/boost" + sudo rm -rf "$AGENT_TOOLSDIRECTORY" + df -h + + - name: Checkout the source code + uses: actions/checkout@v3 + with: + submodules: true + + - name: Install deps + run: sudo apt -y install protobuf-compiler + + - name: Install & display rust toolchain + run: rustup show + + - name: Check targets are installed correctly + run: rustup target list --installed + + - name: Check all features compilation + run: cargo check --verbose --features try-runtime,runtime-benchmarks --locked + + - name: Run all tests + run: cargo test --features try-runtime,runtime-benchmarks --locked + + native-linux: + needs: checks-and-tests + runs-on: [self-hosted, Linux, X64] + strategy: + matrix: + target: + - x86_64-unknown-linux-gnu + - aarch64-unknown-linux-gnu + + steps: + - name: Checkout the source code + uses: actions/checkout@v3 + with: + submodules: true + + - name: Install deps + run: sudo apt -y install protobuf-compiler + + - name: aarch64 setup + if: contains(matrix.target, 'aarch64') + shell: bash + run: | + sudo apt update + sudo apt install -y gcc-multilib g++-multilib + sudo apt install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu + + mkdir -p .cargo + touch .cargo/config + printf '[target.aarch64-unknown-linux-gnu]\nlinker = "aarch64-linux-gnu-gcc"' >> .cargo/config + + - name: x86_64 setup + if: contains(matrix.target, 'x86_64') + run: | + mkdir -p .cargo + touch .cargo/config + printf '[target.x86_64-unknown-linux-gnu]\nrustflags = ["-Clink-arg=-fuse-ld=lld"]' >> .cargo/config + + - name: Install & display rust toolchain + run: rustup show + + - name: Add aarch64 target + if: contains(matrix.target, 'aarch64') + run: rustup target add ${{ matrix.target }} + + - name: Check targets are installed correctly + run: rustup target list --installed + + - name: Build optimized binary + run: CARGO_PROFILE_RELEASE_LTO=true RUSTFLAGS="-C codegen-units=1" cargo build --release --target ${{ matrix.target }} --verbose --locked + + - name: Set artifact name + env: + TARGET: ${{ matrix.target }} + id: artifact-name + run: echo "::set-output name=name::astar-ubuntu-latest-${TARGET%%-*}" + + - uses: actions/upload-artifact@v3 + with: + name: ${{ steps.artifact-name.outputs.name }} + path: target/${{ matrix.target }}/release/astar-collator + + evm-tracing-native-linux: + needs: checks-and-tests + runs-on: [self-hosted, Linux, X64] + steps: + + - name: Checkout the source code + uses: actions/checkout@v3 + with: + submodules: true + + - name: Install deps + run: sudo apt -y install protobuf-compiler + + - name: x86_64 setup + run: | + mkdir -p .cargo + touch .cargo/config + printf '[target.x86_64-unknown-linux-gnu]\nrustflags = ["-Clink-arg=-fuse-ld=lld"]' >> .cargo/config + + - name: Install & display rust toolchain + run: rustup show + + - name: Check targets are installed correctly + run: rustup target list --installed + + - name: Build optimized binary with evm tracing + run: CARGO_PROFILE_RELEASE_LTO=true RUSTFLAGS="-C codegen-units=1" cargo build --release --target x86_64-unknown-linux-gnu --features evm-tracing --verbose --locked + + - uses: actions/upload-artifact@v3 + with: + name: astar-evm-tracing-ubuntu-latest-x86_64-unknown-linux-gnu + path: target/x86_64-unknown-linux-gnu/release/astar-collator + + - name: rename evm tracing runtimes + run: | + mv target/x86_64-unknown-linux-gnu/release/wbuild/astar-runtime/astar_runtime.compact.compressed.wasm target/x86_64-unknown-linux-gnu/release/wbuild/astar-runtime/astar_evm_tracing_runtime.compact.compressed.wasm + mv target/x86_64-unknown-linux-gnu/release/wbuild/shiden-runtime/shiden_runtime.compact.compressed.wasm target/x86_64-unknown-linux-gnu/release/wbuild/shiden-runtime/shiden_evm_tracing_runtime.compact.compressed.wasm + mv target/x86_64-unknown-linux-gnu/release/wbuild/shibuya-runtime/shibuya_runtime.compact.compressed.wasm target/x86_64-unknown-linux-gnu/release/wbuild/shibuya-runtime/shibuya_evm_tracing_runtime.compact.compressed.wasm + + - uses: actions/upload-artifact@v3 + with: + name: astar-evm-tracing-runtime + path: target/x86_64-unknown-linux-gnu/release/wbuild/astar-runtime/astar_evm_tracing_runtime.compact.compressed.wasm + + - uses: actions/upload-artifact@v3 + with: + name: shiden-evm-tracing-runtime + path: target/x86_64-unknown-linux-gnu/release/wbuild/shiden-runtime/shiden_evm_tracing_runtime.compact.compressed.wasm + + - uses: actions/upload-artifact@v3 + with: + name: shibuya-evm-tracing-runtime + path: target/x86_64-unknown-linux-gnu/release/wbuild/shibuya-runtime/shibuya_evm_tracing_runtime.compact.compressed.wasm + + srtool: + needs: checks-and-tests + runs-on: ubuntu-latest + strategy: + matrix: + chain: ["astar", "shiden", "shibuya"] + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Srtool build + id: srtool_build + uses: chevdor/srtool-actions@v0.7.0 + with: + # TODO: Remove tag field once we uplifted to the latest polkadot 0.9.41. + tag: 1.66.1 + chain: ${{ matrix.chain }} + runtime_dir: runtime/${{ matrix.chain }} + + - name: Summary + run: | + echo '${{ steps.srtool_build.outputs.json }}' | jq > ${{ matrix.chain }}-srtool-digest.json + cat ${{ matrix.chain }}-srtool-digest.json + echo "Compact Runtime: ${{ steps.srtool_build.outputs.wasm }}" + echo "Compressed Runtime: ${{ steps.srtool_build.outputs.wasm_compressed }}" + cp ${{ steps.srtool_build.outputs.wasm }} ${{ matrix.chain }}_runtime.compact.wasm + cp ${{ steps.srtool_build.outputs.wasm_compressed }} ${{ matrix.chain }}_runtime.compact.compressed.wasm + + # it takes a while to build the runtime, so let's save the artifact as soon as we have it + - name: Archive Artifacts for ${{ matrix.chain }} + uses: actions/upload-artifact@v3 + with: + name: ${{ matrix.chain }}-runtime + path: | + ${{ matrix.chain }}_runtime.compact.wasm + ${{ matrix.chain }}_runtime.compact.compressed.wasm + ${{ matrix.chain }}-srtool-digest.json + + # We now get extra information thanks to subwasm + - name: Install subwasm + run: | + wget https://github.com/chevdor/subwasm/releases/download/v${{ env.SUBWASM_VERSION }}/subwasm_linux_amd64_v${{ env.SUBWASM_VERSION }}.deb + sudo dpkg -i subwasm_linux_amd64_v${{ env.SUBWASM_VERSION }}.deb + subwasm --version + + - name: Show Runtime information + shell: bash + run: | + subwasm info ${{ steps.srtool_build.outputs.wasm }} + subwasm info ${{ steps.srtool_build.outputs.wasm_compressed }} + subwasm --json info ${{ steps.srtool_build.outputs.wasm }} > ${{ matrix.chain }}-info.json + subwasm --json info ${{ steps.srtool_build.outputs.wasm_compressed }} > ${{ matrix.chain }}-compressed-info.json + + - name: Extract the metadata + shell: bash + run: | + subwasm meta ${{ steps.srtool_build.outputs.wasm }} + subwasm --json meta ${{ steps.srtool_build.outputs.wasm }} > ${{ matrix.chain }}-metadata.json + + - name: Check the metadata diff + shell: bash + # the following subwasm call will error for chains that are not known and/or live, that includes shell for instance + run: | + subwasm diff ${{ steps.srtool_build.outputs.wasm }} --chain-b ${{ matrix.chain }} || \ + echo "Subwasm call failed, check the logs. This is likely because ${{ matrix.chain }} is not known by subwasm" | \ + tee ${{ matrix.chain }}-diff.txt + + - name: Archive Subwasm results + uses: actions/upload-artifact@v3 + with: + name: ${{ matrix.chain }}-runtime + path: | + ${{ matrix.chain }}-info.json + ${{ matrix.chain }}-compressed-info.json + ${{ matrix.chain }}-metadata.json + ${{ matrix.chain }}-diff.txt + + publish-release-draft: + needs: [native-linux, evm-tracing-native-linux, srtool] + runs-on: ubuntu-latest + outputs: + release_url: ${{ steps.create-release.outputs.html_url }} + upload_url: ${{ steps.create-release.outputs.upload_url }} + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Download astar runtime + uses: actions/download-artifact@v3 + with: + name: astar-runtime + path: runtime-artifacts + + - name: Download shiden runtime + uses: actions/download-artifact@v3 + with: + name: shiden-runtime + path: runtime-artifacts + + - name: Download shibuya runtime + uses: actions/download-artifact@v3 + with: + name: shibuya-runtime + path: runtime-artifacts + + - name: Use Node.js 18.x + uses: actions/setup-node@v2 + with: + node-version: 18.x + + - name: Get the latest release + id: latest-release + uses: pozetroninc/github-action-get-latest-release@v0.5.0 + with: + repository: AstarNetwork/Astar + excludes: "prerelease, draft" + + - name: Generate Release Body + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + id: generate-release-body + run: | + cd .github/scripts + yarn + yarn -s run ts-node generate-release-body.ts generate --owner "${{ github.repository_owner }}" --repo "$(basename ${{ github.repository }})" --from "${{ steps.latest-release.outputs.release }}" --to "${{ github.ref_name }}" --srtool-report-folder '../../runtime-artifacts/' > ../../body.md + + - name: Create Release Draft + id: create-release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref_name }} + release_name: ${{ github.ref_name }} + body_path: body.md + draft: true + + upload-binaries: + needs: publish-release-draft + runs-on: ubuntu-latest + strategy: + matrix: + os: ["ubuntu", "macOS"] + arch: ["x86_64", "aarch64"] + exclude: + - os: macOS + arch: aarch64 + steps: + - name: Create download folder + run: | + mkdir -p ${{ matrix.os }}-${{ matrix.arch }}-bin + mkdir -p ubuntu-tracing-bin + + - name: Download pre-built collator binary + uses: actions/download-artifact@v3 + with: + name: astar-${{ matrix.os }}-latest-${{ matrix.arch }} + path: ${{ matrix.os }}-${{ matrix.arch }}-bin + + - name: Make binary executable and tar gzip + run: | + cd ${{ matrix.os }}-${{ matrix.arch }}-bin + chmod +x astar-collator + tar zcvf astar-collator.tar.gz astar-collator + + - name: Upload binary artifact + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.publish-release-draft.outputs.upload_url }} + asset_path: ${{ matrix.os }}-${{ matrix.arch }}-bin/astar-collator.tar.gz + asset_name: astar-collator-${{ github.ref_name }}-${{ matrix.os }}-${{ matrix.arch }}.tar.gz + asset_content_type: application/gzip + + upload-runtimes: + needs: publish-release-draft + runs-on: ubuntu-latest + strategy: + matrix: + chain: ["astar", "shiden", "shibuya"] + steps: + - name: Download runtime + uses: actions/download-artifact@v3 + with: + name: ${{ matrix.chain }}-runtime + + - name: Get runtime version + id: get-runtime-version + run: | + ls -R + chain=${{ matrix.chain }} + runtime_version=$(cat $chain-compressed-info.json | jq '.core_version' | tr -d '"' | cut -d ' ' -f 1) + echo $runtime_version + echo "::set-output name=runtime_version::$runtime_version" + + - name: Upload ${{ matrix.chain }} Wasm + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.publish-release-draft.outputs.upload_url }} + asset_path: ${{ matrix.chain }}_runtime.compact.compressed.wasm + asset_name: ${{ steps.get-runtime-version.outputs.runtime_version }}.wasm + asset_content_type: application/wasm + + - name: Upload ${{ matrix.chain }} Metadata + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.publish-release-draft.outputs.upload_url }} + asset_path: ${{ matrix.chain }}-metadata.json + asset_name: ${{ matrix.chain }}-metadata.json + asset_content_type: application/json + + - name: Upload ${{ matrix.chain }} Compressed Info + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.publish-release-draft.outputs.upload_url }} + asset_path: ${{ matrix.chain }}-compressed-info.json + asset_name: ${{ matrix.chain }}-compressed-info.json + asset_content_type: application/json + + - name: Upload ${{ matrix.chain }} Srtool Digest + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.publish-release-draft.outputs.upload_url }} + asset_path: ${{ matrix.chain }}-srtool-digest.json + asset_name: ${{ matrix.chain }}-srtool-digest.json + asset_content_type: application/json + + upload-evm-tracing-artifacts: + needs: publish-release-draft + runs-on: ubuntu-latest + steps: + - name: Download pre-built collator binary for evm tracing + uses: actions/download-artifact@v3 + with: + name: astar-evm-tracing-ubuntu-latest-x86_64-unknown-linux-gnu + path: evm-tracing-artifacts + + - name: Make evm tracing binary executable and tar gzip + run: | + cd evm-tracing-artifacts + chmod +x astar-collator + + - name: Download evm tracing runtime + uses: actions/download-artifact@v3 + with: + name: astar-evm-tracing-runtime + path: evm-tracing-artifacts + + - name: Download evm tracing runtime + uses: actions/download-artifact@v3 + with: + name: shiden-evm-tracing-runtime + path: evm-tracing-artifacts + + - name: Download evm tracing runtime + uses: actions/download-artifact@v3 + with: + name: shibuya-evm-tracing-runtime + path: evm-tracing-artifacts + + - name: Compress folder + run: | + tar zcvf evm-tracing-artifacts.tar.gz evm-tracing-artifacts + + - name: Upload evm tracing binary artifact + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.publish-release-draft.outputs.upload_url }} + asset_path: evm-tracing-artifacts.tar.gz + asset_name: evm-tracing-artifacts-${{ github.ref_name }}.tar.gz + asset_content_type: application/gzip diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 86562fa624..9520a40f10 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: Release Build +name: Test naming on: push: tags: @@ -6,41 +6,12 @@ on: workflow_dispatch: env: SUBWASM_VERSION: 0.16.1 -jobs: - checks-and-tests: - runs-on: [self-hosted, Linux, X64] - steps: - - name: Free disk space - run: | - sudo rm -rf /usr/share/dotnet - sudo rm -rf /usr/local/lib/android - sudo rm -rf /opt/ghc - sudo rm -rf "/usr/local/share/boost" - sudo rm -rf "$AGENT_TOOLSDIRECTORY" - df -h - - - name: Checkout the source code - uses: actions/checkout@v3 - with: - submodules: true - - - name: Install deps - run: sudo apt -y install protobuf-compiler - - - name: Install & display rust toolchain - run: rustup show - - - name: Check targets are installed correctly - run: rustup target list --installed - - - name: Check all features compilation - run: cargo check --verbose --features try-runtime,runtime-benchmarks --locked - - - name: Run all tests - run: cargo test --features try-runtime,runtime-benchmarks --locked + astar_runtime_version: '' + shiden_runtime_version: '' + shibuya_runtime_version: '' +jobs: native-linux: - needs: checks-and-tests runs-on: [self-hosted, Linux, X64] strategy: matrix: @@ -101,7 +72,6 @@ jobs: path: target/${{ matrix.target }}/release/astar-collator evm-tracing-native-linux: - needs: checks-and-tests runs-on: [self-hosted, Linux, X64] steps: @@ -155,7 +125,6 @@ jobs: path: target/x86_64-unknown-linux-gnu/release/wbuild/shibuya-runtime/shibuya_evm_tracing_runtime.compact.compressed.wasm srtool: - needs: checks-and-tests runs-on: ubuntu-latest strategy: matrix: @@ -293,44 +262,6 @@ jobs: body_path: body.md draft: true - upload-binaries: - needs: publish-release-draft - runs-on: ubuntu-latest - strategy: - matrix: - os: ["ubuntu", "macOS"] - arch: ["x86_64", "aarch64"] - exclude: - - os: macOS - arch: aarch64 - steps: - - name: Create download folder - run: | - mkdir -p ${{ matrix.os }}-${{ matrix.arch }}-bin - mkdir -p ubuntu-tracing-bin - - - name: Download pre-built collator binary - uses: actions/download-artifact@v3 - with: - name: astar-${{ matrix.os }}-latest-${{ matrix.arch }} - path: ${{ matrix.os }}-${{ matrix.arch }}-bin - - - name: Make binary executable and tar gzip - run: | - cd ${{ matrix.os }}-${{ matrix.arch }}-bin - chmod +x astar-collator - tar zcvf astar-collator.tar.gz astar-collator - - - name: Upload binary artifact - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.publish-release-draft.outputs.upload_url }} - asset_path: ${{ matrix.os }}-${{ matrix.arch }}-bin/astar-collator.tar.gz - asset_name: astar-collator-${{ github.ref_name }}-${{ matrix.os }}-${{ matrix.arch }}.tar.gz - asset_content_type: application/gzip - upload-runtimes: needs: publish-release-draft runs-on: ubuntu-latest @@ -350,7 +281,8 @@ jobs: chain=${{ matrix.chain }} runtime_version=$(cat $chain-compressed-info.json | jq '.core_version' | tr -d '"' | cut -d ' ' -f 1) echo $runtime_version - echo "::set-output name=runtime_version::$runtime_version" + echo "runtime=$(echo $runtime_version)" >> $GITHUB_ENV + echo "${{ matrix.chain }}=$(echo $runtime_version)" >> $GITHUB_OUTPUT - name: Upload ${{ matrix.chain }} Wasm uses: actions/upload-release-asset@v1 @@ -359,7 +291,7 @@ jobs: with: upload_url: ${{ needs.publish-release-draft.outputs.upload_url }} asset_path: ${{ matrix.chain }}_runtime.compact.compressed.wasm - asset_name: ${{ steps.get-runtime-version.outputs.runtime_version }}.wasm + asset_name: $runtime.wasm asset_content_type: application/wasm - name: Upload ${{ matrix.chain }} Metadata @@ -392,8 +324,16 @@ jobs: asset_name: ${{ matrix.chain }}-srtool-digest.json asset_content_type: application/json + - name: Print version + run: echo ${{ steps.get-runtime-version.outputs.astar }} + + outputs: + astar_runtime_version: ${{ steps.get-runtime-version.outputs.astar }} + shiden_runtime_version: ${{ steps.get-runtime-version.outputs.shiden }} + shibuya_runtime_version: ${{ steps.get-runtime-version.outputs.shibuya }} + upload-evm-tracing-artifacts: - needs: publish-release-draft + needs: upload-runtimes runs-on: ubuntu-latest steps: - name: Download pre-built collator binary for evm tracing @@ -401,11 +341,6 @@ jobs: with: name: astar-evm-tracing-ubuntu-latest-x86_64-unknown-linux-gnu path: evm-tracing-artifacts - - - name: Make evm tracing binary executable and tar gzip - run: | - cd evm-tracing-artifacts - chmod +x astar-collator - name: Download evm tracing runtime uses: actions/download-artifact@v3 @@ -425,6 +360,14 @@ jobs: name: shibuya-evm-tracing-runtime path: evm-tracing-artifacts + - name: Make evm tracing binary executable and rename + run: | + cd evm-tracing-artifacts + chmod +x astar-collator + mv astar_evm_tracing_runtime.compact.compressed.wasm ${{needs.upload-runtimes.outputs.astar_runtime_version}}_evm_tracing_runtime.compact.compressed.wasm + mv shiden_evm_tracing_runtime.compact.compressed.wasm ${{needs.upload-runtimes.outputs.shiden_runtime_version}}_evm_tracing_runtime.compact.compressed.wasm + mv shibuya_evm_tracing_runtime.compact.compressed.wasm ${{needs.upload-runtimes.outputs.shibuya_runtime_version}}_evm_tracing_runtime.compact.compressed.wasm + - name: Compress folder run: | tar zcvf evm-tracing-artifacts.tar.gz evm-tracing-artifacts