-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathazure-pipelines-release.yml
More file actions
48 lines (42 loc) · 1.66 KB
/
Copy pathazure-pipelines-release.yml
File metadata and controls
48 lines (42 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
trigger:
- release
pool:
vmImage: 'ubuntu-latest'
variables:
buildConfiguration: 'Release'
steps:
# Specify a particular version of the .NET SDK
- task: UseDotNet@2
displayName: 'Use .NET Core sdk'
inputs:
packageType: sdk
version: 3.1.100
installationPath: $(Agent.ToolsDirectory)/dotnet
# Build the solution. Not strictly required to create the package,
# but we want the build to fail if any sample can't build.
- script: dotnet build --configuration $(buildConfiguration)
displayName: 'dotnet build $(buildConfiguration)'
# Actually creates the NuGet package file
- script: dotnet pack --configuration $(buildConfiguration) /p:VersionSuffix=$(Build.BuildNumber)
workingDirectory: src/anime.Blazor
displayName: 'dotnet pack'
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: 'src/anime.Blazor/bin/$(buildConfiguration)'
ArtifactName: 'artifacts'
publishLocation: 'Container'
# Uploads the NuGet package file to nuget.org
# Important notes:
# 1. For this to work, you need to create a 'service connection' with the same name
# as the 'publishFeedCredentials' value.
# 2. For security, you *must* ensure that 'Make secrets available to builds of forks'
# is disabled in your PR validation settings (inside build -> Edit -> Triggers).
# Otherwise, PRs would be able to push new packages even without being merged.
- task: NuGetCommand@2
displayName: 'Publish to nuget.org'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/release'))
inputs:
command: push
packagesToPush: 'src/anime.Blazor/bin/$(buildConfiguration)/*.nupkg'
nuGetFeedType: external
publishFeedCredentials: 'anime.Blazor'