Skip to content

Commit

Permalink
Sign assembly during packing step
Browse files Browse the repository at this point in the history
  • Loading branch information
george-chakhidze committed Jan 28, 2024
1 parent 9e3a2ee commit 7f147ce
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@ jobs:
[IO.File]::WriteAllBytes("$env:GITHUB_WORKSPACE\keypair.snk", $snk)
- name: Build
run: |
dotnet build "$(dir TBC.Common.Configuration.Registry.csproj -Recurse | select -first 1 -expand FullName)" -c Release --no-restore "-p:SourceRevisionId=$(git rev-parse --short $env:GITHUB_SHA)" -p:SignAssembly=True -p:DelaySign=False "-p:AssemblyOriginatorKeyFile=$env:GITHUB_WORKSPACE\keypair.snk"
dotnet build "$(dir TBC.Common.Configuration.Registry.Tests.csproj -Recurse | select -first 1 -expand FullName)" -c Release --no-restore -p:SignAssembly=True -p:DelaySign=False "-p:AssemblyOriginatorKeyFile=$env:GITHUB_WORKSPACE\keypair.snk"
del "$env:GITHUB_WORKSPACE\keypair.snk" -Force -Verbose
run: dotnet build -c Release --no-restore

- name: Test
run: |
Expand All @@ -57,5 +54,14 @@ jobs:
fail_ci_if_error: true
verbose: true

- name: Clean
run: dotnet clean

- name: Pack
run: |
$snk = "$env:GITHUB_WORKSPACE\keypair.snk"
dotnet pack "$(dir TBC.Common.Configuration.Registry.csproj -Recurse | select -first 1 -expand FullName)" -c Release "-p:SourceRevisionId=$(git rev-parse --short $env:GITHUB_SHA)" -p:SignAssembly=True -p:DelaySign=False "-p:AssemblyOriginatorKeyFile=$snk"
del $snk -Force -Verbose
- name: Push
run: dotnet nuget push "**\*.nupkg" -k "${{ secrets.NUGET_API_KEY }}" -s "https://api.nuget.org/v3/index.json" -n --skip-duplicate --force-english-output
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

Expand Down

0 comments on commit 7f147ce

Please sign in to comment.