-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathnetStandard-pipeline.yml
106 lines (91 loc) · 3.48 KB
/
netStandard-pipeline.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
trigger:
- dev
- test
- uat
- release
- prod
pool:
vmImage: 'windows-latest'
name: Azure Pipelines
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
major: 0
minor: 0
environment: 0
# If the code was pushed directly onto the branch
${{ if ne( variables['Build.SourceBranchName'], 'merge' ) }}:
${{ if endsWith( variables['Build.SourceBranch'], 'dev' ) }}:
environment: 0
${{ if endsWith( variables['Build.SourceBranch'], 'test' ) }}:
environment: 1
${{ if endsWith( variables['Build.SourceBranch'], 'uat' ) }}:
environment: 2
${{ if endsWith( variables['Build.SourceBranch'], 'release' ) }}:
environment: 3
${{ if endsWith( variables['Build.SourceBranch'], 'prod' ) }}:
environment: 4
# If the branch update was made by a pull request
${{ if endsWith( variables['System.PullRequest.TargetBranch'], 'dev' ) }}:
environment: 0
${{ if endsWith( variables['System.PullRequest.TargetBranch'], 'test' ) }}:
environment: 1
${{ if endsWith( variables['System.PullRequest.TargetBranch'], 'uat' ) }}:
environment: 2
${{ if endsWith( variables['System.PullRequest.TargetBranch'], 'release' ) }}:
environment: 3
${{ if endsWith( variables['System.PullRequest.TargetBranch'], 'prod' ) }}:
environment: 4
# Assign the version
name: $(major).$(minor).$(environment).$(BuildID)
steps:
# Set the nuget tool to restore packages
- task: NuGetToolInstaller@0
displayName: 'Use NuGet 5.4.0'
inputs:
versionSpec: 5.4.0
# Set assembly data
- task: bleddynrichards.Assembly-Info-Task.Assembly-Info-NetCore.Assembly-Info-NetCore@2
displayName: 'Set Assembly Manifest Data'
inputs:
Path: src
InsertAttributes: true
PackageId: Xamarin.Forms.BackgroundVideoView
Authors: Ricardo Vasquez (arqueror)
Company:
VersionNumber: '$(Build.BuildNumber)'
FileVersionNumber: '$(Build.BuildNumber)'
InformationalVersion: '$(Build.BuildNumber)'
PackageVersion: '$(Build.BuildNumber)'
# Restore packages
- task: NuGetCommand@2
displayName: 'NuGet restore'
inputs:
restoreSolution: 'src/Xamarin.Forms.BackgroundVideoView/Xamarin.Forms.BackgroundVideoView.sln'
- task: MSBuild@1
inputs:
solution: '**/src/Xamarin.Forms.BackgroundVideoView/Xamarin.Forms.BackgroundVideoView/Xamarin.Forms.BackgroundVideoView.csproj'
configuration: 'Release'
- task: MSBuild@1
inputs:
solution: '**/src/Forms.BackgroundVideo.AndroidCore/Forms.BackgroundVideo.AndroidCore.csproj'
configuration: 'Release'
- task: MSBuild@1
inputs:
solution: '**/src/Xamarin.Forms.BackgroundVideoView/Forms.BackgroundVideoView.iOSCore/Forms.BackgroundVideoView.iOSCore.csproj'
configuration: 'Release'
- task: NuGetCommand@2
inputs:
command: 'pack'
packagesToPack: 'src/Xamarin.Forms.BackgroundVideoView.nuspec'
versioningScheme: 'byBuildNumber'
#push to NuGet: https://medium.com/@yanxiaodi/using-azure-devops-pipelines-to-publish-the-nuget-package-from-github-repo-fb58be4e9be8
# Push the nuget to the feed (click in DotNetCoreCLI@2 in Azure Devops to select the feed in Artifacts): https://medium.com/@dan.cokely/creating-nuget-packages-in-azure-devops-with-azure-pipelines-and-yaml-d6fa30f0f15e
- task: DotNetCoreCLI@2
displayName: 'dotnet push'
inputs:
command: 'push'
packagesToPush: '$(Build.ArtifactStagingDirectory)/*.nupkg'
nuGetFeedType: 'internal'
publishVstsFeed: 'ff4d8a97-805f-4aaf-bdb0-7774b9d0a86b/c079497c-dce5-498e-b250-885f09d4d779'