Create dependabot.yml #124
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: | |
- '*' | |
push: | |
branches: | |
- '*' | |
release: | |
types: | |
- published | |
jobs: | |
black: | |
name: black | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Setup | |
run: pip install black | |
- name: Lint with black | |
run: black --check --diff . | |
flake8: | |
name: flake8 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Setup | |
run: pip install flake8 | |
- name: Lint with flake8 | |
run: flake8 | |
isort: | |
name: isort | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Setup | |
run: pip install isort[colors] | |
- name: Lint with isort | |
run: isort --check --diff . | |
wheels: | |
name: Build wheel on ${{ matrix.os }} | |
needs: [black, isort, flake8] | |
runs-on: ${{ matrix.os }} | |
env: | |
CIBW_SKIP: pp* *-win32 | |
CIBW_TEST_REQUIRES: pytest | |
CIBW_TEST_COMMAND: "" | |
# we are copying the shared libraries ourselves so skip magical copy | |
CIBW_REPAIR_WHEEL_COMMAND_MACOS: "" | |
MACOSX_DEPLOYMENT_TARGET: 10.9 | |
CIBW_BUILD_VERBOSITY_MACOS: 3 | |
CIBW_TEST_SKIP: "*-macosx_arm64 *-macosx_universal2:arm64" | |
CIBW_ARCHS_MACOS: "x86_64 arm64" | |
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "" | |
CIBW_BEFORE_BUILD_LINUX: "" | |
strategy: | |
matrix: | |
os: [windows-latest, ubuntu-latest, macos-latest] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
name: Install Python | |
with: | |
python-version: '3.10' | |
- name: Install cibuildwheel | |
run: | | |
python -m pip install cibuildwheel | |
- uses: ilammy/msvc-dev-cmd@v1 | |
if: startsWith(matrix.os, 'windows') | |
- name: Build wheels | |
run: | | |
python3 -m cibuildwheel --output-dir wheelhouse | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ matrix.os }}-whl | |
path: wheelhouse/*.whl | |
wheels_aarch64: | |
name: Build wheel on aarch64 for ${{ matrix.python_tag }} | |
needs: [black, isort, flake8] | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python_tag: [ "cp39-*", "cp310-*","cp311-*", "cp312-*"] | |
env: | |
CIBW_ARCHS_LINUX: aarch64 | |
CIBW_BUILD: ${{matrix.python_tag}} | |
CIBW_TEST_REQUIRES: pytest numpy | |
CIBW_TEST_COMMAND: "" | |
CIBW_BEFORE_BUILD_LINUX: "" | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
name: Install Python | |
with: | |
python-version: '3.11' | |
- name: Install cibuildwheel | |
run: | | |
python -m pip install cibuildwheel | |
- uses: docker/setup-qemu-action@v1 | |
name: Set up QEMU | |
- name: Build wheels | |
run: | | |
python -m cibuildwheel --output-dir wheelhouse | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: aarch64-whl | |
path: wheelhouse/*.whl | |
collect-artifacts: | |
name: Package and push release | |
#needs: [windows-wheel, linux-wheel, osx-wheel, conda, ubuntu] | |
needs: [wheels, wheels_aarch64] | |
runs-on: 'ubuntu-latest' | |
strategy: | |
fail-fast: true | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
name: Install Python | |
with: | |
python-version: '3.10' | |
- name: Source | |
shell: bash -l {0} | |
run: | | |
python3 -m pip install --upgrade pip | |
python3 -m pip install setuptools | |
export PATH=$PATH:/home/runner/.local/bin | |
python3 setup.py sdist | |
- uses: actions/download-artifact@v2 | |
with: | |
path: dist | |
name: Download artifacts | |
- name: Display structure of downloaded files | |
run: ls -R | |
working-directory: dist | |
- name: Unpack | |
shell: bash -l {0} | |
working-directory: dist | |
run: | | |
for f in *whl | |
do | |
cd "$f" | |
cp *.whl .. | |
cd .. | |
done; | |
rm -rf *\-whl | |
ls -al | |
- uses: pypa/gh-action-pypi-publish@master | |
name: Publish package | |
if: github.event_name == 'release' && github.event.action == 'published' | |
with: | |
user: __token__ | |
password: ${{ secrets.pypi_token }} | |
packages_dir: ./dist |