Skip to content

Commit 50938cd

Browse files
dhenkensMastergammler
authored andcommitted
Setting up nuget deploy pipeline
1 parent d8ff2f1 commit 50938cd

File tree

1 file changed

+113
-0
lines changed

1 file changed

+113
-0
lines changed

Diff for: azure-pipelines.yml

+113
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# .NET Desktop
2+
# Build and run tests for .NET Desktop or Windows classic desktop solutions.
3+
# Add steps that publish symbols, save build artifacts, and more:
4+
# https://docs.microsoft.com/azure/devops/pipelines/apps/windows/dot-net
5+
6+
schedules:
7+
- cron: "0 0 * * 3"
8+
displayName: Wednesday midnight build
9+
branches:
10+
include:
11+
- master
12+
always: true
13+
14+
trigger:
15+
- main
16+
- develop
17+
18+
stages:
19+
- stage: Build
20+
displayName: 'Build and test package'
21+
22+
jobs:
23+
- job: buildAndTest_windows
24+
pool:
25+
vmImage: 'windows-latest'
26+
27+
steps:
28+
- task: PowerShell@2
29+
inputs:
30+
filePath: 'build.ps1'
31+
arguments: '--target=BuildAndTest'
32+
33+
- job: buildAndTest_linux
34+
dependsOn: buildAndTest_windows
35+
pool:
36+
vmImage: 'ubuntu-latest'
37+
38+
steps:
39+
- task: ShellScript@2
40+
inputs:
41+
scriptPath: 'build.sh'
42+
args: '--target=BuildAndTest'
43+
44+
- job: BuildNuGetPackageForDeploy
45+
dependsOn:
46+
- buildAndTest_windows
47+
- buildAndTest_linux
48+
pool:
49+
vmImage: 'windows-latest'
50+
51+
steps:
52+
- task: PowerShell@2
53+
inputs:
54+
filePath: 'build.ps1'
55+
arguments: '--target=BuildPackage'
56+
57+
- publish: '$(System.DefaultWorkingDirectory)/.artifacts'
58+
artifact: NuGetPackage
59+
60+
- stage: Publish
61+
displayName: 'Publish to nuget.org'
62+
condition: and(succeeded(), in(variables['build.sourceBranch'], 'refs/heads/master', 'refs/heads/develop'), ne(variables['Build.Reason'], 'Schedule'))
63+
64+
jobs:
65+
- job: publish
66+
steps:
67+
- checkout: 'none'
68+
69+
- download: current
70+
artifact: NuGetPackage
71+
72+
- task: NuGetAuthenticate@1
73+
inputs:
74+
nuGetServiceConnection: 'queoNuGetOrg'
75+
76+
- task: NuGetCommand@2
77+
inputs:
78+
command: push
79+
nuGetFeedType: 'external'
80+
publishFeedCredentials: 'queoNuGetOrg'
81+
packagesToPush: $(Pipeline.Workspace)/**/*.nupkg
82+
83+
- deployment: DeployToBeta
84+
displayName: Deploy to beta
85+
dependsOn: publish
86+
condition: and(succeeded(), eq(variables['build.sourceBranch'], 'refs/heads/develop'))
87+
pool:
88+
vmImage: 'ubuntu-latest'
89+
# Creates an environment if it doesn't exist. Seems not to work. the environment must exist.
90+
environment: Persistence-BetaChannel
91+
strategy:
92+
# Default deployment strategy, more coming...
93+
runOnce:
94+
deploy:
95+
steps:
96+
- checkout: self
97+
- script: echo deployment to beta
98+
99+
- deployment: DeployToProd
100+
displayName: Deploy to prod
101+
dependsOn: publish
102+
condition: and(succeeded(), eq(variables['build.sourceBranch'], 'refs/heads/master'))
103+
pool:
104+
vmImage: 'ubuntu-latest'
105+
# Creates an environment if it doesn't exist.
106+
environment: Persistence-ReleaseChannel
107+
strategy:
108+
# Default deployment strategy, more coming...
109+
runOnce:
110+
deploy:
111+
steps:
112+
- checkout: self
113+
- script: echo deployment to release

0 commit comments

Comments
 (0)