通过VS中我们配置的pubxml进行发布
trigger:
- master
pool:
vmImage: 'windows-2022'
variables:
- group: GeexPublish
- name: my-user-variable
value: $[variables.UserName] # uses runtime expression
- name: my-passed-variable
value: $[variables.PassWord] # uses runtime expression
- name: buildConfiguration
value: 'Release'
- name: publishFolder
value: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId)'
- name: solution
value: '**/Platform.Client.csproj'
steps:
- script: echo $(UserName) # uses macro syntax
- script: echo $(my-passed-variable)
- task: DotNetCoreCLI@2
displayName: 'Restore dependencies'
inputs:
command: 'restore'
projects: '$(solution)'
arguments: '--configuration $(buildConfiguration)'
- task: DotNetCoreCLI@2
displayName: 'Publish to IIS'
inputs:
command: 'publish'
arguments: '--configuration Release /p:UserName=$(my-user-variable) /p:Password=$(my-passed-variable) /p:PublishProfile=xxxxxxx.pubxml'
workingDirectory: './Platform.Client'