From a43f6a94a46c9dcc329daba11df0a6c6b4af4c6a Mon Sep 17 00:00:00 2001 From: SimonGurney Date: Thu, 27 Jul 2023 14:24:43 +0100 Subject: [PATCH] Feat: dotnet 7 (#88) --- .github/workflows/build_preview.yml | 10 +++++----- .github/workflows/build_release.yml | 10 +++++----- Program.cs | 2 ++ SMBeagle.csproj | 17 +++++++++++++---- 4 files changed, 25 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build_preview.yml b/.github/workflows/build_preview.yml index c3fe4ae..840b88d 100644 --- a/.github/workflows/build_preview.yml +++ b/.github/workflows/build_preview.yml @@ -17,13 +17,13 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v1 with: - dotnet-version: 5.0.x + dotnet-version: 7.0.x - name: Restore dependencies run: dotnet restore - name: Build linux x64 - run: dotnet publish -c Release --self-contained -r linux-x64 -o packages/linux/amd64 -p:PublishSingleFile=true -p:PublishTrimmed=true -p:InvariantGlobalization=true -p:DebugType=None -p:DebugSymbols=false -p:VersionSuffix=pr$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }') + run: dotnet publish -c Release --self-contained -r linux-x64 -o packages/linux/amd64 -p:PublishSingleFile=true -p:PublishTrimmed=partial -p:InvariantGlobalization=true -p:DebugType=None -p:DebugSymbols=false -p:VersionSuffix=pr$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }') - name: Build linux arm - run: dotnet publish -c Release --self-contained -r linux-arm64 -o packages/linux/arm64 -p:PublishSingleFile=true -p:PublishTrimmed=true -p:InvariantGlobalization=true -p:DebugType=None -p:DebugSymbols=false -p:DebugSymbols=false -p:VersionSuffix=pr$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }') + run: dotnet publish -c Release --self-contained -r linux-arm64 -o packages/linux/arm64 -p:PublishSingleFile=true -p:PublishTrimmed=partial -p:InvariantGlobalization=true -p:DebugType=None -p:DebugSymbols=false -p:DebugSymbols=false -p:VersionSuffix=pr$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }') - name: Set up QEMU uses: docker/setup-qemu-action@v1 - name: Set up Docker Buildx @@ -63,12 +63,12 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v1 with: - dotnet-version: 5.0.x + dotnet-version: 7.0.x - name: Restore dependencies run: dotnet restore - name: Build windows x64 shell: bash - run: dotnet publish -c Release --self-contained -r win-x64 -o packages/windows/x64 -p:PublishSingleFile=true -p:PublishTrimmed=true -p:InvariantGlobalization=true -p:DebugType=None -p:DebugSymbols=false -p:VersionSuffix=pr$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }') + run: dotnet publish -c Release --self-contained -r win-x64 -o packages/windows/x64 -p:PublishSingleFile=true -p:PublishTrimmed=partial -p:InvariantGlobalization=true -p:DebugType=None -p:DebugSymbols=false -p:VersionSuffix=pr$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }') - name: Install signing tool run: dotnet tool install --global AzureSignTool --version 3.0.0 - name: Digitally sign executable diff --git a/.github/workflows/build_release.yml b/.github/workflows/build_release.yml index 35acec8..e59abaa 100644 --- a/.github/workflows/build_release.yml +++ b/.github/workflows/build_release.yml @@ -34,13 +34,13 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v1 with: - dotnet-version: 5.0.x + dotnet-version: 7.0.x - name: Restore dependencies run: dotnet restore - name: Build linux x64 - run: dotnet publish -c Release --self-contained -r linux-x64 -o packages/linux/amd64 -p:PublishSingleFile=true -p:PublishTrimmed=true -p:InvariantGlobalization=true -p:DebugType=None -p:DebugSymbols=false -p:Version=${{ needs.create-release.outputs.release_version }} + run: dotnet publish -c Release --self-contained -r linux-x64 -o packages/linux/amd64 -p:PublishSingleFile=true -p:PublishTrimmed=partial -p:InvariantGlobalization=true -p:DebugType=None -p:DebugSymbols=false -p:Version=${{ needs.create-release.outputs.release_version }} - name: Build linux arm - run: dotnet publish -c Release --self-contained -r linux-arm64 -o packages/linux/arm64 -p:PublishSingleFile=true -p:PublishTrimmed=true -p:InvariantGlobalization=true -p:DebugType=None -p:DebugSymbols=false -p:Version=${{ needs.create-release.outputs.release_version }} + run: dotnet publish -c Release --self-contained -r linux-arm64 -o packages/linux/arm64 -p:PublishSingleFile=true -p:PublishTrimmed=partial -p:InvariantGlobalization=true -p:DebugType=None -p:DebugSymbols=false -p:Version=${{ needs.create-release.outputs.release_version }} - name: Login to DockerHub uses: docker/login-action@v1 with: @@ -89,11 +89,11 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v1 with: - dotnet-version: 5.0.x + dotnet-version: 7.0.x - name: Restore dependencies run: dotnet restore - name: Build windows x64 - run: dotnet publish -c Release --self-contained -r win-x64 -o packages\windows\x64 -p:PublishSingleFile=true -p:PublishTrimmed=true -p:InvariantGlobalization=true -p:DebugType=None -p:DebugSymbols=false -p:Version=${{ needs.create-release.outputs.release_version }} + run: dotnet publish -c Release --self-contained -r win-x64 -o packages\windows\x64 -p:PublishSingleFile=true -p:PublishTrimmed=partial -p:InvariantGlobalization=true -p:DebugType=None -p:DebugSymbols=false -p:Version=${{ needs.create-release.outputs.release_version }} - name: Install signing tool run: dotnet tool install --global AzureSignTool --version 3.0.0 - name: Digitally sign executable diff --git a/Program.cs b/Program.cs index 442a687..d1139b0 100644 --- a/Program.cs +++ b/Program.cs @@ -10,11 +10,13 @@ using System.Linq; using System.Runtime.InteropServices; using System.Threading; +using System.Diagnostics.CodeAnalysis; namespace SMBeagle { class Program { + [DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(Options))] static void Main(string[] args) { var parser = new Parser(with => with.HelpWriter = null); diff --git a/SMBeagle.csproj b/SMBeagle.csproj index 1b6c1fb..faf8b7f 100644 --- a/SMBeagle.csproj +++ b/SMBeagle.csproj @@ -2,7 +2,7 @@ Exe - net5.0 + net7.0 2.2.1 @@ -10,6 +10,15 @@ 3 + + + + + + + + + @@ -17,9 +26,9 @@ - - - + + +