mirror of
https://github.com/greenshot/greenshot
synced 2025-08-22 22:34:27 -07:00
Using Azure DevOps pipeline build for publishing a single-exe Greenshot
This commit is contained in:
parent
6bdcf35ce2
commit
61d6e7558d
4 changed files with 51 additions and 23 deletions
|
@ -29,20 +29,31 @@ steps:
|
|||
restoreSolution: '$(solution)'
|
||||
feedsToUse: config
|
||||
|
||||
- task: VSBuild@1
|
||||
displayName: 'Build solution **\*.sln'
|
||||
- task: DotNetCoreCLI@2
|
||||
displayName: Publish single-exe x64
|
||||
inputs:
|
||||
vsVersion: 'latest'
|
||||
solution: '$(solution)'
|
||||
platform: '$(buildPlatform)'
|
||||
configuration: '$(buildConfiguration)'
|
||||
command: 'publish'
|
||||
publishWebProjects: false
|
||||
projects: 'src\Greenshot\Greenshot.csproj'
|
||||
arguments: '-f netcoreapp3.0 -c Release /p:PublishSingleFile=true /p:UseAppHost=true /p:RuntimeIdentifier=win-x64'
|
||||
zipAfterPublish: false
|
||||
|
||||
- task: DotNetCoreCLI@2
|
||||
displayName: Publish single-exe x86
|
||||
inputs:
|
||||
command: 'publish'
|
||||
publishWebProjects: false
|
||||
projects: 'src\Greenshot\Greenshot.csproj'
|
||||
arguments: '-f netcoreapp3.0 -c Release /p:PublishSingleFile=true /p:UseAppHost=true /p:RuntimeIdentifier=win-x86'
|
||||
zipAfterPublish: false
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: 'Copy Files to: $(build.artifactstagingdirectory)'
|
||||
inputs:
|
||||
SourceFolder: '$(Build.SourcesDirectory)\src\Greenshot\bin\$(BuildConfiguration)'
|
||||
SourceFolder: '$(Build.SourcesDirectory)\src\Greenshot\bin\Release\netcoreapp3.0'
|
||||
Contents: |
|
||||
**
|
||||
win-x64\publish\Greenshot.exe
|
||||
win-x86\publish\Greenshot.exe
|
||||
TargetFolder: '$(build.artifactstagingdirectory)'
|
||||
flattenFolders: false
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta2-18618-05" PrivateAssets="All"/>
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="PostBuild" BeforeTargets="PostBuildEvent" Condition="$(MSBuildProjectName.Contains('Addon.')) And !$(MSBuildProjectName.Contains('Test')) And !$(MSBuildProjectName.Contains('Demo')) And ($(OsProductName.Contains('Windows 10')) Or (!$(OsProductName.Contains('Windows 10')) And !$(MSBuildProjectName.Contains('Win10'))))">
|
||||
<Target Name="PostBuild" BeforeTargets="PostBuildEvent" Condition="'$(BuildingInsideVisualStudio)' == 'true' And $(MSBuildProjectName.Contains('Addon.')) And !$(MSBuildProjectName.Contains('Test')) And !$(MSBuildProjectName.Contains('Demo')) And ($(OsProductName.Contains('Windows 10')) Or (!$(OsProductName.Contains('Windows 10')) And !$(MSBuildProjectName.Contains('Win10'))))">
|
||||
<Exec Command="
|
||||
xcopy /q /y /d "$(TargetDir)$(TargetName).*" "$(SolutionDir)$(SolutionName)\$(OutDir)"

|
||||
xcopy /q /y /d "$(TargetDir)*.dll" "$(SolutionDir)$(SolutionName)\$(OutDir)"

|
||||
|
|
|
@ -34,6 +34,9 @@ using Greenshot.Addons.Animation;
|
|||
using Greenshot.Addons.Controls;
|
||||
using Greenshot.Addons.Core;
|
||||
using Greenshot.Gfx;
|
||||
using Dapplo.Windows.User32;
|
||||
using Dapplo.Windows.Dpi;
|
||||
using System.Text;
|
||||
|
||||
namespace Greenshot.Forms
|
||||
{
|
||||
|
@ -354,7 +357,10 @@ namespace Greenshot.Forms
|
|||
DialogResult = DialogResult.Cancel;
|
||||
break;
|
||||
case Keys.E:
|
||||
MessageBox.Show(EnvironmentInfo.EnvironmentToString(true));
|
||||
var info = new StringBuilder(EnvironmentInfo.EnvironmentToString(true));
|
||||
var screenboundsSize = DisplayInfo.ScreenBounds.Size;
|
||||
info.AppendFormat("Screen: {0} at {1}%", $"{screenboundsSize.Width} x {screenboundsSize.Height}", FormDpiHandler.ScaleWithCurrentDpi(100));
|
||||
MessageBox.Show(info.ToString(), "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
break;
|
||||
case Keys.L:
|
||||
// TODO: Open the log file
|
||||
|
|
|
@ -59,8 +59,7 @@ namespace Greenshot.Helpers
|
|||
|
||||
public static string EnvironmentToString(bool newline)
|
||||
{
|
||||
var environment = new StringBuilder();
|
||||
environment.Append("Software version: " + Application.ProductVersion);
|
||||
var environment = new StringBuilder("Software version: " + Application.ProductVersion);
|
||||
environment.Append(" (" + OsInfo.Bits + " bit)");
|
||||
|
||||
if (newline)
|
||||
|
@ -96,7 +95,8 @@ namespace Greenshot.Helpers
|
|||
{
|
||||
environment.Append(", ");
|
||||
}
|
||||
environment.Append(string.Format("OS: {0} {1} {2} (x{3}) {4}", OsInfo.Name, OsInfo.Edition, OsInfo.ServicePack, OsInfo.Bits, OsInfo.VersionString));
|
||||
|
||||
environment.AppendFormat("OS: {0} {1} {2} (x{3}) {4}", OsInfo.Name, OsInfo.Edition, OsInfo.ServicePack, OsInfo.Bits, OsInfo.VersionString);
|
||||
if (newline)
|
||||
{
|
||||
environment.AppendLine();
|
||||
|
@ -105,6 +105,17 @@ namespace Greenshot.Helpers
|
|||
{
|
||||
environment.Append(", ");
|
||||
}
|
||||
|
||||
environment.AppendFormat("Location: {0}", Assembly.GetEntryAssembly()?.Location);
|
||||
if (newline)
|
||||
{
|
||||
environment.AppendLine();
|
||||
}
|
||||
else
|
||||
{
|
||||
environment.Append(", ");
|
||||
}
|
||||
|
||||
// Get some important information for fixing GDI related Problems
|
||||
environment.AppendFormat("GDI object count: {0}", User32Api.GetGuiResourcesGdiCount());
|
||||
if (newline)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue