Skip to content

Commit

Permalink
Merge branch 'add-mmh3' of https://github.com/CityOfZion/neo3crypto i…
Browse files Browse the repository at this point in the history
…nto add-mmh3
  • Loading branch information
ixje committed Aug 8, 2022
2 parents 1ffae1f + b522536 commit 0aea9cd
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 4 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/build-python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Builds Python wheels and create a draft release
name: Build Python release

on: [workflow_dispatch]

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, macos-11, windows-2019]

steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BEFORE_BUILD_LINUX: "python3 -m pip install cmake"
CIBW_BUILD: "cp38-macosx_x86_64 cp38-manylinux_x86_64 cp38-win_amd64 cp39-macosx_x86_64 cp39-manylinux_x86_64 cp39-win_amd64 cp310-macosx_x86_64 cp310-win_amd64 cp310-manylinux_x86_64"
- name: Deploy
uses: softprops/action-gh-release@v1
with:
tag_name: Draft
name: Draft
draft: true
files: |
./wheelhouse/*.whl
env:
GITHUB_TOKEN: ${{ secrets.deploy }}
50 changes: 50 additions & 0 deletions .github/workflows/python-release-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Deploy the latest published release to PyPi or Test PyPi

name: Release to PyPi
on:
workflow_dispatch:
inputs:
pypi-target:
description: Deploy to PyPi [Main] or [Test]
required: true
default: 'Main'

jobs:
deploy-pypi:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Download wheels
uses: robinraju/[email protected]
with:
repository: "CityOfZion/neo3crypto"
# Latest does not work on pre-release versions, it will error with a 404.
latest: true
tarBall: false
zipBall: false
# download all files
fileName: "*"
out-file-path: "dist"
token: ${{ secrets.GITHUB_TOKEN }}
- if: github.event.inputs.pypi-target == 'Main'
name: Publish to PyPi
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload dist/*
- if: github.event.inputs.pypi-target == 'Test'
name: Publish to Test-PyPi
env:
TWINE_USERNAME: ${{ secrets.PYPI_TEST_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_TEST_PASSWORD }}
run: |
twine upload --repository testpypi dist/*
6 changes: 5 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ Installation

Or download the wheels from the Github releases page.

Windows users
=============
If installing fails with the error ``No Matching distribution found`` then upgrade your Python installation to use the latest post release version (i.e. ``3.8.8`` instead of ``3.8.0``)

Usage
~~~~~

Expand All @@ -43,4 +47,4 @@ using ``help(neo3crypto)``.

Building wheels
~~~~~~~~~~~~~~~
Make sure to have ``wheel`` and ``CMake`` installed. Then call ``python setup.py bdist_wheel``.
Make sure to have ``wheel`` and ``CMake`` installed. Then call ``python setup.py bdist_wheel``.
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
from setuptools.command.install_lib import install_lib as install_lib_orig
from distutils.version import LooseVersion

if sys.version_info < (3, 7):
sys.exit('Python < 3.7 is not supported')
if sys.version_info < (3, 8):
sys.exit('Python < 3.8 is not supported')

exclude = ['*-obj*', 'tools']

Expand Down Expand Up @@ -61,7 +61,7 @@ def build_extension(self, ext):
'-DPYTHON_EXECUTABLE=' + sys.executable]

# cfg = 'Debug' if self.debug else 'Release'
cfg = 'Debug'
cfg = 'Release'
build_args = ['--config', cfg]

if platform.system() == "Windows":
Expand Down Expand Up @@ -89,6 +89,7 @@ def build_extension(self, ext):
author='Erik van den Brink',
author_email='[email protected]',
name='neo3crypto',
python_requires='>=3.8.*',
description="Native crypto functions for the NEO 3 Blockchain",
long_description=readme,
long_description_content_type="text/x-rst",
Expand Down

0 comments on commit 0aea9cd

Please sign in to comment.