From 3f38d550d1e2987cbe213b0ccf2dbc5a479dd4e0 Mon Sep 17 00:00:00 2001 From: Ulrich Huber Date: Mon, 7 Oct 2019 13:11:44 +0100 Subject: [PATCH] Update Release pipeline to use internal features for versioning Linux release pipeline should only build once --- azure-pipelines/release.yml | 22 +++++++++------------- azure-pipelines/steps/build_linux.yml | 3 ++- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/azure-pipelines/release.yml b/azure-pipelines/release.yml index f532713c..29e22b41 100644 --- a/azure-pipelines/release.yml +++ b/azure-pipelines/release.yml @@ -12,7 +12,10 @@ schedules: include: - master pr: none - +variables: + versionNumber: '' + versionTag: '' + buildType: 'unknown' stages: - stage: SetVersionInformation jobs: @@ -25,11 +28,9 @@ stages: mkdir build cd build cmake .. + exit 0 displayName: 'Create Version Information' - bash: | - mkdir build - cd build - cmake .. VER=$(cat VERSION | sed '1q;d') TAG=`date +"%Y%m%d"` echo "##vso[build.updatebuildnumber]${VER}-nightly.${TAG}" @@ -38,9 +39,6 @@ stages: workingDirectory: ./build condition: or(eq(variables['Build.Reason'], 'Schedule'), eq(variables['runForRelease'], False)) # Run for scheduled (nightlies) - bash: | - mkdir build - cd build - cmake .. VER=$(cat VERSION | sed '1q;d') echo "##vso[build.updatebuildnumber]${VER}" name: 'VersionRelease' @@ -57,17 +55,15 @@ stages: steps: - template: steps/build_linux.yml parameters: - cmake_flags: '-DCMAKE_DEBUG_INCLUDES_LDFLAGS=ON -DENABLE_CPPUNIT=ON -DDEBUG_COMPILE=ON' - - bash: | - cmake .. -DCMAKE_INSTALL_PREFIX=$PWD/staging -DCPACK_GENERATOR="TGZ;DEB" - cmake --build . --target package - workingDirectory: ./build - displayName: 'Generate packages' + build_type: 'Release' + cmake_flags: '-DCMAKE_DEBUG_INCLUDES_LDFLAGS=ON -DENABLE_CPPUNIT=ON -DDEBUG_COMPILE=ON -DCMAKE_INSTALL_PREFIX=$PWD/staging -DCPACK_GENERATOR="TGZ;DEB"' + cmake_commands: '--target package' - task: PublishPipelineArtifact@1 inputs: artifactName: 'linux-packages' targetPath: '$(System.DefaultWorkingDirectory)/build/packages' displayName: 'Publish packages' + - job: Windows pool: vmImage: 'vs2017-win2016' diff --git a/azure-pipelines/steps/build_linux.yml b/azure-pipelines/steps/build_linux.yml index a2156263..83e36d3f 100644 --- a/azure-pipelines/steps/build_linux.yml +++ b/azure-pipelines/steps/build_linux.yml @@ -4,6 +4,7 @@ parameters: build_type: 'Debug' cmake_flags: '' + cmake_commands: '' steps: - bash: | @@ -15,6 +16,6 @@ steps: displayName: 'Create build directory' - bash: | cmake -GNinja .. -DCMAKE_BUILD_TYPE=${{ parameters.build_type}} ${{ parameters.cmake_flags }} - cmake --build . + cmake --build . ${{ parameters.cmake_commands}} workingDirectory: ./build displayName: 'Build Xournal++'