diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 65fc41468..defb6394b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,7 +18,8 @@ jobs: runs-on: windows-latest strategy: matrix: - python-version: [3.5, 3.6, 3.7, 3.8] + python-version: [3.5, 3.6, 3.7, 3.8, 3.9] + python-architecture: [x64, x86] steps: - name: Cache .hunter folder uses: actions/cache@v2 @@ -32,9 +33,10 @@ jobs: uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} + architecture: ${{ matrix.python-architecture }} - name: Append build hash if not a tagged commit if: startsWith(github.ref, 'refs/tags/v') != true - run: echo '::set-env name=BUILD_COMMIT_HASH::${{github.sha}}' + run: echo "BUILD_COMMIT_HASH=${{github.sha}}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - name: Install dependencies run: | python -m pip install --upgrade pip @@ -51,7 +53,7 @@ jobs: runs-on: macos-latest strategy: matrix: - python-version: [3.5, 3.6, 3.7, 3.8] + python-version: [3.5, 3.6, 3.7, 3.8, 3.9] steps: - name: Cache .hunter folder uses: actions/cache@v2 @@ -67,14 +69,14 @@ jobs: python-version: ${{ matrix.python-version }} - name: Append build hash if not a tagged commit if: startsWith(github.ref, 'refs/tags/v') != true - run: echo '::set-env name=BUILD_COMMIT_HASH::${{github.sha}}' + run: echo "BUILD_COMMIT_HASH=${{github.sha}}" >> $GITHUB_ENV - name: Install dependencies run: | python -m pip install --upgrade pip brew install libusb python -m pip install delocate - name: Set macos deployment target - run: echo '::set-env name=MACOSX_DEPLOYMENT_TARGET::10.9' + run: echo "MACOSX_DEPLOYMENT_TARGET=10.9" >> $GITHUB_ENV - name: Building wheels run: python -m pip wheel . -w ./wheelhouse/ - name: Auditing wheels @@ -111,10 +113,10 @@ jobs: run: mkdir -p wheelhouse/audited/ - name: Append build hash if not a tagged commit if: startsWith(github.ref, 'refs/tags/v') != true - run: echo '::set-env name=BUILD_COMMIT_HASH::${{github.sha}}' + run: echo "BUILD_COMMIT_HASH=${{github.sha}}" >> $GITHUB_ENV - name: Building a source distribution run: | - /opt/python/cp38-cp38/bin/python3.8 setup.py sdist --formats=gztar,zip + /opt/python/cp38-cp38/bin/python3.8 setup.py sdist --formats=gztar mv dist/* wheelhouse/audited/ - name: Building wheels run: for PYBIN in /opt/python/cp3*/bin; do "${PYBIN}/pip" wheel . -w ./wheelhouse/; done @@ -141,7 +143,7 @@ jobs: submodules: 'recursive' - name: Append build hash if not a tagged commit if: startsWith(github.ref, 'refs/tags/v') != true - run: echo '::set-env name=BUILD_COMMIT_HASH::${{github.sha}}' + run: echo "BUILD_COMMIT_HASH=${{github.sha}}" >> $GITHUB_ENV - name: Building wheel run: python3 -m pip wheel . -w ./wheelhouse/ - name: Auditing wheel diff --git a/CMakeLists.txt b/CMakeLists.txt index 38379f64f..9147c392b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,10 +53,13 @@ target_link_libraries(${TARGET_NAME} # Add bindings revision target_compile_definitions(${TARGET_NAME} PRIVATE DEPTHAI_PYTHON_BINDINGS_REVISION="${PROJECT_VERSION}") -# Add commit hash, default to "dev" -if(NOT DEPTHAI_PYTHON_COMMIT_HASH) + +# Add default commit hash (dev) if not build by CI +if(NOT DEFINED ENV{CI} AND NOT DEPTHAI_PYTHON_COMMIT_HASH) set(DEPTHAI_PYTHON_COMMIT_HASH dev) endif() + +# Add compile definition for bindings if(DEPTHAI_PYTHON_COMMIT_HASH) target_compile_definitions(${TARGET_NAME} PRIVATE DEPTHAI_PYTHON_COMMIT_HASH="${DEPTHAI_PYTHON_COMMIT_HASH}") endif() diff --git a/depthai-core b/depthai-core index 56ddc626e..2c9da502a 160000 --- a/depthai-core +++ b/depthai-core @@ -1 +1 @@ -Subproject commit 56ddc626e264d95803458cf1e88a68603ba03c5e +Subproject commit 2c9da502aff27f9271875a349abef6f7d1684d1d