Skip to content

Commit

Permalink
Update to NET 8 and use GitHub actions (#172)
Browse files Browse the repository at this point in the history
* Update to NET 8 and use GitHub actions

* fix build take 1

* fix build take 2
  • Loading branch information
ErikEJ authored Feb 2, 2025
1 parent f0e769b commit 5dc35bc
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 13 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: .NET

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build:

runs-on: windows-latest

steps:
- uses: actions/checkout@v4

- name: Update Version
run: |
((Get-Content -Path .\src\SqlQueryStressCLI\AssemblyInfo.cs -Raw) -Replace "1.0.0.0", "0.9.8.${{ github.run_number }}") | Set-Content -Path .\src\SqlQueryStressCLI\AssemblyInfo.cs
((Get-Content -Path .\src\SQLQueryStress\Properties\AssemblyInfo.cs -Raw) -Replace "1.0.0.0", "0.9.8.${{ github.run_number }}") | Set-Content -Path .\src\SqlQueryStressCLI\AssemblyInfo.cs
shell: pwsh

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: Build
run: dotnet build ./src/SQLQueryStress.sln --configuration Release

- name: dotnet publish
run: dotnet publish ./src/SQLQueryStress/SqlQueryStress.csproj --configuration Release --output .\src\SQLQueryStress\bin\Publish\net8.0-windows\ --self-contained true

- name: zip app
run: 7z a SqlQueryStress-0.9.8.${{ env.VERSION }}.zip .\src\SQLQueryStress\bin\Publish\net8.0-windows\*.exe

- name: Publish artifacts
uses: actions/upload-artifact@v4
with:
name: Artifacts
path: |
*.zip
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
path: |
**\\*.nupkg
# - name: Publish NuGet
# if: startsWith(github.ref, 'refs/heads/master') && github.repository_owner == 'ErikEJ'
# run: dotnet nuget push **\*.nupkg --source 'https://api.nuget.org/v3/index.json' --api-key ${{ secrets.NUGET }} --skip-duplicate

5 changes: 2 additions & 3 deletions src/SQLQueryStress/DatabaseSelect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -410,14 +410,13 @@ private void appintent_check_CheckedChanged(object sender, EventArgs e)
{
appintent_combo.Enabled = appintent_check.Checked;

appintent_combo.DataSource = Enum.GetValues(typeof(ApplicationIntent));
appintent_combo.DataSource = Enum.GetValues<ApplicationIntent>();
}

private void pm_appintent_check_CheckedChanged(object sender, EventArgs e)
{
pm_appintent_combo.Enabled = pm_appintent_check.Checked;

pm_appintent_combo.DataSource = Enum.GetValues(typeof(ApplicationIntent));
}
pm_appintent_combo.DataSource = Enum.GetValues<ApplicationIntent>(); }
}
}
9 changes: 9 additions & 0 deletions src/SQLQueryStress/GlobalSuppressions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.

using System.Diagnostics.CodeAnalysis;

[assembly: SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "Windows only")]
[assembly: SuppressMessage("Maintainability", "CA1515:Consider making public types internal", Justification = "Console app")]
3 changes: 1 addition & 2 deletions src/SQLQueryStress/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using SQLQueryStress.Properties;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Windows.Forms;

Expand Down Expand Up @@ -80,7 +79,7 @@ private static Assembly OnResolveAssembly(object sender, ResolveEventArgs args)
return null;
}
var assemblyData = new byte[stream.Length];
stream.Read(assemblyData, 0, assemblyData.Length);
stream.ReadExactly(assemblyData);
return Assembly.Load(assemblyData);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/SQLQueryStress/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@
// Revision
//

[assembly: AssemblyVersion("0.9.7.0")]
[assembly: AssemblyFileVersion("0.9.7.0")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
3 changes: 2 additions & 1 deletion src/SQLQueryStress/SQLQueryStress.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net8.0-windows</TargetFramework>
<PlatformName>windows</PlatformName>
<OutputType>WinExe</OutputType>
<UseWindowsForms>true</UseWindowsForms>
<UseWPF>true</UseWPF>
Expand Down
2 changes: 1 addition & 1 deletion src/SqlQueryStressCLI/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
[assembly: ComVisible(false)]
[assembly: Guid("e4c26a22-8376-4ff3-aa7f-878ebd9f34b3")]

[assembly: AssemblyVersion("0.9.14.0")]
[assembly: AssemblyVersion("1.0.0.0")]
6 changes: 2 additions & 4 deletions src/SqlQueryStressCLI/sqlstresscmd.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
<PackageReadmeFile>readme.md</PackageReadmeFile>
<PackageVersion>0.9.20</PackageVersion>
<PackageReleaseNotes>Update M.D.S.</PackageReleaseNotes>
<TargetFramework>net6.0</TargetFramework>
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
<GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute>
<TargetFramework>net8.0</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 5dc35bc

Please sign in to comment.