diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 04fd623..da45dc2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,11 +1,12 @@ +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json name: Build on: push: - branches: [ main ] - tags: [ '*' ] + branches: [main] + tags: ["*"] pull_request: - branches: [ main ] + branches: [main] env: DotNetVersion: "6.0.x" @@ -16,108 +17,114 @@ jobs: build-windows: runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v2 - - uses: actions/setup-dotnet@v1 - with: - dotnet-version: ${{ env.DotNetVersion }} + - uses: actions/setup-dotnet@v1 + with: + dotnet-version: ${{ env.DotNetVersion }} - - name: Build PabloDraw - run: dotnet publish Source/PabloDraw/PabloDraw.csproj ${{ env.BuildParameters }} /bl:artifacts/log/pablodraw-windows.binlog + - uses: microsoft/setup-msbuild@v1.1 - - name: Build PabloDraw.Console - run: dotnet publish Source/PabloDraw.Console/PabloDraw.Console.cxproj ${{ env.BuildParameters }} /bl:artifacts/log/pablodraw.console-windows.binlog + - name: Build PabloDraw + run: dotnet publish Source/PabloDraw/PabloDraw.csproj ${{ env.BuildParameters }} /bl:artifacts/log/pablodraw-windows.binlog - - uses: actions/upload-artifact@v2 - with: - name: pablodraw-windows-x64 - path: artifacts/bin/PabloDraw/${{ env.BuildConfiguration }}/net6.0-windows/win-x64/publish/* - - - uses: actions/upload-artifact@v2 - with: - name: pablodraw-windows-x64 - path: artifacts/bin/PabloDraw.Console/x64/${{ env.BuildConfiguration }}/* - - - name: Upload log files - if: ${{ failure() }} - uses: actions/upload-artifact@v2 - with: - name: log - path: artifacts/log/**/* + - name: Build PabloDraw.Console + run: dotnet publish Source/PabloDraw.Console/PabloDraw.Console.cxproj ${{ env.BuildParameters }} /bl:artifacts/log/pablodraw.console-windows.binlog + + - name: Build msi + run: msbuild ${{ env.BuildParameters }} Source/PabloDraw.WindowsInstaller/PabloDraw.WindowsInstaller.wixproj + + - uses: actions/upload-artifact@v2 + with: + name: pablodraw-windows-binaries-x64 + path: artifacts/publish/${{ env.BuildConfiguration }}/Windows/* + + - uses: actions/upload-artifact@v2 + with: + name: pablodraw-windows-installer-x64 + path: artifacts/installer/${{ env.BuildConfiguration }}/Windows/*.msi + + - name: Upload log files + if: ${{ failure() }} + uses: actions/upload-artifact@v2 + with: + name: log + path: artifacts/log/**/* build-linux: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v2 - - uses: actions/setup-dotnet@v1 - with: - dotnet-version: ${{ env.DotNetVersion }} + - uses: actions/setup-dotnet@v1 + with: + dotnet-version: ${{ env.DotNetVersion }} - - name: Build PabloDraw - run: dotnet publish Source/PabloDraw/PabloDraw.csproj ${{ env.BuildParameters }} /bl:artifacts/log/pablodraw-linux.binlog + - name: Build PabloDraw + run: dotnet publish Source/PabloDraw/PabloDraw.csproj ${{ env.BuildParameters }} /bl:artifacts/log/pablodraw-linux.binlog + + - name: Create gzip + run: tar -czvf pablodraw.tar.gz -C artifacts/publish/${{ env.BuildConfiguration }}/Linux . - - uses: actions/upload-artifact@v2 - with: - name: pablodraw-linux-x64 - path: artifacts/bin/PabloDraw/${{ env.BuildConfiguration }}/net6.0/linux-x64/publish/* + - uses: actions/upload-artifact@v2 + with: + name: pablodraw-linux-binaries-x64 + path: pablodraw.tar.gz - - name: Upload log files - if: ${{ failure() }} - uses: actions/upload-artifact@v2 - with: - name: log - path: artifacts/log/**/* + - name: Upload log files + if: ${{ failure() }} + uses: actions/upload-artifact@v2 + with: + name: log + path: artifacts/log/**/* build-mac: runs-on: macos-11 steps: - - uses: actions/checkout@v2 - - - uses: actions/setup-dotnet@v1 - with: - dotnet-version: ${{ env.DotNetVersion }} - - - uses: maxim-lobanov/setup-xamarin@v1 - with: - mono-version: latest - xamarin-mac-version: latest - xcode-version: 13.1 - - - name: Import code signing certificate - if: github.event_name != 'pull_request' - uses: apple-actions/import-codesign-certs@v1 - with: - p12-file-base64: ${{ secrets.DEVID_CERTIFICATE_P12 }} - p12-password: ${{ secrets.DEVID_CERTIFICATE_P12_PASSWORD }} - - - name: Enable code signing - if: github.event_name != 'pull_request' - run: echo "BuildParameters=${{ env.BuildParameters }} /p:EnableCodeSigning=True" >> $GITHUB_ENV - - - name: Set notarization credentials - if: startsWith(github.ref, 'refs/tags/') - run: | - xcrun altool --store-password-in-keychain-item "AC_PASSWORD" -u "${{ secrets.AC_USERNAME }}" -p "${{ secrets.AC_PASSWORD }}" - echo "BuildParameters=${{ env.BuildParameters }} /p:EnableNotarization=True" >> $GITHUB_ENV - - - name: Build PabloDraw - run: dotnet build Source/PabloDraw/PabloDraw.csproj ${{ env.BuildParameters }} /bl:artifacts/log/pablodraw-mac.binlog - - - uses: actions/upload-artifact@v2 - with: - name: pablodraw-mac - path: artifacts/bin/PabloDraw/${{ env.BuildConfiguration }}/net6.0/PabloDraw.dmg - - - name: Upload log files - if: ${{ failure() }} - uses: actions/upload-artifact@v2 - with: - name: log - path: artifacts/log/**/* - + - uses: actions/checkout@v2 + + - uses: actions/setup-dotnet@v1 + with: + dotnet-version: ${{ env.DotNetVersion }} + + - uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: 13.1 + + - name: Import code signing certificate + if: github.event_name != 'pull_request' + uses: apple-actions/import-codesign-certs@v1 + with: + p12-file-base64: ${{ secrets.DEVID_CERTIFICATE_P12 }} + p12-password: ${{ secrets.DEVID_CERTIFICATE_P12_PASSWORD }} + + - name: Enable code signing + if: github.event_name != 'pull_request' + run: echo "BuildParameters=${{ env.BuildParameters }} /p:EnableCodeSigning=True" >> $GITHUB_ENV + + - name: Set notarization credentials + if: startsWith(github.ref, 'refs/tags/') + run: | + xcrun altool --store-password-in-keychain-item "AC_PASSWORD" -u "${{ secrets.AC_USERNAME }}" -p "${{ secrets.AC_PASSWORD }}" + echo "BuildParameters=${{ env.BuildParameters }} /p:EnableNotarization=True" >> $GITHUB_ENV + + - name: Build PabloDraw + run: dotnet build Source/PabloDraw/PabloDraw.csproj ${{ env.BuildParameters }} /bl:artifacts/log/pablodraw-mac.binlog + + - uses: actions/upload-artifact@v2 + with: + name: pablodraw-mac + path: artifacts/bin/PabloDraw/${{ env.BuildConfiguration }}/net6.0/PabloDraw.dmg + + - name: Upload log files + if: ${{ failure() }} + uses: actions/upload-artifact@v2 + with: + name: log + path: artifacts/log/**/* + update-release: - needs: [ build-windows, build-mac, build-linux ] + needs: [build-windows, build-mac, build-linux] runs-on: ubuntu-latest if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) steps: @@ -128,14 +135,12 @@ jobs: uses: bruceadams/get-release@v1.2.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - + - uses: actions/download-artifact@v2 - # - uses: actions/upload-release-asset@v1 - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # with: - # upload_url: ${{ steps.get_release.outputs.upload_url }} - # asset_path: - # asset_name: - # asset_content_type: application/octet-stream + - uses: softprops/action-gh-release@v1 + with: + files: | + **/*.msi + **/*.dmg + **/*.tar.gz diff --git a/.vscode/settings.json b/.vscode/settings.json index f3616ec..176416c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -5,10 +5,5 @@ "var": { "BuildConfiguration": "Debug" }, - "files.associations": { - "chrono": "cpp", - "filesystem": "cpp", - "string": "cpp" - }, - "clangd.path": "clangd" + // "clangd.path": "clangd" } \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 7c9113b..a7e20bb 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -5,8 +5,8 @@ "tasks": [ { "label": "build", - "command": "dotnet", "type": "shell", + "command": "dotnet", "args": [ "build", "${workspaceFolder}/Source/Pablo Desktop.sln", @@ -22,10 +22,10 @@ }, { "label": "build-pablodraw-console", - "command": "dotnet", "type": "shell", + "command": "dotnet", "args": [ - "build", + "publish", "${workspaceFolder}/Source/PabloDraw.Console/PabloDraw.Console.cxproj", // "/p:BuildTarget=Linux", "/p:Configuration=${config:var.BuildConfiguration}", @@ -40,8 +40,8 @@ }, { "label": "build-pablodraw", - "command": "dotnet", "type": "shell", + "command": "dotnet", "args": [ "build", "${workspaceFolder}/Source/PabloDraw/PabloDraw.csproj", @@ -58,8 +58,8 @@ }, { "label": "publish-pablodraw", - "command": "dotnet", "type": "shell", + "command": "dotnet", "args": [ "publish", "${workspaceFolder}/Source/PabloDraw/PabloDraw.csproj", @@ -91,13 +91,14 @@ }, { "label": "build-windows-installer", - "command": "msbuild", "type": "shell", + "command": "${input:msbuild}", "args": [ "/t:Build", "${workspaceFolder}/Source/PabloDraw.WindowsInstaller/PabloDraw.WindowsInstaller.wixproj", "/p:Configuration=${config:var.BuildConfiguration}", "/p:GenerateFullPaths=true", + "/v:Minimal", "/consoleloggerparameters:NoSummary" ], "group": "build", @@ -106,5 +107,16 @@ }, "problemMatcher": "$msCompile" } + ], + "inputs": [ + { + "id": "msbuild", + "type": "command", + "command": "shellCommand.execute", + "args": { + "command": "\"%ProgramFiles(x86)%\\Microsoft Visual Studio\\Installer\\vswhere.exe\" -version \"[16,18)\" -latest -products * -requires Microsoft.Component.MSBuild -find MSBuild\\**\\Bin\\MSBuild.exe", + "useFirstResult": "true" + } + } ] } \ No newline at end of file diff --git a/Source/Directory.Build.props b/Source/Directory.Build.props index 688c2e2..a31287a 100644 --- a/Source/Directory.Build.props +++ b/Source/Directory.Build.props @@ -1,29 +1,32 @@  + + + Windows + Mac + Linux + + Picoe Software Solutions (c) 2006-2021 by Curtis Wensley aka Eto - 3.3.0-dev + 3.3.11-dev - $(MSBuildThisFileDirectory)..\ + $([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\')) $(BasePath)artifacts\ embedded + NU1701 - $(ArtifactsDir)obj\$(OS)\$(MSBuildProjectName)\ - bin - $(ArtifactsDir)$(OutputArtifactName)\$(MSBuildProjectName)\ + $(ArtifactsDir)obj\$(BuildTarget)\$(MSBuildProjectName)\ + $(ArtifactsDir)bin\$(MSBuildProjectName)\ $(ArtifactsDir)nuget\$(Configuration)\ PackageReference + $(ArtifactsDir)publish\$(Configuration)\$(BuildTarget)\ - - Windows - Mac - Linux - \ No newline at end of file diff --git a/Source/Pablo/BGI/BGICanvas.cs b/Source/Pablo/BGI/BGICanvas.cs index b047583..0b01c6a 100644 --- a/Source/Pablo/BGI/BGICanvas.cs +++ b/Source/Pablo/BGI/BGICanvas.cs @@ -2310,7 +2310,7 @@ public void UpdateRegion(IList rects, Graphics graphics = null) return; var platform = Platform.Instance; - if (true) //platform.IsWpf || platform.IsIos || platform.IsMac || platform.IsWinForms) + // if (platform.IsWpf || platform.IsIos || platform.IsMac || platform.IsWinForms) { Application.Instance.AsyncInvoke(delegate { @@ -2332,6 +2332,7 @@ public void UpdateRegion(IList rects, Graphics graphics = null) } }); } + #if disabled else { /**/ @@ -2539,6 +2540,7 @@ public void UpdateRegion(IList rects, Graphics graphics = null) } }); } + #endif } } diff --git a/Source/PabloDraw.WindowsInstaller/PabloDraw.WindowsInstaller.wixproj b/Source/PabloDraw.WindowsInstaller/PabloDraw.WindowsInstaller.wixproj index 6bb3b6d..3d3de08 100644 --- a/Source/PabloDraw.WindowsInstaller/PabloDraw.WindowsInstaller.wixproj +++ b/Source/PabloDraw.WindowsInstaller/PabloDraw.WindowsInstaller.wixproj @@ -12,15 +12,13 @@ Package $(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets $(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets + PublishDir=$(PublishDir) + $(BaseIntermediateOutputPath)$(Configuration)\ + $(ArtifactsDir)installer\$(Configuration)\$(BuildTarget)\ + True - ..\..\artifacts\bin\$(Configuration)\net6.0-windows - ..\..\artifacts\obj\$(OS)\$(Configuration)\ - Debug - - - ..\..\artifacts\bin\$(Configuration)\net6.0-windows - ..\..\artifacts\obj\$(OS)\$(Configuration)\ + $(DefineConstants);Debug @@ -28,15 +26,17 @@ PabloDraw - {9a72b697-8da3-4a52-9e6b-05deeea23ad2} - True True Binaries;Content;Satellites INSTALLFOLDER True - net6.0-windows - win-x64 - ..\..\artifacts\bin\$(Configuration)\net6.0-windows\win-x64\publish\ + + + PabloDraw.Console + True + Binaries;Content;Satellites + INSTALLFOLDER + True @@ -46,22 +46,22 @@ - - + + - $(DefineConstants);AssemblyVersion=$(AssemblyVersion) + $(DefineConstants);Version=$(AssemblyVersion) - - - - + + + \ No newline at end of file diff --git a/Source/PabloDraw.WindowsInstaller/Product.wxs b/Source/PabloDraw.WindowsInstaller/Product.wxs index e392256..c99dd11 100644 --- a/Source/PabloDraw.WindowsInstaller/Product.wxs +++ b/Source/PabloDraw.WindowsInstaller/Product.wxs @@ -6,7 +6,6 @@ - @@ -59,9 +58,12 @@ + + + - - + + diff --git a/build/Cpp.targets b/build/Cpp.targets index c2d353a..d9b0c55 100755 --- a/build/Cpp.targets +++ b/build/Cpp.targets @@ -70,7 +70,13 @@ - + + + + + + +