Skip to content

Commit 4c6b5e4

Browse files
Stop using git version
1 parent d5a1670 commit 4c6b5e4

File tree

1 file changed

+25
-14
lines changed

1 file changed

+25
-14
lines changed

azure-pipelines/build-and-publish.yml

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ variables:
1515
value: $[counter(variables['prId'], 1)]
1616
- name: buildConfiguration
1717
value: Release
18+
- name: releaseTag
19+
value: $[replace(variables['Build.SourceBranch'], 'refs/tags/', '')]
1820

1921
stages:
2022
- stage: BuildAndPublish
@@ -33,23 +35,32 @@ stages:
3335
packageType: 'sdk'
3436
version: '9.x'
3537

36-
- task: GitVersion@5
37-
inputs:
38-
versionSpec: '5.x'
39-
name: gitVersion
38+
# - task: GitVersion@5
39+
# inputs:
40+
# versionSpec: '5.x'
41+
# name: gitVersion
4042

4143
- task: DownloadSecureFile@1
4244
name: cert
4345
inputs:
4446
secureFile: 'code-signing-certificate-2023-2026.pfx'
4547

48+
# - task: DotNetCoreCLI@2
49+
# displayName: 'Build Project'
50+
# inputs:
51+
# command: 'build'
52+
# projects: 'Infragistics.QueryBuilder.Executor.csproj'
53+
# arguments: '-c $(buildConfiguration) /p:Version=$(GitVersion.NuGetVersionV2)'
54+
# workingDirectory: '$(Build.SourcesDirectory)'
55+
4656
- task: DotNetCoreCLI@2
4757
displayName: 'Build Project'
4858
inputs:
4959
command: 'build'
5060
projects: 'Infragistics.QueryBuilder.Executor.csproj'
51-
arguments: '-c $(buildConfiguration) /p:Version=$(GitVersion.NuGetVersionV2)'
52-
workingDirectory: '$(Build.SourcesDirectory)'
61+
arguments: >
62+
-c $(buildConfiguration)
63+
/p:Version=$(releaseTag)
5364
5465
- powershell: |
5566
$outputDir = "$(Build.SourcesDirectory)\bin\$(buildConfiguration)\net9.0"
@@ -86,7 +97,7 @@ stages:
8697
8798
- powershell: |
8899
$packageOutputDir = "$(Build.ArtifactStagingDirectory)\nuget"
89-
$packageVersion = "$(GitVersion.NuGetVersionV2)"
100+
$packageVersion = $(releaseTag)
90101
91102
Write-Host "Packing project from existing build output..."
92103
dotnet pack ./Infragistics.QueryBuilder.Executor.csproj `
@@ -117,10 +128,10 @@ stages:
117128
publishLocation: 'Container'
118129
displayName: 'Publish NuGet Package as Build Artifact'
119130

120-
- task: NuGetCommand@2
121-
inputs:
122-
command: 'push'
123-
packagesToPush: '$(Build.ArtifactStagingDirectory)/nuget/*.nupkg'
124-
nuGetFeedType: 'external'
125-
publishFeedCredentials: 'NuGet.Org'
126-
displayName: 'Publish to NuGet.org'
131+
# - task: NuGetCommand@2
132+
# inputs:
133+
# command: 'push'
134+
# packagesToPush: '$(Build.ArtifactStagingDirectory)/nuget/*.nupkg'
135+
# nuGetFeedType: 'external'
136+
# publishFeedCredentials: 'NuGet.Org'
137+
# displayName: 'Publish to NuGet.org'

0 commit comments

Comments
 (0)