-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #156 from HicServices/develop
v2.2.2 - .Net 7, signed Windows exe again
- Loading branch information
Showing
9 changed files
with
100 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: "CodeQL" | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
schedule: | ||
- cron: "41 22 * * 2" | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: [ csharp ] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v2 | ||
with: | ||
languages: ${{ matrix.language }} | ||
queries: +security-and-quality | ||
|
||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@v2 | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v2 | ||
with: | ||
category: "/language:${{ matrix.language }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,11 @@ jobs: | |
build: | ||
runs-on: windows-latest | ||
steps: | ||
- id: signtool | ||
name: Find signtool.exe | ||
shell: cmd | ||
run: where /f /r "%programfiles(x86)%\windows kits\10\bin" signtool.exe|for /f "delims=" %%s in ('find "\x64\"') do @echo signtool=%%s > %GITHUB_OUTPUT% | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
|
@@ -15,49 +20,38 @@ jobs: | |
- name: Install .NET Core | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: 6.0.x | ||
- uses: actions/cache@v3 | ||
with: | ||
path: ~/.nuget/packages | ||
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} | ||
restore-keys: | | ||
${{ runner.os }}-nuget- | ||
dotnet-version: 7.0.x | ||
|
||
- name: Build the application | ||
run: dotnet build -c Release --verbosity quiet | ||
- name: Build and test the application | ||
shell: cmd | ||
run: | | ||
dotnet test --nologo --verbosity minimal --collect:"XPlat Code Coverage" --settings coverlet.runsettings -c Release --results-directory coverage | ||
for /r coverage %%f in (coverage.*) do @move %%f lcov.info | ||
- name : coverlet | ||
uses: b3b00/[email protected] | ||
with: | ||
testProject: 'Tests/Tests.csproj' | ||
output: 'lcov.info' | ||
outputFormat: 'lcov' | ||
excludes: '[test]test.*' | ||
- name: Upload coverage report | ||
uses: coverallsapp/[email protected] | ||
with: | ||
github-token: ${{secrets.GITHUB_TOKEN }} | ||
path-to-lcov: Tests/lcov.info | ||
|
||
# Decode the base 64 encoded pfx and save the Signing_Certificate | ||
- name: Decode the pfx | ||
run: | | ||
$pfx_cert_byte = [System.Convert]::FromBase64String("${{ secrets.DIGICERT_PFX }}") | ||
$certificatePath = Join-Path -Path . -ChildPath GitHubActionsWorkflow.pfx | ||
[IO.File]::WriteAllBytes("$certificatePath", $pfx_cert_byte) | ||
path-to-lcov: lcov.info | ||
|
||
- name: Publish | ||
run: | | ||
dotnet publish RepopulatorCli/RepopulatorCli.csproj -o RepopulatorCli-win-x64 -c Release -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:PublishTrimmed=false --self-contained true -r win-x64 | ||
dotnet publish RepopulatorCli/RepopulatorCli.csproj -o RepopulatorCli-lin-x64 -c Release -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:PublishTrimmed=false --self-contained true -r linux-x64 | ||
dotnet publish TemplateBuilder/TemplateBuilder.csproj -o template-builder -c Release -p:PublishSingleFile=true --self-contained true -r win-x64 | ||
- name: Sign | ||
# Decode the base 64 encoded pfx and save the Signing_Certificate | ||
- name: Decode the pfx | ||
run: '[IO.File]::WriteAllBytes((Join-Path -Path . -ChildPath GitHubActionsWorkflow.pfx), [System.Convert]::FromBase64String("${{ secrets.DIGICERT_PFX }}"))' | ||
- name: Sign, delete signing key and compress results | ||
shell: cmd | ||
run: | | ||
"C:\Program Files (x86)\Windows Kits\10\bin\x86\signtool.exe" Sign /f GitHubActionsWorkflow.pfx /p ${{ secrets.DIGICERT_PASSWORD }} /fd sha256 /tr http://timestamp.digicert.com /td sha256 RepopulatorCli-win-x64/RepopulatorCli.exe template-builder/TemplateBuilder.exe template-builder/TypeGuesser.dll template-builder/Repopulator.dll template-builder/Fansi*.dll template-builder/BadMedicine*.dll template-builder/DicomTypeTranslation.dll | ||
md dist | ||
powershell.exe -nologo -noprofile -command "& { Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::CreateFromDirectory('RepopulatorCli-win-x64', 'dist/RepopulatorCli-win-x64.zip'); [IO.Compression.ZipFile]::CreateFromDirectory('RepopulatorCli-lin-x64', 'dist/RepopulatorCli-lin-x64.zip'); [IO.Compression.ZipFile]::CreateFromDirectory('template-builder', 'dist/template-builder.zip'); }" | ||
${{steps.signtool.outputs.signtool}} Sign /f GitHubActionsWorkflow.pfx /p ${{ secrets.DIGICERT_PASSWORD }} /fd sha256 /tr http://timestamp.digicert.com /td sha256 RepopulatorCli-win-x64/RepopulatorCli.exe template-builder/TemplateBuilder.exe | ||
del GitHubActionsWorkflow.pfx | ||
mkdir -p dist | ||
7z a -bd -mx=9 -mmt dist/RepopulatorCli-win-x64.zip RepopulatorCli-win-x64 | ||
7z a -bd -mx=9 -mmt dist/RepopulatorCli-lin-x64.zip RepopulatorCli-lin-x64 | ||
7z a -bd -mx=9 -mmt dist/template-builder.zip template-builder | ||
- name: Archive production artifacts | ||
uses: actions/upload-artifact@v3 | ||
|
@@ -67,8 +61,6 @@ jobs: | |
dist | ||
# Remove the pfx | ||
- name: Remove the pfx | ||
run: Remove-Item -path GitHubActionsWorkflow.pfx | ||
- name: Upload binaries to release | ||
uses: svenstaro/upload-release-action@v2 | ||
if: contains(github.ref, 'refs/tags/v') | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<RunSettings> | ||
<DataCollectionRunSettings> | ||
<DataCollectors> | ||
<DataCollector friendlyName="XPlat code coverage"> | ||
<Configuration> | ||
<Format>lcov</Format> | ||
<ExcludeByAttribute>Obsolete,GeneratedCodeAttribute,CompilerGeneratedAttribute</ExcludeByAttribute> | ||
<SingleHit>false</SingleHit> | ||
<UseSourceLink>true</UseSourceLink> | ||
<IncludeTestAssembly>false</IncludeTestAssembly> | ||
<SkipAutoProps>true</SkipAutoProps> | ||
<DeterministicReport>false</DeterministicReport> | ||
<ExcludeAssembliesWithoutSources>MissingAll</ExcludeAssembliesWithoutSources> | ||
</Configuration> | ||
</DataCollector> | ||
</DataCollectors> | ||
</DataCollectionRunSettings> | ||
</RunSettings> |