diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml deleted file mode 100644 index 97046a7..0000000 --- a/.github/workflows/pypi-publish.yml +++ /dev/null @@ -1,61 +0,0 @@ -# This workflow will install Python dependencies, run tests and lint with a single version of Python -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - -name: Publish to PyPI - -on: - push: - tags: "*" - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - with: - submodules: true - - name: 'Install dependencies' - run: | - sudo apt-get install zlib1g-dev - - name: Set up Python 3.9 - uses: actions/setup-python@v2 - with: - python-version: 3.9 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install flake8 pytest tox cython numpy - cd extern/rds2cpp - cmake . - ls -la - cd ../.. - # - name: Lint with flake8 - # run: | - # # stop the build if there are Python syntax errors or undefined names - # flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - # # flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Test with tox - run: | - python setup.py build_ext --inplace - tox - - name: Build docs - run: | - tox -e docs - - run: touch ./docs/_build/html/.nojekyll - - name: GH Pages Deployment - uses: JamesIves/github-pages-deploy-action@4.1.3 - with: - branch: gh-pages # The branch the action should deploy to. - folder: ./docs/_build/html - clean: true # Automatically remove deleted files from the deploy branch - - name: Build Project and Publish - run: | - tox -e clean,build -- --sdist - - name: Publish package - uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 - with: - user: __token__ - password: ${{ secrets.PYPI_PASSWORD }} \ No newline at end of file diff --git a/.github/workflows/pypi-test.yml b/.github/workflows/pypi-test.yml index eb5cc97..28457ac 100644 --- a/.github/workflows/pypi-test.yml +++ b/.github/workflows/pypi-test.yml @@ -3,42 +3,100 @@ name: Test the library -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] +on: [push, pull_request] jobs: - build: + test: + name: Running tests + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + submodules: true + - name: "Install dependencies" + run: | + sudo apt-get install zlib1g-dev + - name: Set up Python 3.9 + uses: actions/setup-python@v2 + with: + python-version: 3.9 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 pytest tox cython numpy + cd extern/rds2cpp + cmake . + cd ../.. + - name: Test with tox + run: | + python setup.py build_ext --inplace + tox + + build_wheels: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-20.04, macos-11] # at some point get this to work on windows-2019 + + steps: + - uses: actions/checkout@v3 + with: + submodules: true + + - name: Install dependencies + run: | + cd extern/rds2cpp + cmake . + cd ../.. + + - name: Build wheels + uses: pypa/cibuildwheel@v2.12.1 + env: + CIBW_ARCHS_MACOS: x86_64 arm64 + - uses: actions/upload-artifact@v3 + with: + path: ./wheelhouse/*.whl + + build_sdist: + name: Build source distribution runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: true + + - name: Install dependencies + run: | + cd extern/rds2cpp + cmake . + cd ../.. + + - name: Build sdist + run: pipx run build --sdist + - uses: actions/upload-artifact@v3 + with: + path: dist/*.tar.gz + + upload_pypi: + needs: [test, build_wheels, build_sdist] + runs-on: ubuntu-latest + # upload to PyPI on every tag starting with 'v' + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') + # alternatively, to publish when a GitHub Release is created, use the following rule: + # if: github.event_name == 'release' && github.event.action == 'published' steps: - - uses: actions/checkout@v2 - with: - submodules: true - - name: 'Install dependencies' - run: | - sudo apt-get install zlib1g-dev - - name: Set up Python 3.9 - uses: actions/setup-python@v2 - with: - python-version: 3.9 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install flake8 pytest tox cython numpy - cd extern/rds2cpp - cmake . - cd ../.. - # - name: Lint with flake8 - # run: | - # # stop the build if there are Python syntax errors or undefined names - # flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - # # flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Test with tox - run: | - python setup.py build_ext --inplace - tox \ No newline at end of file + - uses: actions/download-artifact@v3 + with: + # unpacks default artifact into dist/ + # if `name: artifact` is omitted, the action will create extra parent dir + name: artifact + path: dist + + - uses: pypa/gh-action-pypi-publish@v1.8.3 + with: + user: __token__ + password: ${{ secrets.PYPI_PASSWORD }} diff --git a/extern/rds2cpp b/extern/rds2cpp index e18490b..0e685a4 160000 --- a/extern/rds2cpp +++ b/extern/rds2cpp @@ -1 +1 @@ -Subproject commit e18490b6cf6646db91ff0b10d590374bdfb2a2dc +Subproject commit 0e685a4ca25d98ddf6ece768a7de421c5749dec8