From 537ba72aff73d892574e143d509547af39721760 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rennfanz=2C=20Bj=C3=B6rn?= Date: Tue, 7 Nov 2023 16:12:03 +0100 Subject: [PATCH] Add github actions for windows builds. --- .appveyor.yml | 72 -------------------------------------- .github/workflows/main.yml | 52 ++++++++++++++++++++++++++- 2 files changed, 51 insertions(+), 73 deletions(-) delete mode 100644 .appveyor.yml diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index af6a520..0000000 --- a/.appveyor.yml +++ /dev/null @@ -1,72 +0,0 @@ -image: Visual Studio 2022 -environment: - TWINE_USERNAME: basler - #Enable this for testing purposes - #TWINE_REPOSITORY_URL: https://test.pypi.org/legacy/ - TWINE_PASSWORD: - #test.pypi password - #secure: qtg34Wv7b/cdAuvvAnqDZA== - #pypi passwd - secure: pLJjpvmtL1FeCwdEWzqH1hHBsNvJTa7nxkj4lhVEKVY= - - matrix: - # For Python versions available on Appveyor, see - # http://www.appveyor.com/docs/installed-software#python - # The list here is complete (excluding Python 2.6, which - # isn't covered by this document) at the time of writing. - - - PYTHON: "C:\\Python36-x64" - - PYTHON: "C:\\Python37-x64" - - PYTHON: "C:\\Python38-x64" - - PYTHON: "C:\\Python39-x64" - - PYTHON: "C:\\Python310-x64" - - PYTHON: "C:\\Python311-x64" - -install: - # Install an outdated version of colorama and readme_renderer because these are the last ones with python 3.4 support (https://github.com/pypa/readme_renderer/releases/tag/25.0) - # Otherwise wheel/twine install fails on python 3.4 - # Install setuptools >= 38.6 because this version introduced long_description_content_type which is required by current pypi - - "%PYTHON%\\python.exe -m pip install \"colorama==0.4.1\" \"readme_renderer==24.0\" \"setuptools>=38.6.0\"" - - # We need wheel installed to build wheels - - "%PYTHON%\\python.exe -m pip install wheel twine" - # install swig and put it on the path. Retry because of network issues with sourceforge - - appveyor-retry curl -sSfL -o swigwin.zip https://prdownloads.sourceforge.net/swig/swigwin-4.1.1.zip - - 7z x swigwin.zip -oC:\ > NUL - - set PATH=C:\swigwin-4.1.1;%PATH% - # install pylon - - appveyor-retry curl -sSfL -o pylon_installer.exe %PYLON_DOWNLOAD_URL_BASE%basler_pylon_7_4_0_14900.exe - - pylon_installer.exe /quiet /install="GigE_Support;USB_Support;Camera_Link_Support;CoaXPress_Support;GenTL_Consumer_Support;CamEmu_Support;SDKs;DataProcessing_SDK" - # PYLON_DEV_DIR is not available in the shell after installation, so we set it manually - - set PYLON_DEV_DIR=%PROGRAMFILES%\Basler\pylon 7\Development - # install numpy for the unittests - - "%PYTHON%\\python.exe -m pip install numpy" - -build_script: - - "scripts\\build\\msvc_build_wrapper.cmd %PYTHON%\\python.exe setup.py test" - - "scripts\\build\\msvc_build_wrapper.cmd %PYTHON%\\python.exe setup.py bdist_wheel" - -test_script: -# Unit Tests fail to run on python 2.7 -# - "%PYTHON%\\python.exe -m pip install numpy" -# - "scripts\\build\\msvc_build_wrapper.cmd %PYTHON%\\python.exe setup.py test" - -artifacts: - - path: dist\* - -deploy: - #release: pypylon-$(appveyor_build_version) - provider: GitHub - auth_token: - secure: j8A/M6GD82ZXpIqm6OhRj1nxQ52/DncI074LXnkBhGFQxPQTt6Hc4ABIfdJ37sIX - artifact: /.*\.whl/ - force_update: true - on: - appveyor_repo_tag: true # deploy on tag push only - -#use after_deploy instead of deploy_script as deploy_script disables the default deployment providers -after_deploy: - - echo "Starting Artifact Deployment" - - ps: Push-AppveyorArtifact dist/* - - ps: If ($env:APPVEYOR_REPO_TAG -eq "true") { Invoke-Expression "$env:PYTHON\\Scripts\\twine upload --verbose --skip-existing dist/*" 2>$null } Else { write-output "Not on a tag, won't deploy to pypi"} - - echo "Finished Artifact Deployment" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a70b82d..7e6637e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -35,6 +35,7 @@ jobs: ${PYLON_DOWNLOAD_URL_BASE_7_4}pylon_7.4.0.14900_linux_aarch64_setup.tar.gz ${PYLON_DOWNLOAD_URL_BASE}pylon_6.2.0.21487_armhf_setup.tar.gz ${PYLON_DOWNLOAD_URL_BASE}pylon_7_3_1_0011.dmg + ${PYLON_DOWNLOAD_URL_BASE}basler_pylon_7_4_0_14900.exe EOF - uses: actions/cache@v3 id: cache @@ -126,6 +127,54 @@ jobs: python3 -m twine upload --non-interactive --skip-existing dist/* + build-windows: + needs: prepare + runs-on: windows-2019 + strategy: + fail-fast: false + steps: + - uses: actions/checkout@v3 + + - name: Install Python + uses: actions/setup-python@v4 + with: + python-version: "3.6 - 3.11" + + - uses: actions/download-artifact@v3 + with: + name: pylon-installer + path: pylon-installer + + - name: Setup pylon + run: | + # install pylon + cd pylon-installer + basler_pylon_7_4_0_14900.exe /quiet /install="GigE_Support;USB_Support;Camera_Link_Support;CoaXPress_Support;GenTL_Consumer_Support;CamEmu_Support;SDKs;DataProcessing_SDK" + + - name: Build wheels + uses: pypa/cibuildwheel@v2.13.0 + env: + PYLON_DEV_DIR: "C:\Program Files\Basler\pylon 7\Development" + + - uses: actions/upload-artifact@v3 + with: + path: ./wheelhouse/*.whl + + - name: Upload Release Asset + if: needs.prepare.outputs.is_release_build == 'true' + uses: softprops/action-gh-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + files: ./wheelhouse/*.whl + + - name: Publish package to (Test)PyPI + if: needs.prepare.outputs.is_release_build == 'true' + run: | + sudo pip install twine + python -m twine upload --non-interactive --skip-existing wheelhouse/* + + build-macos: needs: prepare runs-on: macos-11 @@ -181,7 +230,8 @@ jobs: needs: [ prepare, build-linux, - build-macos + build-macos, + build-windows ] runs-on: ubuntu-latest steps: