Skip to content

Commit 8eddf0d

Browse files
authored
Merge pull request #20 from vcsjones/release-prop
0.4 Release Prep
2 parents 1b8a3b6 + c7d1d18 commit 8eddf0d

File tree

6 files changed

+103
-14
lines changed

6 files changed

+103
-14
lines changed

.github/workflows/pr.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,29 @@
11
name: Pull Request
22

3+
permissions:
4+
contents: read
5+
36
on:
47
pull_request:
58

69
jobs:
710
build:
811
runs-on: windows-latest
912
steps:
10-
- uses: actions/checkout@v1
13+
- uses: actions/checkout@v4
14+
name: Checkout
15+
- uses: actions/setup-dotnet@v4
16+
with:
17+
dotnet-version: '8.0'
18+
- run: dotnet test
19+
20+
dependency-review:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
1124
name: Checkout
12-
- uses: actions/setup-dotnet@v1
25+
- uses: actions/dependency-review-action@v4
26+
name: Dependency Review
1327
with:
14-
dotnet-version: '3.1.100'
15-
- run: dotnet test
28+
allow-licenses: MIT, Apache-2.0, BSD-2-Clause
29+
fail-on-scopes: development, runtime, unknown

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ bin/
22
obj/
33
.vs/
44
.vscode/
5+
out/

build/build.ps1

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# PowerShell < 7 does not handle ZIP files correctly.
2+
if ($PSVersionTable.PSVersion.Major -lt 7) {
3+
throw "This script requires PowerShell 7 or higher."
4+
}
5+
6+
$rootDir = $MyInvocation.MyCommand.Path
7+
8+
if (!$rootDir) {
9+
$rootDir = $psISE.CurrentFile.Fullpath
10+
}
11+
12+
if ($rootDir) {
13+
foreach($i in 1..2) {
14+
$rootDir = Split-Path $rootDir -Parent
15+
}
16+
}
17+
else {
18+
throw 'Could not determine root directory of project.'
19+
}
20+
21+
if (![bool](Get-Command -ErrorAction Stop -Type Application dotnet)) {
22+
throw 'dotnet SDK could not be found.'
23+
}
24+
25+
$winKitDir = Get-ItemPropertyValue 'HKLM:\SOFTWARE\Microsoft\Windows Kits\Installed Roots' 'KitsRoot10'
26+
27+
if (!$winKitDir -or !(Test-Path -Path $winKitDir)) {
28+
throw 'Windows SDK path is not found.'
29+
}
30+
31+
$sdkVersion = Get-ChildItem -Path 'HKLM:\SOFTWARE\Microsoft\Windows Kits\Installed Roots' | Sort-Object Name -Descending | Select-Object -ExpandProperty PSChildName -First 1
32+
$sdkPath = Join-Path -Path $winKitDir -ChildPath 'bin'
33+
$sdkPath = Join-Path -Path $sdkPath -ChildPath $sdkVersion
34+
35+
$architecture = [System.Environment]::GetEnvironmentVariable("PROCESSOR_ARCHITECTURE")
36+
$archDirName = switch ($architecture) {
37+
'ARM64' { 'arm64' }
38+
'x86' { 'x86' }
39+
'AMD64' { 'x64' }
40+
Default { throw 'Unknown architecture' }
41+
}
42+
43+
$sdkBinPath = Join-Path -Path $sdkPath -ChildPath $archDirName
44+
$objDir = Join-Path -Path $rootDir -ChildPath 'obj'
45+
$outDir = Join-Path -Path $rootDir -ChildPath 'out'
46+
47+
pushd $rootDir
48+
49+
Remove-Item -Path $objDir -Recurse -Force -ErrorAction SilentlyContinue
50+
New-Item -Path $objDir -ItemType Directory
51+
52+
Remove-Item -Path $outDir -Recurse -Force -ErrorAction SilentlyContinue
53+
New-Item -Path $outDir -ItemType Directory
54+
55+
dotnet pack -p:OutputFileNamesWithoutVersion=true -p:ContinuousIntegrationBuild=true -c Release -o $objDir src\AuthenticodeExaminer\AuthenticodeExaminer.csproj
56+
57+
Expand-Archive -Path $objDir\AuthenticodeExaminer.nupkg -DestinationPath $objDir\AuthenticodeExaminer.nupkg.dir
58+
59+
Remove-Item -Path $objDir\AuthenticodeExaminer.nupkg
60+
61+
& "$sdkBinPath\signtool.exe" sign /d "AuthenticodeExaminer" /sha1 73f0844a95e35441a676cd6be1e79a3cd51d00b4 /fd SHA384 /td SHA384 /tr "http://timestamp.digicert.com" /du "https://github.com/vcsjones/AuthenticodeExaminer" "$objDir\AuthenticodeExaminer.nupkg.dir\lib\netstandard2.0\AuthenticodeExaminer.dll"
62+
& "$sdkBinPath\signtool.exe" sign /d "AuthenticodeExaminer" /sha1 73f0844a95e35441a676cd6be1e79a3cd51d00b4 /fd SHA384 /td SHA384 /tr "http://timestamp.digicert.com" /du "https://github.com/vcsjones/AuthenticodeExaminer" "$objDir\AuthenticodeExaminer.nupkg.dir\lib\net462\AuthenticodeExaminer.dll"
63+
64+
Compress-Archive -Path "$objDir\AuthenticodeExaminer.nupkg.dir\*" -DestinationPath "$objDir\AuthenticodeExaminer.nupkg"
65+
66+
dotnet nuget sign --certificate-fingerprint 68821304869e065c24e0684eb43bf974e124642f3437f2ff494a93bb371d029a --hash-algorithm SHA384 --timestamper "http://timestamp.digicert.com" --overwrite "$objDir\AuthenticodeExaminer.nupkg"
67+
68+
Copy-Item -Path "$objDir\AuthenticodeExaminer.nupkg" -Destination "$outDir\AuthenticodeExaminer.nupkg"
69+
70+
popd

