-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines-west.net-dev.yml
81 lines (68 loc) · 2.58 KB
/
azure-pipelines-west.net-dev.yml
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# Build WEST.NET project from dev branch in GitHub
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
trigger:
- dev
variables:
versionprefix: 0.1.0
jobs:
- job: 'BuildPackageAndPublish'
pool:
vmImage: windows-latest
variables:
buildConfiguration: 'Release'
steps:
- task: UseDotNet@2
displayName: 'Use .NET Core sdk'
inputs:
packageType: sdk
version: 5.0.100
installationPath: $(Agent.ToolsDirectory)/dotnet
- task: CmdLine@2
displayName: 'Add NuGet source'
inputs:
script: 'dotnet nuget add source https://pkgs.dev.azure.com/eps-software/25138a24-91f3-4071-b9bd-4d7763ecb75f/_packaging/WESTPackages/nuget/v3/index.json -n DevOpsArtifacts'
- task: NuGetAuthenticate@0
displayName: 'NuGet Authenticate'
#- task: CmdLine@2
# displayName: 'List NuGet sources'
# inputs:
# script: 'dotnet nuget list source'
- task: CmdLine@2
displayName: 'Build WEST.NET'
inputs:
script: 'dotnet build src/WebWindow/WebWindow.csproj -c $(buildConfiguration)'
- task: CmdLine@2
displayName: 'Rename package'
inputs:
script: 'cd artifacts & rename WEST.NET.0.1.2-dev.nupkg WEST.NET.$(versionprefix)-$(Build.BuildNumber).nupkg'
#Publish NuGet package to Artifacts
- task: NuGetCommand@2
displayName: 'NuGet push'
inputs:
command: push
feedsToUse: 'select'
publishVstsFeed: 'WEST (Formerly WebWindow)/WESTPackages'
packagesToPush: 'artifacts/**/*.nupkg'
allowPackageConflicts: true
# 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.
#- job: 'PublishToNuGet'
# dependsOn: 'CombinePackages'
# steps:
# - task: DownloadBuildArtifacts@0
# inputs:
# downloadPath: 'artifacts'
# artifactName: 'artifacts-combined'
# - task: NuGetCommand@2
# displayName: 'Publish to nuget.org'
# condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
# inputs:
# command: push
# packagesToPush: 'artifacts/artifacts-combined/*.nupkg'
# nuGetFeedType: external
# publishFeedCredentials: 'WebWindowNuGet'