Skip to content

Commit f0e4826

Browse files
committed
Fix issues with running PRs on Azure Pipelines
1 parent 60c8075 commit f0e4826

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

Directory.Build.targets

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<Target Name="UpdateCiSettings" Condition="'$(CI)' == 'true'">
33
<Message Importance="High" Text="##vso[build.updatebuildnumber]$(PackageVersion)" />
44
<!-- These tags can be used in Azure release pipelines to filter actions based on the type of build. -->
5-
<Message Importance="high" Text="##vso[build.addbuildtag]daily-build" Condition=" '$(IsStableBuild)' != 'true' " />
6-
<Message Importance="high" Text="##vso[build.addbuildtag]release-candidate" Condition=" '$(IsStableBuild)' == 'true' " />
7-
<Message Importance="high" Text="##vso[build.addbuildtag]code-signed" Condition=" '$(CodeSign)' == 'true' " />
5+
<Message Importance="high" Text="##vso[build.addbuildtag]daily-build" Condition=" '$(IsStableBuild)' != 'true' AND '$(BUILD_REASON)' != 'PullRequest' " />
6+
<Message Importance="high" Text="##vso[build.addbuildtag]release-candidate" Condition=" '$(IsStableBuild)' == 'true' AND '$(BUILD_REASON)' != 'PullRequest' " />
7+
<Message Importance="high" Text="##vso[build.addbuildtag]code-signed" Condition=" '$(CodeSign)' == 'true' AND '$(BUILD_REASON)' != 'PullRequest' " />
88
</Target>
99
</Project>

azure-pipelines.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,7 @@ pr:
77
- '*'
88

99
variables:
10-
# Set this to an empty value for pull-request builds
11-
- name: kv-access-token
12-
value: ''
13-
# This contains secrets for accessing code-signing certificates during an official build
1410
- group: AzureKeyVault
15-
# Skip the package warm up step
1611
- name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE
1712
value: 1
1813

@@ -25,8 +20,12 @@ jobs:
2520
displayName: Install .NET Core 2.2
2621
inputs:
2722
version: '2.2.102'
23+
- powershell: ./build.ps1 -ci
24+
displayName: Invoke build.ps1
25+
condition: eq(variables['kv-access-token'], '')
2826
- powershell: ./build.ps1 -ci /p:AzureKeyVaultClientSecret=$(kv-access-token)
2927
displayName: Invoke build.ps1
28+
condition: ne(variables['kv-access-token'], '')
3029
- task: PublishTestResults@2
3130
displayName: Upload test results
3231
condition: always()

build.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ exec dotnet pack --no-restore --no-build --configuration $Configuration -o $arti
7575

7676
[string[]] $testArgs=@()
7777
if ($PSVersionTable.PSEdition -eq 'Core' -and -not $IsWindows) {
78-
$testArgs += '--framework','netcoreapp2.1'
78+
$testArgs += '--framework','netcoreapp2.2'
7979
}
8080
if ($env:TF_BUILD) {
8181
$testArgs += '--logger', 'trx'

0 commit comments

Comments
 (0)