Fixing build to at least run with .NET5.0, the published .exe still doesn't run though [skip ci]

This commit is contained in:
Robin Krom 2020-10-14 09:11:00 +02:00
commit f794dda210

View file

@ -19,15 +19,16 @@ variables:
solution: '**/*.sln' solution: '**/*.sln'
buildPlatform: 'Any CPU' buildPlatform: 'Any CPU'
buildConfiguration: 'Release' buildConfiguration: 'Release'
targetFramework: 'net5.0-windows'
steps: steps:
- task: NuGetToolInstaller@1 - task: NuGetToolInstaller@1
- task: UseDotNet@2 - task: UseDotNet@2
displayName: 'Use .NET Core sdk 3.1.2' displayName: 'Use .NET Core sdk 5.0.100-rc.2'
inputs: inputs:
packageType: sdk packageType: sdk
version: 3.1.102 version: 5.0.100-rc.2.20479.15
- task: NuGetCommand@2 - task: NuGetCommand@2
displayName: NuGet restore displayName: NuGet restore
@ -41,13 +42,13 @@ steps:
command: 'publish' command: 'publish'
publishWebProjects: false publishWebProjects: false
projects: 'src\Greenshot\Greenshot.csproj' projects: 'src\Greenshot\Greenshot.csproj'
arguments: '-f netcoreapp3.1 -c Release /p:PublishSingleFile=true /p:RuntimeIdentifier=win-x64' arguments: '-f $(targetFramework) -c Release /p:PublishSingleFile=true /p:RuntimeIdentifier=win-x64'
zipAfterPublish: false zipAfterPublish: false
- task: CmdLine@2 - task: CmdLine@2
displayName: Rename single-exe x64 displayName: Rename single-exe x64
inputs: inputs:
script: 'rename $(Build.SourcesDirectory)\src\Greenshot\bin\Release\netcoreapp3.1\win-x64\publish\Greenshot.exe Greenshot-x64.exe' script: 'rename $(Build.SourcesDirectory)\src\Greenshot\bin\Release\$(targetFramework)\win-x64\publish\Greenshot.exe Greenshot-x64.exe'
- task: DotNetCoreCLI@2 - task: DotNetCoreCLI@2
displayName: Publish single-exe x86 displayName: Publish single-exe x86
@ -55,18 +56,18 @@ steps:
command: 'publish' command: 'publish'
publishWebProjects: false publishWebProjects: false
projects: 'src\Greenshot\Greenshot.csproj' projects: 'src\Greenshot\Greenshot.csproj'
arguments: '-f netcoreapp3.1 -c Release /p:PublishSingleFile=true /p:RuntimeIdentifier=win-x86' arguments: '-f $(targetFramework) -c Release /p:PublishSingleFile=true /p:RuntimeIdentifier=win-x86'
zipAfterPublish: false zipAfterPublish: false
- task: CmdLine@2 - task: CmdLine@2
displayName: Rename single-exe x86 displayName: Rename single-exe x86
inputs: inputs:
script: 'rename $(Build.SourcesDirectory)\src\Greenshot\bin\Release\netcoreapp3.1\win-x86\publish\Greenshot.exe Greenshot-x86.exe' script: 'rename $(Build.SourcesDirectory)\src\Greenshot\bin\Release\$(targetFramework)\win-x86\publish\Greenshot.exe Greenshot-x86.exe'
- task: CopyFiles@2 - task: CopyFiles@2
displayName: 'Copy Files to: $(build.artifactstagingdirectory)' displayName: 'Copy Files to: $(build.artifactstagingdirectory)'
inputs: inputs:
SourceFolder: '$(Build.SourcesDirectory)\src\Greenshot\bin\Release\netcoreapp3.1' SourceFolder: '$(Build.SourcesDirectory)\src\Greenshot\bin\Release\$(targetFramework)'
Contents: | Contents: |
win-x64\publish\Greenshot-x64.exe win-x64\publish\Greenshot-x64.exe
win-x86\publish\Greenshot-x86.exe win-x86\publish\Greenshot-x86.exe