BuildTemplates/Publish-PowerShell.yml

56 строки
1.9 KiB
YAML

parameters:
- name: name
default: Publish_PowerShell
- name: vmImage
default: ''
- name: BuildConfiguration
default: ''
- name: PublishFramework
default: ''
- name: PublishProject
default: ''
- name: PublishRuntime
default: ''
- name: Workloads
default: ''
jobs:
- job: ${{ parameters.name }}
pool:
vmImage: ${{ parameters.vmImage }}
variables:
BuildConfiguration: ${{ parameters.BuildConfiguration }}
PublishFramework: ${{ parameters.PublishFramework }}
PublishProject: ${{ parameters.PublishProject }}
PublishRuntime: ${{ parameters.PublishRuntime }}
Workloads: ${{ parameters.Workloads }}
steps:
- task: UseDotNet@2
displayName: Install .NET Core SDK
inputs:
useGlobalJson: true
- task: DotNetCoreCLI@2
condition: ne(variables.Workloads, '')
displayName: Install workloads
inputs:
command: 'custom'
custom: 'workload'
arguments: 'install $(Workloads)'
- task: PowerShell@2
displayName: Nuke Target Publish
inputs:
targetType: filePath
filePath: ./build.ps1
arguments: --target Publish --configuration "$(BuildConfiguration)" --version-suffix "build$(Build.BuildNumber)" --publish-runtime "$(PublishRuntime)" --publish-framework "$(PublishFramework)" --publish-project "$(PublishProject)"
- task: ArchiveFiles@2
displayName: Archive Publish
inputs:
rootFolderOrFile: ./artifacts/Publish/$(PublishProject)-$(PublishFramework)-$(PublishRuntime)
includeRootFolder: false
archiveFile: ./artifacts/Publish/Zip/$(PublishProject)-$(PublishFramework)-$(PublishRuntime).zip
- task: PublishBuildArtifacts@1
displayName: Publish Artifacts
inputs:
PathtoPublish: ./artifacts/Publish/Zip
ArtifactName: Publish