Add workflow to publish python package

This commit is contained in:
Justin Traglia 2024-02-21 14:05:47 -06:00
parent 0bbededd08
commit 31c9b3269f
4 changed files with 62 additions and 4 deletions

53
.github/workflows/python-release.yml vendored Normal file
View File

@ -0,0 +1,53 @@
name: Upload Python Package
on:
push:
branches:
- main
release:
branches:
- main
jobs:
deploy:
runs-on: ${{ matrix.host }}
strategy:
matrix:
include:
# Linux
- host: ubuntu-latest
target: x86_64-unknown-linux-gnu
- host: ubuntu-latest
target: aarch64-unknown-linux-gnu
# MacOS
- host: macos-latest
target: x86_64-apple-darwin
- host: macos-latest
target: aarch64-apple-darwin
# Windows
- host: windows-latest
target: x86_64-pc-windows-msvc
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build CKZG
run: |
cd src
make
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
cd bindings/python
python setup.py bdist_wheel
twine upload dist/*

View File

@ -20,7 +20,6 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install py_ecc
pip install PyYAML
- name: Build BLST
run: |

View File

@ -1 +1,4 @@
build/
dist/
ckzg.egg-info/
src/

View File

@ -1,10 +1,12 @@
from distutils.core import setup, Extension
from setuptools import setup, Extension
def main():
setup(
name="ckzg",
version="1.0.0",
description="Python interface for C-KZG-4844",
version="1.4.2",
author="Ethereum Foundation",
description="Python bindings for C-KZG-4844",
ext_modules=[
Extension(
"ckzg",
@ -13,5 +15,6 @@ def main():
library_dirs=["../../lib"],
libraries=["blst"])])
if __name__ == "__main__":
main()