-
Notifications
You must be signed in to change notification settings - Fork 282
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into wallentx/update-readme
- Loading branch information
Showing
26 changed files
with
1,095 additions
and
10,117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
#!/usr/bin/env bash | ||
set -eo pipefail | ||
_dir=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd) | ||
cd "$_dir/../.." | ||
|
||
## | ||
# Usage: fetch_bladebit_harvester.sh <linux|macos|windows> <arm64|x86-64> | ||
# | ||
# Use gitbash or similar under Windows. | ||
## | ||
host_os=$1 | ||
host_arch=$2 | ||
|
||
if [[ "${host_os}" != "linux" ]] && [[ "${host_os}" != "macos" ]] && [[ "${host_os}" != "windows" ]]; then | ||
echo >&2 "Unkonwn OS '${host_os}'" | ||
exit 1 | ||
fi | ||
|
||
if [[ "${host_arch}" != "arm64" ]] && [[ "${host_arch}" != "x86-64" ]]; then | ||
echo >&2 "Unkonwn Architecture '${host_arch}'" | ||
exit 1 | ||
fi | ||
|
||
## Change this if including a new bladebit release | ||
artifact_ver="v3.1.0" | ||
artifact_base_url="https://github.com/Chia-Network/bladebit/releases/download/${artifact_ver}" | ||
|
||
linux_arm_sha256="e8fc09bb5862ce3d029b78144ea46791afe14a2d640390605b6df28fb420e782" | ||
linux_x86_sha256="e31e5226d1e4a399f4181bb2cca243d46218305a8b54912ef29c791022ac079d" | ||
macos_arm_sha256="03958b94ad9d01de074b5a9a9d86a51bd2246c0eab5529c5886bb4bbc4168e0b" | ||
macos_x86_sha256="14975aabfb3d906e22e04cd973be4265f9c5c61e67a92f890c8e51cf9edf0c87" | ||
windows_sha256="ccf115ebec18413c3134f9ca37945f30f4f02d6766242c7e84a6df0d1d989a69" | ||
## End changes | ||
|
||
artifact_ext="tar.gz" | ||
sha_bin="sha256sum" | ||
expected_sha256= | ||
|
||
if [[ "$OSTYPE" == "darwin"* ]]; then | ||
sha_bin="shasum -a 256" | ||
fi | ||
|
||
case "${host_os}" in | ||
linux) | ||
if [[ "${host_arch}" == "arm64" ]]; then | ||
expected_sha256=$linux_arm_sha256 | ||
else | ||
expected_sha256=$linux_x86_sha256 | ||
fi | ||
;; | ||
macos) | ||
if [[ "${host_arch}" == "arm64" ]]; then | ||
expected_sha256=$macos_arm_sha256 | ||
else | ||
expected_sha256=$macos_x86_sha256 | ||
fi | ||
;; | ||
windows) | ||
expected_sha256=$windows_sha256 | ||
artifact_ext="zip" | ||
;; | ||
*) | ||
echo >&2 "Unexpected OS '${host_os}'" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
# Download artifact | ||
artifact_name="green_reaper.${artifact_ext}" | ||
curl -L "${artifact_base_url}/green_reaper-${artifact_ver}-${host_os}-${host_arch}.${artifact_ext}" >"${artifact_name}" | ||
|
||
# Validate sha256, if one was given | ||
if [ -n "${expected_sha256}" ]; then | ||
gr_sha256="$(${sha_bin} ${artifact_name} | cut -d' ' -f1)" | ||
|
||
if [[ "${gr_sha256}" != "${expected_sha256}" ]]; then | ||
echo >&2 "GreenReaper SHA256 mismatch!" | ||
echo >&2 " Got : '${gr_sha256}'" | ||
echo >&2 " Expected: '${expected_sha256}'" | ||
exit 1 | ||
fi | ||
fi | ||
|
||
# Unpack artifact | ||
dst_dir="libs/green_reaper" | ||
mkdir -p "${dst_dir}" | ||
if [[ "${artifact_ext}" == "zip" ]]; then | ||
unzip -d "${dst_dir}" "${artifact_name}" | ||
else | ||
pushd "${dst_dir}" | ||
tar -xzvf "../../${artifact_name}" | ||
popd | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
name: Build and test riscv64 on ubuntu-latest | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- dev | ||
tags: | ||
- "**" | ||
pull_request: | ||
branches: | ||
- "**" | ||
|
||
jobs: | ||
build_wheels: | ||
timeout-minutes: 60 | ||
name: ${{ matrix.os }} 📦 Build ${{ matrix.python.major-dot-minor }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest] | ||
python: | ||
- major-dot-minor: "3.8" | ||
matrix: "3.8" | ||
- major-dot-minor: "3.9" | ||
matrix: "3.9" | ||
- major-dot-minor: "3.10" | ||
matrix: "3.10" | ||
- major-dot-minor: "3.11" | ||
matrix: "3.11" | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 1 | ||
|
||
- name: Set up QEMU on x86_64 | ||
if: startsWith(matrix.os, 'ubuntu-latest') | ||
id: qemu | ||
uses: docker/setup-qemu-action@v2 | ||
with: | ||
platforms: riscv64 | ||
# image: tonistiigi/binfmt:latest | ||
|
||
- name: Build and Test | ||
run: | | ||
docker run --rm --platform linux/riscv64 \ | ||
-v ${{ github.workspace }}:/ws --workdir=/ws \ | ||
chianetwork/ubuntu-22.04-risc-builder:latest \ | ||
bash -exc '\ | ||
pyenv global ${{ matrix.python.matrix }} && \ | ||
cmake --version && \ | ||
uname -a && \ | ||
export CP_USE_GREEN_REAPER=0 && \ | ||
pip wheel -w dist . && \ | ||
python3 -m venv venv && \ | ||
./venv/bin/python -m pip install dist/*.whl && \ | ||
./venv/bin/python -m pip install pytest && \ | ||
./venv/bin/python -m pytest -k "not k_21" -v tests/ | ||
' | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: packages | ||
path: ./dist | ||
if-no-files-found: error | ||
upload: | ||
name: Upload to Chia PyPI | ||
runs-on: ubuntu-latest | ||
needs: | ||
- build_wheels | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set Env | ||
uses: Chia-Network/actions/setjobenv@main | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Download artifacts | ||
if: env.RELEASE == 'true' | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: packages | ||
path: ./dist | ||
|
||
- name: Configure AWS credentials | ||
if: env.RELEASE == 'true' | ||
uses: aws-actions/configure-aws-credentials@v2 | ||
with: | ||
role-to-assume: arn:aws:iam::${{ secrets.CHIA_AWS_ACCOUNT_ID }}:role/installer-upload | ||
aws-region: us-west-2 | ||
|
||
- name: List existing wheels | ||
if: env.RELEASE == 'true' | ||
shell: sh | ||
run: | | ||
aws s3 ls s3://download.chia.net/simple/chiavdf/ > existing_wheel_list_raw | ||
cat existing_wheel_list_raw | ||
cat existing_wheel_list_raw | tr -s ' ' | cut -d ' ' -f 4 > existing_wheel_list | ||
- name: List new wheels | ||
if: env.RELEASE == 'true' | ||
shell: sh | ||
run: | | ||
(cd dist/; ls ${{ inputs.package_name }}-*.whl) > new_wheel_list | ||
cat new_wheel_list | xargs -I % sh -c 'ls -l dist/%' | ||
- name: Choose wheels to upload | ||
if: env.RELEASE == 'true' | ||
shell: sh | ||
run: | | ||
grep -F -x -v -f existing_wheel_list new_wheel_list > upload_wheel_list | ||
cat upload_wheel_list | ||
- name: Upload wheels | ||
if: env.RELEASE == 'true' | ||
shell: sh | ||
run: | | ||
cat upload_wheel_list | xargs -I % sh -c 'aws s3 cp dist/% s3://download.chia.net/simple/chiapos/' |
Oops, something went wrong.