mirror of
https://github.com/tribufu/ServerManagers
synced 2026-06-01 09:42:39 +00:00
117 lines
No EOL
3.3 KiB
YAML
117 lines
No EOL
3.3 KiB
YAML
name: $(VersionMajor).$(VersionMinor).$(VersionBuild).$(VersionRevision)
|
|
|
|
trigger:
|
|
branches:
|
|
include:
|
|
- source
|
|
paths:
|
|
include:
|
|
- src
|
|
|
|
variables:
|
|
- name: ApplicationName
|
|
value: $(Build.DefinitionName)
|
|
- name: SolutionFile
|
|
value: 'src/Server-Managers.sln'
|
|
- name: ProjectFile
|
|
value: 'src/$(ApplicationName)/$(ApplicationName).csproj'
|
|
- name: BuildPlatform
|
|
value: AnyCPU
|
|
- name: BuildConfiguration
|
|
value: Release
|
|
- name: PublishFolder
|
|
value: publish
|
|
|
|
stages:
|
|
- stage: build
|
|
displayName: Build and Publish $(ApplicationName)
|
|
|
|
jobs:
|
|
- job: build
|
|
displayName: Build and Publish
|
|
|
|
steps:
|
|
- task: NuGetToolInstaller@1
|
|
displayName: 'Install NuGet 4.4.1'
|
|
inputs:
|
|
versionSpec: '4.4.1'
|
|
|
|
- task: NuGetCommand@2
|
|
displayName: 'NuGet restore'
|
|
inputs:
|
|
restoreSolution: '$(SolutionFile)'
|
|
|
|
- task: PowerShell@2
|
|
displayName: 'Apply Semantic Versioning to Assemblies'
|
|
inputs:
|
|
targetType: filePath
|
|
filePath: './.azure/scripts/ApplySemanticVersioningToAssemblies.ps1'
|
|
arguments: "-applicationName $(ApplicationName) -pathToSearch '$(Build.SourcesDirectory)/src' -buildNumber $(Build.BuildNumber) -searchFilter 'AssemblyInfo.*'"
|
|
pwsh: true
|
|
|
|
- task: projectfileprops@1
|
|
displayName: 'Modify ApplicationVersion In Project File'
|
|
inputs:
|
|
path: '$(ProjectFile)'
|
|
fieldOptions: ApplicationVersion
|
|
value: '$(VersionMajor).$(VersionMinor).$(VersionBuild).%2a'
|
|
|
|
- task: projectfileprops@1
|
|
displayName: 'Modify ApplicationRevision In Project File'
|
|
inputs:
|
|
path: '$(ProjectFile)'
|
|
fieldOptions: ApplicationRevision
|
|
value: '$(VersionRevision)'
|
|
|
|
- task: VSBuild@1
|
|
displayName: 'Build $(ApplicationName) Project'
|
|
inputs:
|
|
solution: '$(ProjectFile)'
|
|
msbuildArgs: '/t:publish /p:PublishDir="$(Build.ArtifactStagingDirectory)/bin"'
|
|
platform: '$(BuildPlatform)'
|
|
configuration: '$(BuildConfiguration)'
|
|
clean: true
|
|
|
|
- task: CopyFiles@2
|
|
displayName: 'Copy Artifact Files'
|
|
inputs:
|
|
SourceFolder: '$(Build.SourcesDirectory)'
|
|
Contents: |
|
|
src/$(ApplicationName)/VersionFeed.xml
|
|
src/$(ApplicationName)/VersionFeedBeta.xml
|
|
src/$(ApplicationName)/Art\favicon.ico
|
|
src/$(ApplicationName)/Globalization\en-US\en-US.xaml
|
|
TargetFolder: '$(Build.ArtifactStagingDirectory)'
|
|
OverWrite: true
|
|
flattenFolders: true
|
|
preserveTimestamp: true
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
displayName: 'Publish Artifacts'
|
|
inputs:
|
|
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
|
|
ArtifactName: '$(PublishFolder)'
|
|
|
|
- stage: deployBeta
|
|
displayName: Deploy Beta $(ApplicationName)
|
|
lockBehavior: runLatest
|
|
condition: and(succeeded(), eq(variables['build.sourceBranch'], 'refs/heads/source'))
|
|
dependsOn:
|
|
- build
|
|
|
|
jobs:
|
|
- deployment: deployBeta
|
|
displayName: Deploy Beta
|
|
environment: github-servermanager-beta
|
|
|
|
- stage: deployRelease
|
|
displayName: Deploy Release $(ApplicationName)
|
|
lockBehavior: runLatest
|
|
condition: and(succeeded(), eq(variables['build.sourceBranch'], 'refs/heads/source'))
|
|
dependsOn:
|
|
- deployBeta
|
|
|
|
jobs:
|
|
- deployment: deployRelease
|
|
displayName: Deploy Release
|
|
environment: github-servermanager-release |