-
Notifications
You must be signed in to change notification settings - Fork 74
/
azure-pipelines-photino.net-dev.yml
83 lines (70 loc) · 3.18 KB
/
azure-pipelines-photino.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
82
83
# Build Photino.NET project from dev branch in GitHub
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
trigger:
- debug
variables:
versionprefix: 0.9.0
jobs:
- job: "BuildPackageAndPublish"
pool:
vmImage: windows-latest
variables:
buildConfiguration: "Debug"
steps:
- task: UseDotNet@2
displayName: "Use .NET 8 sdk"
inputs:
packageType: sdk
version: 8.0.x
installationPath: $(Agent.ToolsDirectory)/dotnet
- task: CmdLine@2
displayName: "Add NuGet source"
inputs:
script: "dotnet nuget add source https://pkgs.dev.azure.com/tryphotino/Photino.Native/_packaging/PhotinoPackages/nuget/v3/index.json -n DevOpsArtifacts"
- task: NuGetAuthenticate@1
displayName: "NuGet Authenticate"
#- task: CmdLine@2
# displayName: 'Build Photino.NET'
# inputs:
# script: 'dotnet build Photino.NET/Photino.NET.csproj -c $(buildConfiguration)'
#Build and Create NuGet package
- task: CmdLine@2
displayName: "Build and Create NuGet package"
inputs:
script: "dotnet pack Photino.NET/Photino.NET.csproj -c $(buildConfiguration) --include-symbols /p:Version=$(versionprefix)-dev-$(Build.BuildNumber) /p:PackageVersion=$(versionprefix)-dev-$(Build.BuildNumber)"
#Create NuGet package
#- task: CmdLine@2
# displayName: 'Create NuGet package'
# inputs:
# script: 'nuget.exe pack Photino.NET/Photino.NET.nuspec -Version $(versionprefix)-$(Build.BuildNumber) -NonInteractive -Properties version=$(versionprefix)-$(Build.BuildNumber)'
#Publish NuGet package to Artifacts
- task: NuGetCommand@2
displayName: "NuGet push"
inputs:
command: push
feedsToUse: "select"
publishVstsFeed: "Photino.Native/PhotinoPackages"
packagesToPush: "Photino.NET/bin/$(buildConfiguration)/*.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'