From 9bcb397fda62560d8533483eb23e71a428c7c996 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Tue, 21 Jun 2022 18:13:55 -0400 Subject: [PATCH 01/21] one matrix to rule them all --- .github/workflows/build-aarch64.yml | 116 ------------------------- .github/workflows/build-m1-wheel.yml | 122 --------------------------- .github/workflows/build.yml | 67 ++++++++++----- 3 files changed, 45 insertions(+), 260 deletions(-) delete mode 100644 .github/workflows/build-aarch64.yml delete mode 100644 .github/workflows/build-m1-wheel.yml diff --git a/.github/workflows/build-aarch64.yml b/.github/workflows/build-aarch64.yml deleted file mode 100644 index 3b9afb9e..00000000 --- a/.github/workflows/build-aarch64.yml +++ /dev/null @@ -1,116 +0,0 @@ -name: Build ARM64 wheels - -on: - push: - branches: - - main - tags: - - '**' - pull_request: - branches: - - '**' - -jobs: - build_wheels: - name: Build wheel on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [[ARM64, Linux]] - - steps: - - name: Cancel previous runs on the same branch - if: ${{ github.ref != 'refs/heads/master' }} - uses: styfle/cancel-workflow-action@0.9.1 - with: - access_token: ${{ github.token }} - - - name: Checkout code - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Prepare cibuildwheel - run: | - if [ ! -f "venv" ]; then rm -rf venv; fi - sudo apt-get install python3-venv python3-pip -y - python3 -m venv venv - source venv/bin/activate - python -m pip install --upgrade pip - pip install wheel - pip install cibuildwheel==2.3.1 - - - name: Build wheel and test - run: | - source venv/bin/activate - python -m cibuildwheel --output-dir dist - env: - CIBW_BUILD_VERBOSITY_LINUX: 0 - # build python 3.7 and 3.8 - CIBW_BUILD: cp37-* cp38-* cp39-* cp310-* - CIBW_SKIP: '*-musllinux_*' - CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014 - # we need boost - CIBW_BEFORE_ALL_LINUX: > - yum -y install epel-release - && yum -y install boost-devel lzip cmake3 - && rm -rf /usr/local/bin/cmake - && ln -s /usr/bin/cmake3 /usr/local/bin/cmake - && curl -L https://gmplib.org/download/gmp/gmp-6.2.1.tar.lz | lzip -dc | tar x - && cd gmp-6.2.1 && ./configure --enable-fat --enable-cxx - && make && make install && cd .. && rm -rf gmp-6.2.1 - && cmake --version - && uname -a - CIBW_BEFORE_BUILD_LINUX: > - python -m pip install --upgrade pip - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_COMMAND: py.test -v {project}/tests - CIBW_ENVIRONMENT_LINUX: "BUILD_VDF_CLIENT=N" - - - name: Upload artifacts - uses: actions/upload-artifact@v2 - with: - name: wheels - path: ./dist - - - name: Test for secrets access - id: check_secrets - shell: bash - run: | - unset HAS_SECRET - if [ -n "$SECRET" ]; then HAS_SECRET='true' ; fi - echo ::set-output name=HAS_SECRET::${HAS_SECRET} - env: - SECRET: "${{ secrets.test_pypi_password }}" - - - name: Install twine - run: | - source venv/bin/activate - pip install twine - - - name: Publish distribution to PyPI - if: startsWith(github.event.ref, 'refs/tags') && steps.check_secrets.outputs.HAS_SECRET - env: - TWINE_USERNAME: __token__ - TWINE_NON_INTERACTIVE: 1 - TWINE_PASSWORD: ${{ secrets.pypi_password }} - run: | - source venv/bin/activate - twine upload --non-interactive --skip-existing --verbose 'dist/*' - - - name: Publish distribution to Test PyPI - if: steps.check_secrets.outputs.HAS_SECRET - env: - TWINE_REPOSITORY_URL: https://test.pypi.org/legacy/ - TWINE_USERNAME: __token__ - TWINE_NON_INTERACTIVE: 1 - TWINE_PASSWORD: ${{ secrets.test_pypi_password }} - run: | - source venv/bin/activate - twine upload --non-interactive --skip-existing --verbose 'dist/*' - - - name: Clean up - run: | - rm -rf venv - rm -rf dist diff --git a/.github/workflows/build-m1-wheel.yml b/.github/workflows/build-m1-wheel.yml deleted file mode 100644 index 946f665c..00000000 --- a/.github/workflows/build-m1-wheel.yml +++ /dev/null @@ -1,122 +0,0 @@ -name: Build M1 Wheels - -on: - push: - branches: - - main - tags: - - '**' - pull_request: - branches: - - '**' - -jobs: - build_wheels: - name: Build wheel on Mac M1 - runs-on: [m1] - strategy: - fail-fast: false - - steps: - - name: Cancel previous runs on the same branch - if: ${{ github.ref != 'refs/heads/main' }} - uses: styfle/cancel-workflow-action@0.7.0 - with: - access_token: ${{ github.token }} - - - name: Checkout code - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Ensure dependencies are present - run: | - arch -arm64 brew install gmp boost cmake - arch -arm64 brew install python@3.9 - arch -arm64 brew install python@3.10 - - - name: Build m1 wheels - run: | - export BUILD_VDF_CLIENT=N - rm -rf venv - arch -arm64 $(brew --prefix python@3.9)/libexec/bin/python -m venv venv - . venv/bin/activate - arch -arm64 pip wheel -w dist --no-deps . - arch -arm64 pip install delocate - arch -arm64 delocate-wheel -v dist/*cp39*.whl - deactivate - rm -rf venv - arch -arm64 $(brew --prefix python@3.10)/libexec/bin/python -m venv venv - . venv/bin/activate - arch -arm64 pip wheel -w dist --no-deps . - arch -arm64 pip install delocate - arch -arm64 delocate-wheel -v dist/*cp310*.whl - deactivate - rm -rf venv - - - name: Test wheels - run: | - rm -rf venv - arch -arm64 $(brew --prefix python@3.9)/libexec/bin/python -m venv venv - . venv/bin/activate - arch -arm64 pip install ./dist/*cp39*.whl - arch -arm64 pip install pytest - arch -arm64 ./venv/bin/pytest -v ./tests - deactivate - rm -rf venv - arch -arm64 $(brew --prefix python@3.10)/libexec/bin/python -m venv venv - . venv/bin/activate - arch -arm64 pip install ./dist/*cp310*.whl - arch -arm64 pip install pytest - arch -arm64 ./venv/bin/pytest -v ./tests - deactivate - rm -rf venv - - - name: Create sha256 hash - run: | - mkdir hashes - cd ./dist - shasum -a 256 * - shasum -a 256 * > ../hashes/chiavdf-wheel-m1-sha256.txt - - - name: Upload hashes - uses: actions/upload-artifact@v2 - with: - name: blspy-hashes - path: ./hashes - - - name: Upload wheels - uses: actions/upload-artifact@v2 - with: - name: wheels - path: ./dist - - - name: Test for secrets access - id: check_secrets - shell: bash - run: | - unset HAS_SECRET - if [ -n "$SECRET" ]; then HAS_SECRET='true' ; fi - echo ::set-output name=HAS_SECRET::${HAS_SECRET} - env: - SECRET: "${{ secrets.test_pypi_password }}" - - - name: Install twine - run: arch -arm64 pip install twine - - - name: Publish distribution to PyPI - if: startsWith(github.event.ref, 'refs/tags') && steps.check_secrets.outputs.HAS_SECRET - env: - TWINE_USERNAME: __token__ - TWINE_NON_INTERACTIVE: 1 - TWINE_PASSWORD: ${{ secrets.pypi_password }} - run: arch -arm64 twine upload --non-interactive --skip-existing --verbose 'dist/*' - - - name: Publish distribution to Test PyPI - if: steps.check_secrets.outputs.HAS_SECRET - env: - TWINE_REPOSITORY_URL: https://test.pypi.org/legacy/ - TWINE_USERNAME: __token__ - TWINE_NON_INTERACTIVE: 1 - TWINE_PASSWORD: ${{ secrets.test_pypi_password }} - run: arch -arm64 twine upload --non-interactive --skip-existing --verbose 'dist/*' diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 89299181..27eb948f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,38 +3,59 @@ name: Build Wheels on: push: branches: - - main + - main tags: - - '**' + - '**' pull_request: branches: - - '**' + - '**' + +concurrency: + # SHA is added to the end if on `main` to let all main workflows run + group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} + cancel-in-progress: true jobs: build_wheels: - name: Build wheel on ${{ matrix.os }} - runs-on: ${{ matrix.os }} + name: Build wheel on ${{ matrix.os.name }} ${{ matrix.arch.name }} + runs-on: ${{ matrix.os.runs-on[matrix.arch.matrix] }} strategy: fail-fast: false matrix: - os: [macos-latest, ubuntu-latest, windows-latest] - + os: + - name: macOS + matrix: macos + runs-on: + arm: [macOS, ARM64] + intel: [macos-latest] + - name: Ubuntu + matrix: ubuntu + runs-on: + arm: [Linux, ARM64] + intel: [ubuntu-latest] + - name: Windows + matrix: windows + runs-on: + intel: [windows-latest] + python: + - major_dot_minor: '3.9' + arch: + - name: ARM + matrix: arm + - name: Intel + matrix: intel steps: - - name: Cancel previous runs on the same branch - if: ${{ github.ref != 'refs/heads/master' }} - uses: styfle/cancel-workflow-action@0.9.1 - with: - access_token: ${{ github.token }} + - name: Clean workspace + uses: Chia-Network/actions/clean-workspace@main - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 - - uses: actions/setup-python@v2 - name: Install Python + - uses: Chia-Network/actions/setup-python@main with: - python-version: '3.8' + python-version: ${{ matrix.python.major_dot_minor }} - name: Lint source with flake8 run: | @@ -47,13 +68,13 @@ jobs: pip install mypy mypy --config-file mypi.ini setup.py tests - - name: Build source distribution with MacOS - if: startsWith(matrix.os, 'mac') + - name: Build source distribution with macOS + if: matrix.os.matrix == 'macos' run: | pip install build python -m build --sdist --outdir dist . - - name: Build ${{ matrix.os }} wheels and test + - name: Build ${{ matrix.os.name }} wheels and test uses: joerick/cibuildwheel@v2.3.1 with: output-dir: dist @@ -61,15 +82,14 @@ jobs: CIBW_BUILD_VERBOSITY_MACOS: 0 CIBW_BUILD_VERBOSITY_LINUX: 0 CIBW_BUILD_VERBOSITY_WINDOWS: 0 - # build python 3.7 and 3.8 CIBW_BUILD: cp37-* cp38-* cp39-* cp310-* CIBW_SKIP: '*-manylinux_i686 *-win32 *-musllinux_*' - # we need boost + CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014 CIBW_MANYLINUX_X86_64_IMAGE: manylinux2010 CIBW_ENVIRONMENT_LINUX: "PATH=/project/cmake-3.17.3-Linux-`uname -m`/bin:$PATH BUILD_VDF_CLIENT=N" CIBW_BEFORE_ALL_LINUX: > yum -y install epel-release - && echo "epel-relesase installed" + && echo "epel-release installed" && yum -y install boost-devel lzip && echo "boost-devel and lzip installed" && curl -L https://github.com/Kitware/CMake/releases/download/v3.17.3/cmake-3.17.3-Linux-`uname -m`.sh > cmake.sh @@ -81,6 +101,8 @@ jobs: && cp src/lib/gmp-patch-6.2.1/mpz/inp_raw.c gmp-6.2.1/mpz && cd gmp-6.2.1 && ./configure --enable-fat --enable-cxx && make && make install && cd .. && rm -rf gmp-6.2.1 + && cmake --version + && uname -a CIBW_BEFORE_BUILD_LINUX: > python -m pip install --upgrade pip # CIBW_ARCHS_MACOS: x86_64 arm64 universal2 @@ -111,6 +133,7 @@ jobs: && delocate-wheel -v -i mpir_gc_x64/mpir_sandybridge.dll {wheel} && delocate-wheel -v -i mpir_gc_x64/mpir_skylake_avx.dll {wheel} && cp {wheel} {dest_dir} + CIBW_ENVIRONMENT_LINUX: "BUILD_VDF_CLIENT=${{ matrix.arch.matrix == 'arm' && 'N' || 'Y' }}" CIBW_TEST_REQUIRES: pytest CIBW_TEST_COMMAND: py.test -v {project}/tests From 440e5dbc4d91323ce3333f6853985cbf08af048e Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Tue, 21 Jun 2022 18:20:57 -0400 Subject: [PATCH 02/21] adjust --- .github/workflows/build.yml | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 27eb948f..b6f0f6d3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,13 +37,25 @@ jobs: matrix: windows runs-on: intel: [windows-latest] - python: - - major_dot_minor: '3.9' arch: - name: ARM matrix: arm - name: Intel matrix: intel + exclude: + # Only partial entries are required here by GitHub Actions so generally I + # only specify the `matrix:` entry. The super linter complains so for now + # all entries are included to avoid that. Reported at + # https://github.com/github/super-linter/issues/3016 + - os: + name: Windows + matrix: windows + runs-on: + intel: [windows-latest] + arch: + name: ARM + matrix: arm + steps: - name: Clean workspace uses: Chia-Network/actions/clean-workspace@main @@ -53,9 +65,22 @@ jobs: with: fetch-depth: 0 + - uses: Chia-Network/actions/setup-python@main + if: !( matrix.os.matrix == 'macos' && matrix.arch.matrix == 'arm' ) + with: + python-version: 3.7 + + - uses: Chia-Network/actions/setup-python@main + with: + python-version: 3.8 + + - uses: Chia-Network/actions/setup-python@main + with: + python-version: 3.9 + - uses: Chia-Network/actions/setup-python@main with: - python-version: ${{ matrix.python.major_dot_minor }} + python-version: 3.10 - name: Lint source with flake8 run: | @@ -133,7 +158,6 @@ jobs: && delocate-wheel -v -i mpir_gc_x64/mpir_sandybridge.dll {wheel} && delocate-wheel -v -i mpir_gc_x64/mpir_skylake_avx.dll {wheel} && cp {wheel} {dest_dir} - CIBW_ENVIRONMENT_LINUX: "BUILD_VDF_CLIENT=${{ matrix.arch.matrix == 'arm' && 'N' || 'Y' }}" CIBW_TEST_REQUIRES: pytest CIBW_TEST_COMMAND: py.test -v {project}/tests From f2fdf85a6608a8a756db8525276dcba6650f3573 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Tue, 21 Jun 2022 18:21:40 -0400 Subject: [PATCH 03/21] try again --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b6f0f6d3..71889f90 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -66,7 +66,7 @@ jobs: fetch-depth: 0 - uses: Chia-Network/actions/setup-python@main - if: !( matrix.os.matrix == 'macos' && matrix.arch.matrix == 'arm' ) + if: ${{ !( matrix.os.matrix == 'macos' && matrix.arch.matrix == 'arm' ) }} with: python-version: 3.7 From d179381ef9010b37abfaf0421239cd4b60424d63 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Tue, 21 Jun 2022 18:22:53 -0400 Subject: [PATCH 04/21] quote the versions --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 71889f90..05666003 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -68,19 +68,19 @@ jobs: - uses: Chia-Network/actions/setup-python@main if: ${{ !( matrix.os.matrix == 'macos' && matrix.arch.matrix == 'arm' ) }} with: - python-version: 3.7 + python-version: '3.7' - uses: Chia-Network/actions/setup-python@main with: - python-version: 3.8 + python-version: '3.8' - uses: Chia-Network/actions/setup-python@main with: - python-version: 3.9 + python-version: '3.9' - uses: Chia-Network/actions/setup-python@main with: - python-version: 3.10 + python-version: '3.10' - name: Lint source with flake8 run: | From 8684691585e8c2fc81e7b6060ef18cb1d5273c91 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Tue, 21 Jun 2022 18:25:34 -0400 Subject: [PATCH 05/21] newe cibuildwheel --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 05666003..5c7b87ae 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -100,7 +100,7 @@ jobs: python -m build --sdist --outdir dist . - name: Build ${{ matrix.os.name }} wheels and test - uses: joerick/cibuildwheel@v2.3.1 + uses: pypa/cibuildwheel@v2.7.0 with: output-dir: dist env: From 3272ddc52ec9b1b13063af0ec3983ebed990d85c Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Tue, 21 Jun 2022 18:30:18 -0400 Subject: [PATCH 06/21] make sure we've got pipx (?) --- .github/workflows/build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5c7b87ae..43a6ae28 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -99,6 +99,11 @@ jobs: pip install build python -m build --sdist --outdir dist . + - name: Install pipx for cibuildwheel + # TODO: shouldn't need this? + run: | + pip install pipx + - name: Build ${{ matrix.os.name }} wheels and test uses: pypa/cibuildwheel@v2.7.0 with: From 8ef37c47c70b458e518935f3865d54cf776d9687 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Tue, 21 Jun 2022 19:25:23 -0400 Subject: [PATCH 07/21] more matrix --- .github/workflows/build.yml | 39 +++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 43a6ae28..90bfaeec 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,6 +37,15 @@ jobs: matrix: windows runs-on: intel: [windows-latest] + python: + - major-dot-minor: '3.7' + cibw-build: 'cp37-*' + - major-dot-minor: '3.8' + cibw-build: 'cp38-*' + - major-dot-minor: '3.9' + cibw-build: 'cp39-*' + - major-dot-minor: '3.10' + cibw-build: 'cp310-*' arch: - name: ARM matrix: arm @@ -55,6 +64,19 @@ jobs: arch: name: ARM matrix: arm + - os: + name: macOS + matrix: macos + runs-on: + arm: [macOS, ARM64] + intel: [macos-latest] + python: + name: '3.7' + action: '3.7' + check: '3.7' + arch: + name: ARM + matrix: arm steps: - name: Clean workspace @@ -65,22 +87,9 @@ jobs: with: fetch-depth: 0 - - uses: Chia-Network/actions/setup-python@main - if: ${{ !( matrix.os.matrix == 'macos' && matrix.arch.matrix == 'arm' ) }} - with: - python-version: '3.7' - - - uses: Chia-Network/actions/setup-python@main - with: - python-version: '3.8' - - - uses: Chia-Network/actions/setup-python@main - with: - python-version: '3.9' - - uses: Chia-Network/actions/setup-python@main with: - python-version: '3.10' + python-version: ${{ matrix.python.major-dot-minor }} - name: Lint source with flake8 run: | @@ -112,7 +121,7 @@ jobs: CIBW_BUILD_VERBOSITY_MACOS: 0 CIBW_BUILD_VERBOSITY_LINUX: 0 CIBW_BUILD_VERBOSITY_WINDOWS: 0 - CIBW_BUILD: cp37-* cp38-* cp39-* cp310-* + CIBW_BUILD: ${{ matrix.python.cibw-build }} CIBW_SKIP: '*-manylinux_i686 *-win32 *-musllinux_*' CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014 CIBW_MANYLINUX_X86_64_IMAGE: manylinux2010 From 132b13628ba99271f1689d3b45ea4e1576658516 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Tue, 21 Jun 2022 19:29:13 -0400 Subject: [PATCH 08/21] and name --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 90bfaeec..be62d538 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,7 +17,7 @@ concurrency: jobs: build_wheels: - name: Build wheel on ${{ matrix.os.name }} ${{ matrix.arch.name }} + name: Build wheel on ${{ matrix.os.name }} ${{ matrix.arch.name }} ${{ matrix.python.major-dot-minor }} runs-on: ${{ matrix.os.runs-on[matrix.arch.matrix] }} strategy: fail-fast: false From 80dc19b5a66cab229b90af01e6a109da79ab1e1e Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Tue, 21 Jun 2022 19:34:09 -0400 Subject: [PATCH 09/21] mm --- .github/workflows/build.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index be62d538..b55ee7d0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,6 +28,9 @@ jobs: runs-on: arm: [macOS, ARM64] intel: [macos-latest] + cibw-archs-macos: + arm: arm64 + intel: x86_64 - name: Ubuntu matrix: ubuntu runs-on: @@ -144,9 +147,7 @@ jobs: && uname -a CIBW_BEFORE_BUILD_LINUX: > python -m pip install --upgrade pip - # CIBW_ARCHS_MACOS: x86_64 arm64 universal2 - CIBW_ARCHS_MACOS: x86_64 - CIBW_TEST_SKIP: '*_arm64 *_universal2:arm64' + CIBW_ARCHS_MACOS: ${{ matrix.cibw-archs-macos[matrix.arch.matrix] }} CIBW_BEFORE_ALL_MACOS: > brew install boost CIBW_BEFORE_BUILD_MACOS: > From 058088df3af7a6d9b4ae923af56383150ca684a8 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Tue, 21 Jun 2022 19:36:23 -0400 Subject: [PATCH 10/21] oops --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b55ee7d0..015b0bc8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -147,7 +147,7 @@ jobs: && uname -a CIBW_BEFORE_BUILD_LINUX: > python -m pip install --upgrade pip - CIBW_ARCHS_MACOS: ${{ matrix.cibw-archs-macos[matrix.arch.matrix] }} + CIBW_ARCHS_MACOS: ${{ matrix.os.cibw-archs-macos[matrix.arch.matrix] }} CIBW_BEFORE_ALL_MACOS: > brew install boost CIBW_BEFORE_BUILD_MACOS: > From f33371ed3691e7af2e634451c03d14be5265d443 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Tue, 21 Jun 2022 19:37:54 -0400 Subject: [PATCH 11/21] mm --- .github/workflows/build.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 015b0bc8..544aea2a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,12 +43,16 @@ jobs: python: - major-dot-minor: '3.7' cibw-build: 'cp37-*' + matrix: '3.7' - major-dot-minor: '3.8' cibw-build: 'cp38-*' + matrix: '3.8' - major-dot-minor: '3.9' cibw-build: 'cp39-*' + matrix: '3.9' - major-dot-minor: '3.10' cibw-build: 'cp310-*' + matrix: '3.10' arch: - name: ARM matrix: arm @@ -74,9 +78,9 @@ jobs: arm: [macOS, ARM64] intel: [macos-latest] python: - name: '3.7' - action: '3.7' - check: '3.7' + major-dot-minor: '3.7' + cibw-build: 'cp37-*' + matrix: '3.7' arch: name: ARM matrix: arm From e22d819129d876371993ab718e25795092f2e2af Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Tue, 21 Jun 2022 19:46:14 -0400 Subject: [PATCH 12/21] install more for macos --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 544aea2a..49f58465 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -153,7 +153,7 @@ jobs: python -m pip install --upgrade pip CIBW_ARCHS_MACOS: ${{ matrix.os.cibw-archs-macos[matrix.arch.matrix] }} CIBW_BEFORE_ALL_MACOS: > - brew install boost + brew install gmp boost cmake CIBW_BEFORE_BUILD_MACOS: > python -m pip install --upgrade pip CIBW_ENVIRONMENT_MACOS: "MACOSX_DEPLOYMENT_TARGET=10.14 BUILD_VDF_CLIENT=N" From 1de3cd1e43d7f7d4da3cf32076d1bf7f0aaf97ea Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Tue, 21 Jun 2022 20:18:24 -0400 Subject: [PATCH 13/21] no macOS 3.8 ARM --- .github/workflows/build.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 49f58465..14ad2297 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -84,6 +84,19 @@ jobs: arch: name: ARM matrix: arm + - os: + name: macOS + matrix: macos + runs-on: + arm: [macOS, ARM64] + intel: [macos-latest] + python: + major-dot-minor: '3.8' + cibw-build: 'cp38-*' + matrix: '3.8' + arch: + name: ARM + matrix: arm steps: - name: Clean workspace @@ -110,6 +123,7 @@ jobs: mypy --config-file mypi.ini setup.py tests - name: Build source distribution with macOS + # TODO: only do this once, probably same for linting etc if: matrix.os.matrix == 'macos' run: | pip install build From 558e6913e8519ab9bb7122d88b41143a3083d7b6 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Tue, 21 Jun 2022 21:25:49 -0400 Subject: [PATCH 14/21] split up build vs. build vs. check vs. upload --- .github/workflows/build.yml | 156 ++++++++++++++++++++++++++++++++++++ 1 file changed, 156 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 14ad2297..164020ff 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -229,3 +229,159 @@ jobs: TWINE_NON_INTERACTIVE: 1 TWINE_PASSWORD: ${{ secrets.test_pypi_password }} run: twine upload --non-interactive --skip-existing --verbose 'dist/*' + + build_sdist: + name: Build sdist on ${{ matrix.os.name }} ${{ matrix.arch.name }} ${{ matrix.python.major-dot-minor }} + runs-on: ${{ matrix.os.runs-on[matrix.arch.matrix] }} + strategy: + fail-fast: false + matrix: + os: + - name: Ubuntu + matrix: ubuntu + runs-on: + arm: [Linux, ARM64] + intel: [ubuntu-latest] + python: + - major-dot-minor: '3.9' + matrix: '3.9' + arch: + - name: Intel + matrix: intel + + steps: + - name: Clean workspace + uses: Chia-Network/actions/clean-workspace@main + + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - uses: Chia-Network/actions/setup-python@main + with: + python-version: ${{ matrix.python.major-dot-minor }} + + - name: Build source distribution + run: | + pip install build + python -m build --sdist --outdir dist . + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: wheels + path: ./dist + + check: + name: Build sdist on ${{ matrix.os.name }} ${{ matrix.arch.name }} ${{ matrix.python.major-dot-minor }} + runs-on: ${{ matrix.os.runs-on[matrix.arch.matrix] }} + strategy: + fail-fast: false + matrix: + os: + - name: Ubuntu + matrix: ubuntu + runs-on: + arm: [Linux, ARM64] + intel: [ubuntu-latest] + python: + - major-dot-minor: '3.9' + matrix: '3.9' + arch: + - name: Intel + matrix: intel + + steps: + - name: Clean workspace + uses: Chia-Network/actions/clean-workspace@main + + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - uses: Chia-Network/actions/setup-python@main + with: + python-version: ${{ matrix.python.major-dot-minor }} + + - name: Lint source with flake8 + run: | + pip install flake8 + flake8 tests setup.py + + - name: Lint source with mypy + run: | + pip install mypy + mypy --config-file mypi.ini setup.py tests + + upload: + name: Upload to PyPI + runs-on: ${{ matrix.os.runs-on[matrix.arch.matrix] }} + needs: + - build-wheels + - build-sdist + - check + strategy: + fail-fast: false + matrix: + os: + - name: Ubuntu + matrix: ubuntu + runs-on: + arm: [Linux, ARM64] + intel: [ubuntu-latest] + python: + - major-dot-minor: '3.9' + matrix: '3.9' + arch: + - name: Intel + matrix: intel + + steps: + - name: Clean workspace + uses: Chia-Network/actions/clean-workspace@main + + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - uses: Chia-Network/actions/setup-python@main + with: + python-version: ${{ matrix.python.major-dot-minor }} + + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: wheels + + - name: Test for secrets access + id: check_secrets + shell: bash + run: | + unset HAS_SECRET + if [ -n "$SECRET" ]; then HAS_SECRET='true' ; fi + echo ::set-output name=HAS_SECRET::${HAS_SECRET} + env: + SECRET: "${{ secrets.test_pypi_password }}" + + - name: Install twine + run: pip install twine + + - name: Publish distribution to PyPI + if: startsWith(github.event.ref, 'refs/tags') && steps.check_secrets.outputs.HAS_SECRET + env: + TWINE_USERNAME: __token__ + TWINE_NON_INTERACTIVE: 1 + TWINE_PASSWORD: ${{ secrets.pypi_password }} + run: twine upload --non-interactive --skip-existing --verbose 'dist/*' + + - name: Publish distribution to Test PyPI + if: steps.check_secrets.outputs.HAS_SECRET + env: + TWINE_REPOSITORY_URL: https://test.pypi.org/legacy/ + TWINE_USERNAME: __token__ + TWINE_NON_INTERACTIVE: 1 + TWINE_PASSWORD: ${{ secrets.test_pypi_password }} + run: twine upload --non-interactive --skip-existing --verbose 'dist/*' From abebc7043b8a5cd88d95b276fe4b80bd1ad182a1 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Tue, 21 Jun 2022 21:30:48 -0400 Subject: [PATCH 15/21] yup --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 164020ff..929f9def 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: Build Wheels +name: Build, Check, and Upload on: push: @@ -230,7 +230,7 @@ jobs: TWINE_PASSWORD: ${{ secrets.test_pypi_password }} run: twine upload --non-interactive --skip-existing --verbose 'dist/*' - build_sdist: + build-sdist: name: Build sdist on ${{ matrix.os.name }} ${{ matrix.arch.name }} ${{ matrix.python.major-dot-minor }} runs-on: ${{ matrix.os.runs-on[matrix.arch.matrix] }} strategy: From bdeea5e046c10d68e6336a6892c73c016d6eb009 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Tue, 21 Jun 2022 21:32:47 -0400 Subject: [PATCH 16/21] go dash --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 929f9def..03a89013 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,7 +16,7 @@ concurrency: cancel-in-progress: true jobs: - build_wheels: + build-wheels: name: Build wheel on ${{ matrix.os.name }} ${{ matrix.arch.name }} ${{ matrix.python.major-dot-minor }} runs-on: ${{ matrix.os.runs-on[matrix.arch.matrix] }} strategy: From 99a92d9164473ea1af0679cb297e15cbebf3f2fc Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Tue, 21 Jun 2022 21:42:51 -0400 Subject: [PATCH 17/21] tweak --- .github/workflows/build.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 03a89013..87e0a4b7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -195,9 +195,9 @@ jobs: CIBW_TEST_COMMAND: py.test -v {project}/tests - name: Upload artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: - name: wheels + name: packages path: ./dist - name: Test for secrets access @@ -268,9 +268,9 @@ jobs: python -m build --sdist --outdir dist . - name: Upload artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: - name: wheels + name: packages path: ./dist check: @@ -352,9 +352,10 @@ jobs: python-version: ${{ matrix.python.major-dot-minor }} - name: Download artifacts - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: - name: wheels + name: packages + path: ./dist - name: Test for secrets access id: check_secrets From c3d42f25695863205e3be63e544ac5ec2cec67bc Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Tue, 21 Jun 2022 22:34:59 -0400 Subject: [PATCH 18/21] drop the extra sdist build --- .github/workflows/build.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 87e0a4b7..811eb74b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -122,13 +122,6 @@ jobs: pip install mypy mypy --config-file mypi.ini setup.py tests - - name: Build source distribution with macOS - # TODO: only do this once, probably same for linting etc - if: matrix.os.matrix == 'macos' - run: | - pip install build - python -m build --sdist --outdir dist . - - name: Install pipx for cibuildwheel # TODO: shouldn't need this? run: | From 209cc3fdacf6cd2d1fcefbaf6954cadd98e33b3a Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Tue, 21 Jun 2022 22:35:12 -0400 Subject: [PATCH 19/21] drop the pipx install --- .github/workflows/build.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 811eb74b..727afdc6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -122,11 +122,6 @@ jobs: pip install mypy mypy --config-file mypi.ini setup.py tests - - name: Install pipx for cibuildwheel - # TODO: shouldn't need this? - run: | - pip install pipx - - name: Build ${{ matrix.os.name }} wheels and test uses: pypa/cibuildwheel@v2.7.0 with: From 06c9000d52716f487b62a01250c5ddf6c236671b Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Wed, 22 Jun 2022 10:02:24 -0400 Subject: [PATCH 20/21] cleanup --- .github/workflows/build.yml | 55 +++++-------------------------------- 1 file changed, 7 insertions(+), 48 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 727afdc6..99d7272e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: Build, Check, and Upload +name: build - check - upload on: push: @@ -17,7 +17,7 @@ concurrency: jobs: build-wheels: - name: Build wheel on ${{ matrix.os.name }} ${{ matrix.arch.name }} ${{ matrix.python.major-dot-minor }} + name: Wheel - ${{ matrix.os.name }} ${{ matrix.python.major-dot-minor }} ${{ matrix.arch.name }} runs-on: ${{ matrix.os.runs-on[matrix.arch.matrix] }} strategy: fail-fast: false @@ -111,18 +111,7 @@ jobs: with: python-version: ${{ matrix.python.major-dot-minor }} - - name: Lint source with flake8 - run: | - python -m pip install --upgrade pip - pip install flake8 - flake8 tests setup.py - - - name: Lint source with mypy - run: | - pip install mypy - mypy --config-file mypi.ini setup.py tests - - - name: Build ${{ matrix.os.name }} wheels and test + - name: Build and test uses: pypa/cibuildwheel@v2.7.0 with: output-dir: dist @@ -188,38 +177,8 @@ jobs: name: packages path: ./dist - - name: Test for secrets access - id: check_secrets - shell: bash - run: | - unset HAS_SECRET - if [ -n "$SECRET" ]; then HAS_SECRET='true' ; fi - echo ::set-output name=HAS_SECRET::${HAS_SECRET} - env: - SECRET: "${{ secrets.test_pypi_password }}" - - - name: Install twine - run: pip install twine - - - name: Publish distribution to PyPI - if: startsWith(github.event.ref, 'refs/tags') && steps.check_secrets.outputs.HAS_SECRET - env: - TWINE_USERNAME: __token__ - TWINE_NON_INTERACTIVE: 1 - TWINE_PASSWORD: ${{ secrets.pypi_password }} - run: twine upload --non-interactive --skip-existing --verbose 'dist/*' - - - name: Publish distribution to Test PyPI - if: steps.check_secrets.outputs.HAS_SECRET - env: - TWINE_REPOSITORY_URL: https://test.pypi.org/legacy/ - TWINE_USERNAME: __token__ - TWINE_NON_INTERACTIVE: 1 - TWINE_PASSWORD: ${{ secrets.test_pypi_password }} - run: twine upload --non-interactive --skip-existing --verbose 'dist/*' - build-sdist: - name: Build sdist on ${{ matrix.os.name }} ${{ matrix.arch.name }} ${{ matrix.python.major-dot-minor }} + name: sdist runs-on: ${{ matrix.os.runs-on[matrix.arch.matrix] }} strategy: fail-fast: false @@ -262,7 +221,7 @@ jobs: path: ./dist check: - name: Build sdist on ${{ matrix.os.name }} ${{ matrix.arch.name }} ${{ matrix.python.major-dot-minor }} + name: Check runs-on: ${{ matrix.os.runs-on[matrix.arch.matrix] }} strategy: fail-fast: false @@ -293,12 +252,12 @@ jobs: with: python-version: ${{ matrix.python.major-dot-minor }} - - name: Lint source with flake8 + - name: flake8 run: | pip install flake8 flake8 tests setup.py - - name: Lint source with mypy + - name: mypy run: | pip install mypy mypy --config-file mypi.ini setup.py tests From d25aa72c83ed11edc801be23e703b959c3290dd5 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Wed, 22 Jun 2022 10:30:24 -0400 Subject: [PATCH 21/21] use our platform etc names instead of the default added ones --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 99d7272e..8789338a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -178,7 +178,7 @@ jobs: path: ./dist build-sdist: - name: sdist + name: sdist - ${{ matrix.os.name }} ${{ matrix.python.major-dot-minor }} ${{ matrix.arch.name }} runs-on: ${{ matrix.os.runs-on[matrix.arch.matrix] }} strategy: fail-fast: false @@ -221,7 +221,7 @@ jobs: path: ./dist check: - name: Check + name: Check - ${{ matrix.os.name }} ${{ matrix.python.major-dot-minor }} ${{ matrix.arch.name }} runs-on: ${{ matrix.os.runs-on[matrix.arch.matrix] }} strategy: fail-fast: false @@ -263,7 +263,7 @@ jobs: mypy --config-file mypi.ini setup.py tests upload: - name: Upload to PyPI + name: Upload to PyPI - ${{ matrix.os.name }} ${{ matrix.python.major-dot-minor }} ${{ matrix.arch.name }} runs-on: ${{ matrix.os.runs-on[matrix.arch.matrix] }} needs: - build-wheels