diff --git a/.github/actions/build-asset-unix.sh b/.github/actions/build-asset-unix.sh index 2ff28d7c..a6853499 100755 --- a/.github/actions/build-asset-unix.sh +++ b/.github/actions/build-asset-unix.sh @@ -33,8 +33,5 @@ if [[ "$bb_version" != "$BB_VERSION" ]]; then exit 1 fi -tar -czvf $BB_ARTIFACT_NAME bladebit -mkdir ../bin -mv $BB_ARTIFACT_NAME ../bin/ -ls -la ../bin - +mkdir ../data +cp bladebit ../data/ diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index db4d6908..6ce8e620 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -5,18 +5,24 @@ on: workflow_dispatch: jobs: - build-ubuntu-x86-64: - runs-on: ubuntu-20.04 + tar: + name: tar - ${{ matrix.runs-on }} - ${{ matrix.n }} + runs-on: ${{ matrix.runs-on }} + strategy: + fail-fast: false + matrix: + runs-on: [macos-11, macos-12, macos-latest] + n: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80] steps: - name: Checkout Repo uses: actions/checkout@v3 - name: Get Version Number id: version_number - run: .github/actions/get-version.sh ubuntu x86-64 + run: .github/actions/get-version.sh macos x86-64 - name: Install Prerequisites - run: sudo apt install -y libgmp-dev libnuma-dev + run: brew install cmake - name: Build env: @@ -24,209 +30,27 @@ jobs: BB_VERSION: ${{steps.version_number.outputs.BB_VERSION}} run: .github/actions/build-asset-unix.sh - - name: Upload Artifact Ubuntu x86-64 - uses: actions/upload-artifact@v2 - with: - name: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }} - path: ${{ github.workspace }}/bin/${{ steps.version_number.outputs.BB_ARTIFACT_NAME }} - if-no-files-found: error - - build-centos-x86-64: - runs-on: ubuntu-20.04 - container: - image: quay.io/centos/centos:stream8 - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - - - name: Get Version Number - id: version_number - run: .github/actions/get-version.sh centos x86-64 - - - name: Install Prerequisites + - name: tar/untar run: | - dnf install -y gcc-toolset-9-gcc gcc-toolset-9-gcc-c++ \ - cmake gmp-devel numactl-devel make git + ls -la . + ls -la data + tar -cvzf tarred.tar --directory data bladebit + tar -xvf tarred.tar - - name: Build - env: - BB_ARTIFACT_NAME: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }} - BB_VERSION: ${{steps.version_number.outputs.BB_VERSION}} + - name: post-check + shell: python run: | - source /opt/rh/gcc-toolset-9/enable - .github/actions/build-asset-unix.sh - - - name: Upload Artifact CentOS x86-64 - uses: actions/upload-artifact@v2 - with: - name: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }} - path: ${{ github.workspace }}/bin/${{ steps.version_number.outputs.BB_ARTIFACT_NAME }} - if-no-files-found: error - - build-ubuntu-arm64: - runs-on: [ARM64, Linux] - container: - image: chianetwork/ubuntu-20.04-builder:latest - defaults: - run: - shell: bash - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - - - name: Get Version Number - id: version_number - run: .github/actions/get-version.sh ubuntu arm64 - - - name: Install Prerequisites + with open("data/bladebit", "rb") as f: + contents = f.read() + pre_count = contents.count(b"\x00") + print("zero pre-count:", pre_count) + + with open("bladebit", "rb") as f: + contents = f.read() + post_count = contents.count(b"\x00") + print("zero post-count:", post_count) + print("ratio:", post_count / pre_count) + + - name: diff run: | - export DEBIAN_FRONTEND=noninteractive - apt update - apt install -y build-essential git libgmp-dev libnuma-dev - - - name: Build - env: - BB_ARTIFACT_NAME: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }} - BB_VERSION: ${{steps.version_number.outputs.BB_VERSION}} - run: .github/actions/build-asset-unix.sh - - - name: Upload Artifact Ubuntu ARM64 - uses: actions/upload-artifact@v2 - with: - name: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }} - path: ${{ github.workspace }}/bin/${{ steps.version_number.outputs.BB_ARTIFACT_NAME }} - if-no-files-found: error - - build-centos-arm64: - runs-on: [ARM64, Linux] - container: - image: quay.io/centos/centos:stream8 - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - - - name: Get Version Number - id: version_number - run: .github/actions/get-version.sh centos arm64 - - - name: Install Prerequisites - run: | - dnf install -y gcc-toolset-9-gcc gcc-toolset-9-gcc-c++ \ - cmake gmp-devel numactl-devel make git - - - name: Build - env: - BB_ARTIFACT_NAME: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }} - BB_VERSION: ${{steps.version_number.outputs.BB_VERSION}} - run: | - source /opt/rh/gcc-toolset-9/enable - .github/actions/build-asset-unix.sh - - - name: Upload Artifact CentOS ARM64 - uses: actions/upload-artifact@v2 - with: - name: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }} - path: ${{ github.workspace }}/bin/${{ steps.version_number.outputs.BB_ARTIFACT_NAME }} - if-no-files-found: error - - build-windows-x86-64: - runs-on: windows-2019 - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - - - name: Get Version Number - shell: bash - id: version_number - run: .github/actions/get-version.sh windows x86-64 - - - name: Build - shell: bash - env: - BB_ARTIFACT_NAME: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }} - BB_VERSION: ${{steps.version_number.outputs.BB_VERSION}} - run: | - - mkdir build && cd build - cmake .. - bash -e -o pipefail ../embed-version.sh - cat ../src/Version.h - cmake --build . --target bladebit --config Release - - # Ensure bladebit version matches expected version - bb_version="$(./Release/bladebit.exe --version | xargs)" - - if [[ "$bb_version" != "$BB_VERSION" ]]; then - >&2 echo "Incorrect bladebit version. Got but '$bb_version' expected '$BB_VERSION'." - exit 1 - fi - - mkdir ../bin - cd Release - 7z.exe a -tzip ../../bin/${BB_ARTIFACT_NAME} bladebit.exe - ls -la ../../bin - - - name: Upload Artifact Windows x86-64 - uses: actions/upload-artifact@v2 - with: - name: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }} - path: ${{ github.workspace }}/bin/${{ steps.version_number.outputs.BB_ARTIFACT_NAME }} - if-no-files-found: error - - build-macos-arm64: - runs-on: [macOS, ARM64] - steps: - - name: Cleanup Environment - uses: Chia-Network/actions/clean-workspace@main - - - name: Checkout Repo - uses: actions/checkout@v3 - - - name: Get Version Number - id: version_number - run: bash -e .github/actions/get-version.sh macos arm64 - - - name: Install Prerequisites - run: brew install cmake - - - name: Build - env: - BB_ARTIFACT_NAME: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }} - BB_VERSION: ${{steps.version_number.outputs.BB_VERSION}} - run: .github/actions/build-asset-unix.sh - - - name: Upload Artifact macOS arm64 - uses: actions/upload-artifact@v2 - with: - name: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }} - path: ${{ github.workspace }}/bin/${{ steps.version_number.outputs.BB_ARTIFACT_NAME }} - if-no-files-found: error - - build-macos-x86-64: - runs-on: macOS-latest - steps: - - name: Cleanup Environment - uses: Chia-Network/actions/clean-workspace@main - - - name: Checkout Repo - uses: actions/checkout@v3 - - - name: Get Version Number - id: version_number - run: .github/actions/get-version.sh macos x86-64 - - - name: Install Prerequisites - run: brew install cmake - - - name: Build - env: - BB_ARTIFACT_NAME: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }} - BB_VERSION: ${{steps.version_number.outputs.BB_VERSION}} - run: .github/actions/build-asset-unix.sh - - - name: Upload Artifact macOS x86-64 - uses: actions/upload-artifact@v2 - with: - name: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }} - path: ${{ github.workspace }}/bin/${{ steps.version_number.outputs.BB_ARTIFACT_NAME }} - if-no-files-found: error + diff data/bladebit bladebit