diff --git a/.github/workflows/win-build.yml b/.github/workflows/win-build.yml index 7940af7fe..39d62ed14 100644 --- a/.github/workflows/win-build.yml +++ b/.github/workflows/win-build.yml @@ -31,6 +31,8 @@ env: DOC_DB_LOG_LEVEL: "debug" JDBC_DRIVER_VERSION: "1.3.1" MONGO_IMPORT_COMMAND: "mongoimport.exe" + # Artifacts are created when pushing to develop branch on merge of pull requests. + SHOULD_CREATE_ARTIFACTS: ${{ github.event_name == 'push' && github.ref == 'refs/heads/develop' }} jobs: build-windows32: @@ -54,6 +56,11 @@ jobs: # with: # name: cppcheck-results # path: cppcheck-results.log + - name: Update environment with ODBC_DRIVER_VERSION + shell: pwsh + run: | + Get-Content ./src/ODBC_DRIVER_VERSION.txt | ForEach-Object { echo "ODBC_DRIVER_VERSION=$_"; break; } >> $env:GITHUB_ENV + - name: Get Java distribution uses: actions/setup-java@v2 with: @@ -122,6 +129,20 @@ jobs: env: OPENSSL_ROOT_DIR: '${{ env.VCPKG_ROOT }}/packages/openssl_x86-windows' + - name: Upload ODBC driver build at push to develop + if: ${{env.SHOULD_CREATE_ARTIFACTS == 'true'}} + uses: actions/upload-artifact@v3 + with: + name: docdb-odbc-driver-win32-${{env.ODBC_DRIVER_VERSION}} + path: build/odbc/cmake/Release + + - name: Upload performance test at push to develop + if: ${{env.SHOULD_CREATE_ARTIFACTS == 'true'}} + uses: actions/upload-artifact@v3 + with: + name: performance-win32-${{env.ODBC_DRIVER_VERSION}} + path: build/odbc/bin/Release/performance.exe + - name: register-driver run: | .\src\odbc\install\install_amd64.cmd ${{env.ODBC_BIN_PATH}}\documentdb.odbc.dll ${{env.ODBC_BIN_PATH}}\documentdb.odbc.dll @@ -203,6 +224,11 @@ jobs: # with: # name: cppcheck-results # path: cppcheck-results.log + - name: Update environment with ODBC_DRIVER_VERSION + shell: pwsh + run: | + Get-Content ./src/ODBC_DRIVER_VERSION.txt | ForEach-Object { echo "ODBC_DRIVER_VERSION=$_"; break; } >> $env:GITHUB_ENV + - name: Get Java distribution uses: actions/setup-java@v2 with: @@ -271,17 +297,17 @@ jobs: OPENSSL_ROOT_DIR: '${{env.VCPKG_ROOT}}/packages/openssl_x64-windows' - name: Upload ODBC driver build at push to develop - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/develop' }} + if: ${{env.SHOULD_CREATE_ARTIFACTS == 'true'}} uses: actions/upload-artifact@v3 with: - name: docdb-odbc-driver + name: docdb-odbc-driver-amd64-${{env.ODBC_DRIVER_VERSION}} path: build/odbc/cmake/Release - name: Upload performance test at push to develop - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/develop' }} + if: ${{env.SHOULD_CREATE_ARTIFACTS == 'true'}} uses: actions/upload-artifact@v3 with: - name: performance + name: performance-amd64-${{env.ODBC_DRIVER_VERSION}} path: build/odbc/bin/Release/performance.exe - name: register-driver diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index dd571a244..76a6cacf1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -16,7 +16,10 @@ # cmake_minimum_required(VERSION 3.20) -project(DocumentDB-ODBC.C++ VERSION 0.1.0) + +# Update version number in ODBC_DRIVER_VERSION.txt file. +file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/ODBC_DRIVER_VERSION.txt" ODBC_DRIVER_VERSION) +project(DocumentDB-ODBC.C++ VERSION ${ODBC_DRIVER_VERSION}) include("${CMAKE_CURRENT_SOURCE_DIR}/modules/code-coverage.cmake") if (NOT "$ENV{BOOST_ROOT}" STREQUAL "") @@ -90,5 +93,6 @@ if (${WITH_ODBC}) if (${WITH_TESTS} AND EXISTS ${CMAKE_SOURCE_DIR}/odbc-test) add_subdirectory(odbc-test) + add_dependencies(documentdb-odbc-tests documentdb-odbc) endif() endif() diff --git a/src/ODBC_DRIVER_VERSION.txt b/src/ODBC_DRIVER_VERSION.txt new file mode 100644 index 000000000..6e8bf73aa --- /dev/null +++ b/src/ODBC_DRIVER_VERSION.txt @@ -0,0 +1 @@ +0.1.0