Skip to content

Commit

Permalink
feat: net8 and profiles add nuget
Browse files Browse the repository at this point in the history
  • Loading branch information
minkostaev committed Mar 24, 2024
1 parent 11e2de6 commit 6a9d062
Show file tree
Hide file tree
Showing 18 changed files with 75 additions and 37 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/dotnet-desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Install .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
dotnet-version: 8.0.x

# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
- name: Setup MSBuild.exe
Expand Down Expand Up @@ -79,10 +79,10 @@ jobs:
run: |
cd ${{ env.Proj_Name }}
#dotnet publish ShortcutsGrid.csproj /p:PublishProfile="Win System"
#copy "bin\Win System\net6.0-windows\publish\win-x64\Win System.exe" ..\\${{ env.Test_Proj_Dir }}\\TestResults
#copy "bin\Win System\net8.0-windows\publish\win-x64\Win System.exe" ..\\${{ env.Test_Proj_Dir }}\\TestResults
$exes = "Win System","Win Admin","Office","Utils","Browsers","Connections","Disk Tools","Audio","Image","Video","Hardware","Virtual Machines","Programming","Games"
foreach ($name in $exes){dotnet publish ShortcutsGrid.csproj /p:PublishProfile="$name"}
foreach ($name in $exes){copy "bin\$name\net6.0-windows\publish\win-x64\$name.exe" ..\\${{ env.Test_Proj_Dir }}\\TestResults}
foreach ($name in $exes){copy "bin\$name\net8.0-windows\publish\win-x64\$name.exe" ..\\${{ env.Test_Proj_Dir }}\\TestResults}
# Upload artifacts in the ations section
- name: Upload artifacts
Expand Down
41 changes: 39 additions & 2 deletions ShortcutsGrid/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
namespace ShortcutsGrid;

using Forms.Wpf.Mls.Tools.Models;
using Forms.Wpf.Mls.Tools.Services;
using Models;
using Services;
using System;
using System.ComponentModel;
using System.Windows;
using System.Windows.Input;
using System.Windows.Threading;

