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
31 changes: 12 additions & 19 deletions build/azure-pipelines/build-product.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,31 +51,24 @@ stages:
pool:
vmImage: $(imageName)
steps:
- task: PowerShell@2
displayName: Set last tag to variable
name: getVersion
inputs:
targetType: 'inline'
script: |
$VERSION_TAG = git describe --tags (git rev-list --tags --max-count=1)
Write-Host("##vso[task.setvariable variable=VERSION_TAG]$VERSION_TAG")
Write-Host($VERSION_TAG)
- template: build-tag.yml
- script: |
echo $(getVersion.VERSION_TAG)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getVersion.VERSION_TAG)

isn't this just $(VERSION_TAG)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The output variables from task of same job are referred using TaskName.VariableName convention as mentioned here.

- template: build-common.yml
parameters:
OS: $(os)
Arch: $(arch)
ArtifactName: $(artifact)
VersionTag: $(VERSION_TAG)
VersionTag: $(getVersion.VERSION_TAG)

- stage: CreatePackages
displayName: Create packages to publish
jobs:
- job: Sign_and_pack
pool:
vmImage: 'windows-latest'
variables:
versionTag: $[ stageDependencies.Compile.Sqlcmd.outputs['getVersion.VERSION_TAG'] ]
steps:
- template: build-tag.yml
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
Expand Down Expand Up @@ -139,15 +132,15 @@ stages:
rootFolderOrFile: '$(Pipeline.Workspace)\SqlcmdWindowsAmd64\Sqlcmd.exe'
includeRootFolder: false
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/sqlcmd-$(versionTag)-windows-x64.zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/sqlcmd-$(getVersion.VERSION_TAG)-windows-x64.zip'

- task: ArchiveFiles@2
displayName: Zip Windows arm binary
inputs:
rootFolderOrFile: '$(Pipeline.Workspace)\SqlcmdWindowsArm\Sqlcmd.exe'
includeRootFolder: false
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/sqlcmd-$(versionTag)-windows-arm.zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/sqlcmd-$(getVersion.VERSION_TAG)-windows-arm.zip'

- task: ArchiveFiles@2
displayName: Tar Linux amd64 binary
Expand All @@ -156,7 +149,7 @@ stages:
includeRootFolder: false
archiveType: 'tar'
tarCompression: 'bz2'
archiveFile: '$(Build.ArtifactStagingDirectory)/sqlcmd-$(versionTag)-linux-x64.tar.bz2'
archiveFile: '$(Build.ArtifactStagingDirectory)/sqlcmd-$(getVersion.VERSION_TAG)-linux-x64.tar.bz2'

- task: ArchiveFiles@2
displayName: Tar Darwin binary
Expand All @@ -165,7 +158,7 @@ stages:
includeRootFolder: false
archiveType: 'tar'
tarCompression: 'bz2'
archiveFile: '$(Build.ArtifactStagingDirectory)/sqlcmd-$(versionTag)-darwin-x64.tar.bz2'
archiveFile: '$(Build.ArtifactStagingDirectory)/sqlcmd-$(getVersion.VERSION_TAG)-darwin-x64.tar.bz2'

- task: ArchiveFiles@2
displayName: Tar Linux arm64 binary
Expand All @@ -174,7 +167,7 @@ stages:
includeRootFolder: false
archiveType: 'tar'
tarCompression: 'bz2'
archiveFile: '$(Build.ArtifactStagingDirectory)/sqlcmd-$(versionTag)-linux-arm64.tar.bz2'
archiveFile: '$(Build.ArtifactStagingDirectory)/sqlcmd-$(getVersion.VERSION_TAG)-linux-arm64.tar.bz2'

- task: ArchiveFiles@2
displayName: Tar Linux s390x binary
Expand All @@ -183,7 +176,7 @@ stages:
includeRootFolder: false
archiveType: 'tar'
tarCompression: 'bz2'
archiveFile: '$(Build.ArtifactStagingDirectory)/sqlcmd-$(versionTag)-linux-s390x.tar.bz2'
archiveFile: '$(Build.ArtifactStagingDirectory)/sqlcmd-$(getVersion.VERSION_TAG)-linux-s390x.tar.bz2'

- task: PublishPipelineArtifact@1
displayName: 'Publish release archives'
Expand All @@ -199,6 +192,6 @@ stages:
action: 'create'
target: '$(Build.SourceVersion)'
tagSource: 'userSpecifiedTag'
tag: '$(versionTag)'
tag: '$(getVersion.VERSION_TAG)'
changeLogCompareToRelease: 'lastFullRelease'
changeLogType: 'commitBased'
11 changes: 11 additions & 0 deletions build/azure-pipelines/build-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

steps:
- task: PowerShell@2
displayName: Set last tag to variable
name: getVersion
inputs:
targetType: 'inline'
script: |
$VERSION_TAG = git describe --tags (git rev-list --tags --max-count=1)
Write-Host("##vso[task.setvariable variable=VERSION_TAG;isoutput=true]$VERSION_TAG")
Write-Host($VERSION_TAG)