diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 0000000..1ad8098 --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,13 @@ +# continuous integration +name: ci + +on: + workflow_dispatch: + push: + # branches: [ "main" ] + pull_request: + +jobs: + lint: + name: 'publish to pypi' + uses: ./.github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..58d2765 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,64 @@ +# publish package to pypi +name: publish + +on: + workflow_call: + workflow_dispatch: + +jobs: + build_wheels: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ + ubuntu-20.04, + # macos-11, + # macos-12, + # windows-2019, + # windows-2022, + ] + + steps: + - uses: actions/checkout@v3 + with: + submodules: true + + - name: build wheels + uses: pypa/cibuildwheel@v2.12.0 + + - uses: actions/upload-artifact@v3 + with: + path: ./wheelhouse/*.whl + + make_sdist: + name: Make SDist + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 # gets full history for setuptools-scm + submodules: true + + - name: Build SDist + run: pipx run build --sdist + + - uses: actions/upload-artifact@v3 + with: + path: dist/*.tar.gz + + upload_all: + needs: [build_wheels, make_sdist] + runs-on: ubuntu-latest + if: github.event_name == 'release' && github.event.action == 'published' + steps: + + - uses: actions/download-artifact@v3 + with: + name: artifact + path: dist + + - uses: pypa/gh-action-pypi-publish@v1.5.0 + with: + user: __token__ + password: ${{ secrets.pypi_password }} diff --git a/.gitignore b/.gitignore index b6c4e54..705c88a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .vscode +wheelhouse # Byte-compiled / optimized / DLL files __pycache__/ diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..0adf701 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1 @@ +recursive-include third-party/sicgl/include * diff --git a/pyproject.toml b/pyproject.toml index 8038c1c..e80b9b3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,42 @@ +[project] +name = "pysicgl" +authors = [ + {name = "oclyke", email = "oclyke@gmail.com"}, +] +description = "sicgl for Python" +readme = "README.md" +requires-python = ">=3.7" +keywords = [ + "sicgl", + "2d", "2D", + "small", + "iterator", + "graphics", + "library", + "c", + "extension", +] +classifiers = [ + "Topic :: Multimedia :: Graphics", + "Programming Language :: Python :: 3", + "License :: OSI Approved :: MIT License", + "Development Status :: 3 - Alpha", +] +dynamic = [ + "version" +] + +[project.urls] +Source = "https://github.com/oclyke-dev/pysicgl" + +[build-system] +requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2"] +build-backend = "setuptools.build_meta" + +[tool.setuptools_scm] + +[tool.cibuildwheel] + [tool.black] include = ''' src\/.*\.pyi?$| diff --git a/setup.py b/setup.py index 60752e6..a502c3f 100644 --- a/setup.py +++ b/setup.py @@ -61,10 +61,6 @@ ) setup( - name="pysicgl", - version="0.0.0", - description="sicgl for Python", - author="oclyke", - url="https://github.com/oclyke/pysicgl", ext_modules=[pysicgl], + setup_requires=["setuptools_scm"], )