sample/sample.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
<Nullable>enable</Nullable>
77
</PropertyGroup>
88

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>netstandard2.0;net46;net461</TargetFrameworks>
3+
<TargetFrameworks>netstandard2.0;net462</TargetFrameworks>
44
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
55
<Authors>Kevin Jones</Authors>
66
<PackageTags>authenticode;codesign</PackageTags>
77
<PackageProjectUrl>https://github.com/vcsjones/AuthenticodeExaminer</PackageProjectUrl>
8-
<PackageVersion>0.3.0</PackageVersion>
8+
<Version>0.4.0</Version>
99
<PublishRepositoryUrl>true</PublishRepositoryUrl>
1010
<EmbedUntrackedSources>true</EmbedUntrackedSources>
1111
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
@@ -16,14 +16,14 @@
1616
</PropertyGroup>
1717

1818
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
19-
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="4.7.0" />
20-
<PackageReference Include="System.Security.Cryptography.Xml" Version="4.7.0" />
19+
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="8.0.1" />
20+
<PackageReference Include="System.Security.Cryptography.Xml" Version="8.0.1" />
2121
</ItemGroup>
2222
<ItemGroup Condition="$(TargetFramework.StartsWith('net4'))">
2323
<Reference Include="System.Security" />
2424
</ItemGroup>
2525
<ItemGroup>
26-
<PackageReference Include="System.Memory" Version="4.5.3" />
26+
<PackageReference Include="System.Memory" Version="4.6.0" />
2727
</ItemGroup>
2828

2929
</Project>

test/AuthenticodeExaminer.Tests/AuthenticodeExaminer.Tests.csproj

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netcoreapp3.1;net46</TargetFrameworks>
4+
<TargetFrameworks>net8.0;net472</TargetFrameworks>
55
<IsPackable>false</IsPackable>
6+
<OutputType>Exe</OutputType>
67
</PropertyGroup>
78

89
<ItemGroup>
9-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
10-
<PackageReference Include="xunit" Version="2.4.1" />
11-
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
10+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
11+
<PackageReference Include="xunit.v3" Version="2.0.0" />
12+
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.2">
13+
<PrivateAssets>all</PrivateAssets>
14+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
15+
</PackageReference>
1216
</ItemGroup>
1317
<ItemGroup>
1418
<ProjectReference Include="../../src/AuthenticodeExaminer/AuthenticodeExaminer.csproj" />

0 commit comments

Comments
 (0)