Skip to content

Commit

Permalink
[AD-912] Add platform, bitness and version to driver artifact(s) (#123)
Browse files Browse the repository at this point in the history
* [AD-912] Test if 32-bit and 64-bit artefacts are created.

* [AD-912] Set artifact logic when push to develop branch.

* [AD-912] Test adding version to artifacts and setting for the library properties.

* [AD-912] Propagate ODBC_DRIVER_VERSION to all builds.

* [AD-912] Fix 'if' statements with environment variables.

* [AD-912] Now source the driver version from the ODBC_DRIVER_VERSION.txt file.

* [AD-912] Fix updating the environment in workflow.

* [AD-912] Fix updating the environment in workflow.

* [AD-912] Fix updating the environment in workflow.

* [AD-912] Fixed updating the environment in workflow.

* [AD-912] Set the criteria for uploading artifacts to production mode.
  • Loading branch information
Bruce Irschick authored Sep 23, 2022
1 parent bfd8ee1 commit 5f0703d
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 5 deletions.
34 changes: 30 additions & 4 deletions .github/workflows/win-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 "")
Expand Down Expand Up @@ -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()
1 change: 1 addition & 0 deletions src/ODBC_DRIVER_VERSION.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.1.0

0 comments on commit 5f0703d

Please sign in to comment.