From 5f5ef346c8c506c2a7e802117ff39fe41c57b0f8 Mon Sep 17 00:00:00 2001 From: vertion Date: Sun, 31 Jul 2022 12:29:22 -0500 Subject: [PATCH] build wheels using Github actions - add test --- .github/workflows/build_wheels.yml | 65 ++++++++++++++++++++++++++++++ test.py | 7 ++++ 2 files changed, 72 insertions(+) create mode 100644 .github/workflows/build_wheels.yml create mode 100644 test.py diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml new file mode 100644 index 0000000..7f7edb7 --- /dev/null +++ b/.github/workflows/build_wheels.yml @@ -0,0 +1,65 @@ +name: Build and upload to PyPI + +# Build on every branch push, tag push, and pull request change: +on: [push, pull_request] + +jobs: + build_wheels: + name: Build wheels on ${{ matrix.archs }} for ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + - os: windows-2019 + archs: auto + + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-python@v2 + name: Install Python + with: + python-version: '3.9' + + - name: Build wheels + uses: joerick/cibuildwheel@v2.3.1 + env: + CIBW_TEST_COMMAND: "python {package}/test.py" + + - uses: actions/upload-artifact@v2 + with: + path: ./wheelhouse/*.whl + + build_sdist: + name: Build source distribution + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-python@v2 + name: Install Python + with: + python-version: '3.9' + + - name: Build sdist + run: python setup.py sdist + + - uses: actions/upload-artifact@v2 + with: + path: dist/*.tar.gz + + upload_pypi: + needs: [build_wheels, build_sdist] + runs-on: ubuntu-latest + # upload to PyPI on every tag starting with 'v' + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') + steps: + - uses: actions/download-artifact@v2 + with: + name: artifact + path: dist + + - uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.pypi_password }} diff --git a/test.py b/test.py new file mode 100644 index 0000000..8979a28 --- /dev/null +++ b/test.py @@ -0,0 +1,7 @@ +import ltc_scrypt + +teststart = '000000203a297b4b7685170d7644b43e5a6056234cc2414edde454a87580e1967d14c1078c13ea916117b0608732f3f65c2e03b81322efc0a62bcee77d8a9371261970a58a5a715da80e031b02560ad8' + +testbin = bytes.fromhex(teststart) +hash_bin_scrypt = ltc_scrypt.getPoWHash(testbin) +print("ltc_scrypt", hash_bin_scrypt.hex())