/// <summary>
/// Interaction logic for MainWindow.xaml
Expand All @@ -14,9 +19,11 @@ public MainWindow()
{
///var startTimer = Stopwatch.StartNew();
///var endTimer = Stopwatch.StartNew();

InitializeComponent();

///WaitForResponseOnClose();

this.ContentRendered += delegate
{
///startTimer.Stop();
Expand All @@ -26,7 +33,6 @@ public MainWindow()
{
///endTimer.Stop();
///var elapsedMs = endTimer.ElapsedMilliseconds;
///AppValues.MongoShortcutsGrid.MachineAdded();
};

AppValues.MainWin = this;
Expand All @@ -45,7 +51,38 @@ public MainWindow()
#endregion

ShowShortcuts.Load();
}

private void WaitForResponseOnClose()
{
var closeTime = new DispatcherTimer { Interval = new TimeSpan(0, 0, 0, 0, 250) };
closeTime.Tick += delegate { this.Close(); };

RequestResponse? response = null;
var worker = new BackgroundWorker();
worker.DoWork += async delegate
{
var requestManager = new RequestManager();
response = await requestManager.SendRequest("", RequestMethod.GET, "");
};
worker.RunWorkerCompleted += delegate { this.Close(); };

bool started = false;
Closing += (sender, e) =>
{
if (!started)
{
worker.RunWorkerAsync();
started = true;
closeTime.Start();
e.Cancel = true;
}
if (response == null)
{
closeTime.Stop();
e.Cancel = true;
}
};
}

}
8 changes: 4 additions & 4 deletions ShortcutsGrid/Properties/PublishProfiles/Audio.pubxml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\Audio\net6.0-windows\publish\win-x64\</PublishDir>
<PublishDir>bin\Audio\net8.0-windows\publish\win-x64\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net8.0-windows</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<SelfContained>false</SelfContained>
<PublishSingleFile>True</PublishSingleFile>
<PublishReadyToRun>False</PublishReadyToRun>
<ApplicationIcon>Resources\audio-128.ico</ApplicationIcon>
<AssemblyName>Audio</AssemblyName>
<ApplicationIcon>Resources\audio-128.ico</ApplicationIcon>
<AssemblyName>Audio</AssemblyName>
</PropertyGroup>
</Project>
4 changes: 2 additions & 2 deletions ShortcutsGrid/Properties/PublishProfiles/Browsers.pubxml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\Browsers\net6.0-windows\publish\win-x64\</PublishDir>
<PublishDir>bin\Browsers\net8.0-windows\publish\win-x64\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net8.0-windows</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<SelfContained>false</SelfContained>
<PublishSingleFile>True</PublishSingleFile>
Expand Down
4 changes: 2 additions & 2 deletions ShortcutsGrid/Properties/PublishProfiles/Connections.pubxml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\Connections\net6.0-windows\publish\win-x64\</PublishDir>
<PublishDir>bin\Connections\net8.0-windows\publish\win-x64\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net8.0-windows</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<SelfContained>false</SelfContained>
<PublishSingleFile>True</PublishSingleFile>
Expand Down
4 changes: 2 additions & 2 deletions ShortcutsGrid/Properties/PublishProfiles/Disk Tools.pubxml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\Disk Tools\net6.0-windows\publish\win-x64\</PublishDir>
<PublishDir>bin\Disk Tools\net8.0-windows\publish\win-x64\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net8.0-windows</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<SelfContained>false</SelfContained>
<PublishSingleFile>True</PublishSingleFile>
Expand Down
4 changes: 2 additions & 2 deletions ShortcutsGrid/Properties/PublishProfiles/FolderProfile.pubxml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\Release\net6.0-windows\publish\win-x64\</PublishDir>
<PublishDir>bin\Release\net8.0-windows\publish\win-x64\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net8.0-windows</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<SelfContained>false</SelfContained>
<PublishSingleFile>True</PublishSingleFile>
Expand Down
4 changes: 2 additions & 2 deletions ShortcutsGrid/Properties/PublishProfiles/Games.pubxml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\Games\net6.0-windows\publish\win-x64\</PublishDir>
<PublishDir>bin\Games\net8.0-windows\publish\win-x64\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net8.0-windows</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<SelfContained>false</SelfContained>
<PublishSingleFile>True</PublishSingleFile>
Expand Down
4 changes: 2 additions & 2 deletions ShortcutsGrid/Properties/PublishProfiles/Hardware.pubxml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\Hardware\net6.0-windows\publish\win-x64\</PublishDir>
<PublishDir>bin\Hardware\net8.0-windows\publish\win-x64\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net8.0-windows</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<SelfContained>false</SelfContained>
<PublishSingleFile>True</PublishSingleFile>
Expand Down
4 changes: 2 additions & 2 deletions ShortcutsGrid/Properties/PublishProfiles/Image.pubxml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\Image\net6.0-windows\publish\win-x64\</PublishDir>
<PublishDir>bin\Image\net8.0-windows\publish\win-x64\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net8.0-windows</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<SelfContained>false</SelfContained>
<PublishSingleFile>True</PublishSingleFile>
Expand Down
4 changes: 2 additions & 2 deletions ShortcutsGrid/Properties/PublishProfiles/Office.pubxml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\Office\net6.0-windows\publish\win-x64\</PublishDir>
<PublishDir>bin\Office\net8.0-windows\publish\win-x64\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net8.0-windows</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<SelfContained>false</SelfContained>
<PublishSingleFile>True</PublishSingleFile>
Expand Down
4 changes: 2 additions & 2 deletions ShortcutsGrid/Properties/PublishProfiles/Programming.pubxml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\Programming\net6.0-windows\publish\win-x64\</PublishDir>
<PublishDir>bin\Programming\net8.0-windows\publish\win-x64\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net8.0-windows</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<SelfContained>false</SelfContained>
<PublishSingleFile>True</PublishSingleFile>
Expand Down
4 changes: 2 additions & 2 deletions ShortcutsGrid/Properties/PublishProfiles/Utils.pubxml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\Utils\net6.0-windows\publish\win-x64\</PublishDir>
<PublishDir>bin\Utils\net8.0-windows\publish\win-x64\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net8.0-windows</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<SelfContained>false</SelfContained>
<PublishSingleFile>True</PublishSingleFile>
Expand Down
4 changes: 2 additions & 2 deletions ShortcutsGrid/Properties/PublishProfiles/Video.pubxml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\Video\net6.0-windows\publish\win-x64\</PublishDir>
<PublishDir>bin\Video\net8.0-windows\publish\win-x64\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net8.0-windows</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<SelfContained>false</SelfContained>
<PublishSingleFile>True</PublishSingleFile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\Virtual Machines\net6.0-windows\publish\win-x64\</PublishDir>
<PublishDir>bin\Virtual Machines\net8.0-windows\publish\win-x64\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net8.0-windows</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<SelfContained>false</SelfContained>
<PublishSingleFile>True</PublishSingleFile>
Expand Down
4 changes: 2 additions & 2 deletions ShortcutsGrid/Properties/PublishProfiles/Win Admin.pubxml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\Win Admin\net6.0-windows\publish\win-x64\</PublishDir>
<PublishDir>bin\Win Admin\net8.0-windows\publish\win-x64\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net8.0-windows</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<SelfContained>false</SelfContained>
<PublishSingleFile>True</PublishSingleFile>
Expand Down
4 changes: 2 additions & 2 deletions ShortcutsGrid/Properties/PublishProfiles/Win System.pubxml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\Win System\net6.0-windows\publish\win-x64\</PublishDir>
<PublishDir>bin\Win System\net8.0-windows\publish\win-x64\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net8.0-windows</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<SelfContained>false</SelfContained>
<PublishSingleFile>True</PublishSingleFile>
Expand Down
1 change: 1 addition & 0 deletions ShortcutsGrid/ShortcutsGrid.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Forms.Wpf.Mls.Tools" Version="1.0.7" />
<PackageReference Include="System.Drawing.Common" Version="8.0.3" />
</ItemGroup>

Expand Down

0 comments on commit 6a9d062

Please sign in to comment.