diff --git a/.github/workflows/trigger_azdo_ci.yml b/.github/workflows/trigger_azdo_ci.yml index a29eca8c0..fd95dd35d 100644 --- a/.github/workflows/trigger_azdo_ci.yml +++ b/.github/workflows/trigger_azdo_ci.yml @@ -15,6 +15,19 @@ jobs: name: Trigger Main CI runs-on: windows-latest steps: + - name: Checkout Repo + uses: actions/checkout@4 + + - name: Extract version values + id: get_version + run: | + version_major=$(sed -n 's/set(version_major \([0-9]*\))/\1/p' project-meta-info.cmake) + version_minor=$(sed -n 's/set(version_minor \([0-9]*\))/\1/p' project-meta-info.cmake) + version_update=$(sed -n 's/set(version_update \([0-9]*\))/\1/p' project-meta-info.cmake) + echo "version_major=$version_major" >> $GITHUB_OUTPUT + echo "version_minor=$version_minor" >> $GITHUB_OUTPUT + echo "version_update=$version_update" >> $GITHUB_OUTPUT + - name: Trigger Main CI uses: Azure/pipelines@v1.2 if: ${{ github.repository == 'ni/grpc-device' && github.event.workflow_run.head_branch == 'main' }} @@ -22,7 +35,15 @@ jobs: azure-devops-project-url: 'https://dev.azure.com/ni/DevCentral' azure-pipeline-name: 'ni-central-grpc_device' azure-devops-token: ${{ secrets.AZDO_PIPELINE_TRIGGERS }} - azure-pipeline-variables: '{"BRANCH": "main", "EXPORT_NAME": "ni-grpc-device", "PHASE": "d"}' + azure-pipeline-variables: | + { + "BRANCH": "main", + "EXPORT_NAME": "ni-grpc-device", + "PHASE": "d", + "VERSION_MAJOR": "${{ steps.get_version.outputs.version_major }}", + "VERSION_MINOR": "${{ steps.get_version.outputs.version_minor }}", + "VERSION_UPDATE": "${{ steps.get_version.outputs.version_update }}" + } - name: Trigger Release CI uses: Azure/pipelines@v1.2 @@ -31,4 +52,14 @@ jobs: azure-devops-project-url: 'https://dev.azure.com/ni/DevCentral' azure-pipeline-name: 'ni-central-grpc_device' azure-devops-token: ${{ secrets.AZDO_PIPELINE_TRIGGERS }} - azure-pipeline-variables: '{"BRANCH": "releases", "EXPORT_NAME": "ni-grpc-device", "PHASE": "f", "RELEASE_BRANCH_OPTION": "--release-branch"}' \ No newline at end of file + azure-pipeline-variables: | + { + "BRANCH": "main", + "EXPORT_NAME": "ni-grpc-device", + "PHASE": "f", + "RELEASE_BRANCH_OPTION": "--release-branch" + "VERSION_MAJOR": "${{ steps.get_version.outputs.version_major }}", + "VERSION_MINOR": "${{ steps.get_version.outputs.version_minor }}", + "VERSION_UPDATE": "${{ steps.get_version.outputs.version_update }}" + } + diff --git a/CMakeLists.txt b/CMakeLists.txt index c837d9248..a6e48d0d5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,11 @@ cmake_minimum_required(VERSION 3.18.0) +# Include project variables +include("${CMAKE_CURRENT_LIST_DIR}/project-meta-info.cmake") + project(ni_grpc_device_server LANGUAGES C CXX - VERSION 2.13.0) + VERSION ${version_major}.${version_major}.${version_update}) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") diff --git a/project-meta-info.cmake b/project-meta-info.cmake new file mode 100644 index 000000000..0813ac097 --- /dev/null +++ b/project-meta-info.cmake @@ -0,0 +1,3 @@ +set(version_major 2) +set(version_minor 13) +set(version_update 0)