Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 18 additions & 9 deletions CI/azure-pipelines-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ parameters:
- name: githubRelease
displayName: GitHub Release
type: boolean
default: True
default: False
- name: preRelease
displayName: Pre-Release
type: boolean
default: true
default: True
- name: inputNuGetVersion
displayName: NuGet-Version
type: string
Expand All @@ -26,12 +26,6 @@ variables:

- name: IronDrawingPatch
value: $[counter(format('{0}.{1}', variables['IronDrawingMajorVersion'], variables['IronDrawingMinorVersion']), 1)]

- name: AssemblyVersion
${{ if eq(parameters.inputNuGetVersion, '0') }}:
value: $(IronDrawingMajorVersion).$(IronDrawingMinorVersion).$(IronDrawingPatch).$(IronDrawingRevisionVersion)
${{ if ne(parameters.inputNuGetVersion, '0') }}:
value: ${{ parameters.inputNuGetVersion }}.$(IronDrawingRevisionVersion)

- name: NugetVersion
${{ if eq(parameters.inputNuGetVersion, '0') }}:
Expand Down Expand Up @@ -60,10 +54,25 @@ stages:
displayName: Build IronSoftware.Drawing Libraries
dependsOn: []
jobs:
- job: PrepareDrawingAssemblyVersion
steps:
# Prepare Assembly version
- powershell: |
if ("${{ parameters.inputNuGetVersion }}" -eq "0") {
$AssemblyVersion = "$(IronDrawingMajorVersion).$(IronDrawingMinorVersion).$(IronDrawingRevisionVersion).$(IronDrawingPatch)"
} else {
$splitVersion = "${{ parameters.inputNuGetVersion }}".Split('.')
$AssemblyVersion = "$($splitVersion[0]).$($splitVersion[1]).$(IronDrawingRevisionVersion).$($splitVersion[2])"
}
Set-Content -Path "AssemblyVersion.txt" -Value $AssemblyVersion
displayName: 'Generate Assembly version'
- publish: 'AssemblyVersion.txt'
artifact: 'AssemblyVersionInfo'
- template: job_templates/build_drawing_libraries.yml
parameters:
publishAssemblies: true
buildConfiguration: $(Configuration)
dependsOn: 'PrepareDrawingAssemblyVersion'
## Test Windows
- template: stage_templates/run_tests_on_pool.yml
parameters:
Expand Down Expand Up @@ -97,4 +106,4 @@ stages:
jobs:
- template: job_templates/deploy_drawing_libraries.yml
parameters:
NuGetVersion: $(NuGetVersion)
NuGetVersion: $(NuGetVersion)
15 changes: 15 additions & 0 deletions CI/job_templates/build_drawing_libraries.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
parameters:
publishAssemblies: false
buildConfiguration: ''
dependsOn: ''

jobs:
- job: BuildDrawingLibraries
dependsOn: ${{ parameters.dependsOn }}
steps:
- download: current
artifact: 'AssemblyVersionInfo'
- powershell: |
$AssemblyVersion = Get-Content "$(Pipeline.Workspace)\AssemblyVersionInfo\AssemblyVersion.txt"
if (![string]::IsNullOrEmpty($AssemblyVersion)) {
Write-Host "Using AssemblyVersion from previous job: $AssemblyVersion"
Write-Host "##vso[task.setvariable variable=finalAssemblyVersion]$AssemblyVersion"
} else {
Write-Host "AssemblyVersion is not set, using default: 1.0.0.0"
Write-Host "##vso[task.setvariable variable=finalAssemblyVersion]1.0.0.0"
}
displayName: 'Use or Set Assembly Version'
# Checkout Repo
- checkout: self
displayName: Checkout IronSoftware.Drawing repository
Expand Down Expand Up @@ -50,6 +64,7 @@ jobs:
${{ parameters.buildConfiguration }}
--no-restore
--verbosity normal
--property:AssemblyVersion=$(finalAssemblyVersion)
versioningScheme: byEnvVar
versionEnvVar: AssemblyVersion
# Publish Pipeline Artifacts
Expand Down