Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

altendky exploration 2 #242

Draft
wants to merge 24 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions .github/actions/build-asset-unix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# - BB_VERSION
#
set -eo pipefail
set -vx

thread_count=2

Expand Down Expand Up @@ -33,8 +34,19 @@ if [[ "$bb_version" != "$BB_VERSION" ]]; then
exit 1
fi

tar --version
ls -la bladebit
python3 -c 'f = open("bladebit", "rb"); contents = f.read(); print("zero count:", contents.count(b"\x00"))'
tar -czvf $BB_ARTIFACT_NAME bladebit
ls -la $BB_ARTIFACT_NAME
mkdir ../bin
cp bladebit ../bin/
mkdir tmp1
cd tmp1
tar -xvf ../$BB_ARTIFACT_NAME
python3 -c 'f = open("bladebit", "rb"); contents = f.read(); print("zero count:", contents.count(b"\x00"))'
cp bladebit ../../bin/bladebit.tarred-untarred
diff bladebit ../../bin/bladebit
cd ..
mv $BB_ARTIFACT_NAME ../bin/
ls -la ../bin

ls -la ../bin/
213 changes: 13 additions & 200 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,206 +4,18 @@ on:
branches: ['*']
workflow_dispatch:

jobs:
build-ubuntu-x86-64:
runs-on: ubuntu-20.04
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Get Version Number
id: version_number
run: .github/actions/get-version.sh ubuntu x86-64

- name: Install Prerequisites
run: sudo apt install -y 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 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
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 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
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
env:
CMAKE_BUILD_PARALLEL_LEVEL: 1

jobs:
build-macos-x86-64:
runs-on: macOS-latest
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: Cleanup Environment
uses: Chia-Network/actions/clean-workspace@main
Expand All @@ -225,8 +37,9 @@ jobs:
run: .github/actions/build-asset-unix.sh

- name: Upload Artifact macOS x86-64
if: always()
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 }}
name: ${{ matrix.runs-on }}-${{ matrix.n }}-${{ steps.version_number.outputs.BB_ARTIFACT_NAME }}
path: ${{ github.workspace }}/bin/
if-no-files-found: error
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
cmake_minimum_required(VERSION 3.20 FATAL_ERROR)

set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_FIND_DEBUG_MODE ON)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

Expand Down