Skip to content

Commit

Permalink
Merge pull request #42 from cwensley/console-integration
Browse files Browse the repository at this point in the history
Installer and build updates, include .msi
  • Loading branch information
cwensley authored Dec 20, 2021
2 parents db26da8 + 3b498bb commit dac971d
Show file tree
Hide file tree
Showing 8 changed files with 171 additions and 146 deletions.
199 changes: 102 additions & 97 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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:
Expand All @@ -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
7 changes: 1 addition & 6 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,5 @@
"var": {
"BuildConfiguration": "Debug"
},
"files.associations": {
"chrono": "cpp",
"filesystem": "cpp",
"string": "cpp"
},
"clangd.path": "clangd"
// "clangd.path": "clangd"
}
24 changes: 18 additions & 6 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "shell",
"command": "dotnet",
"args": [
"build",
"${workspaceFolder}/Source/Pablo Desktop.sln",
Expand All @@ -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}",
Expand All @@ -40,8 +40,8 @@
},
{
"label": "build-pablodraw",
"command": "dotnet",
"type": "shell",
"command": "dotnet",
"args": [
"build",
"${workspaceFolder}/Source/PabloDraw/PabloDraw.csproj",
Expand All @@ -58,8 +58,8 @@
},
{
"label": "publish-pablodraw",
"command": "dotnet",
"type": "shell",
"command": "dotnet",
"args": [
"publish",
"${workspaceFolder}/Source/PabloDraw/PabloDraw.csproj",
Expand Down Expand Up @@ -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",
Expand All @@ -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"
}
}
]
}
23 changes: 13 additions & 10 deletions Source/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,29 +1,32 @@
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<PropertyGroup Condition="$(BuildTarget) == ''">
<BuildTarget Condition="$([MSBuild]::IsOSPlatform(Windows))">Windows</BuildTarget>
<BuildTarget Condition="$([MSBuild]::IsOSPlatform(OSX))">Mac</BuildTarget>
<BuildTarget Condition="$([MSBuild]::IsOSPlatform(Linux))">Linux</BuildTarget>
</PropertyGroup>

<PropertyGroup>
<Company>Picoe Software Solutions</Company>
<Copyright>(c) 2006-2021 by Curtis Wensley aka Eto</Copyright>
<Version>3.3.0-dev</Version>
<Version Condition="$(Version) == ''">3.3.11-dev</Version>

<BasePath>$(MSBuildThisFileDirectory)..\</BasePath>
<BasePath>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\'))</BasePath>
<ArtifactsDir>$(BasePath)artifacts\</ArtifactsDir>

<DebugType>embedded</DebugType>
<NoWarn>NU1701</NoWarn>

<BaseIntermediateOutputPath Condition="$(BaseIntermediateOutputPath) == ''">$(ArtifactsDir)obj\$(OS)\$(MSBuildProjectName)\</BaseIntermediateOutputPath>
<OutputArtifactName Condition="$(OutputArtifactName) == ''">bin</OutputArtifactName>
<BaseOutputPath Condition="$(BaseOutputPath) == ''">$(ArtifactsDir)$(OutputArtifactName)\$(MSBuildProjectName)\</BaseOutputPath>
<BaseIntermediateOutputPath Condition="$(BaseIntermediateOutputPath) == ''">$(ArtifactsDir)obj\$(BuildTarget)\$(MSBuildProjectName)\</BaseIntermediateOutputPath>
<BaseOutputPath Condition="$(BaseOutputPath) == ''">$(ArtifactsDir)bin\$(MSBuildProjectName)\</BaseOutputPath>
<PackageOutputPath Condition="$(PackageOutputPath) == ''">$(ArtifactsDir)nuget\$(Configuration)\</PackageOutputPath>
<RestoreProjectStyle Condition="'$(RestoreProjectStyle)' == ''">PackageReference</RestoreProjectStyle>
<PublishDir Condition="$(PublishDir) == ''">$(ArtifactsDir)publish\$(Configuration)\$(BuildTarget)\</PublishDir>

<!-- Uncomment to use Eto from source -->
<!-- <EtoBasePath>..\..\..\Eto\</EtoBasePath> -->

</PropertyGroup>

<PropertyGroup Condition="$(BuildTarget) == ''">
<BuildTarget Condition="$([MSBuild]::IsOSPlatform(Windows))">Windows</BuildTarget>
<BuildTarget Condition="$([MSBuild]::IsOSPlatform(OSX))">Mac</BuildTarget>
<BuildTarget Condition="$([MSBuild]::IsOSPlatform(Linux))">Linux</BuildTarget>
</PropertyGroup>

</Project>
4 changes: 3 additions & 1 deletion Source/Pablo/BGI/BGICanvas.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2310,7 +2310,7 @@ public void UpdateRegion(IList<Rectangle> 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
{
Expand All @@ -2332,6 +2332,7 @@ public void UpdateRegion(IList<Rectangle> rects, Graphics graphics = null)
}
});
}
#if disabled
else
{
/**/
Expand Down Expand Up @@ -2539,6 +2540,7 @@ public void UpdateRegion(IList<Rectangle> rects, Graphics graphics = null)
}
});
}
#endif
}
}

Expand Down
Loading

0 comments on commit dac971d

Please sign in to comment.