-
Notifications
You must be signed in to change notification settings - Fork 2
71 lines (61 loc) · 3.07 KB
/
dotnet-desktop.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: .NET Core Desktop
on: push
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@v4
with:
fetch-depth: 0
# Install the .NET Core workload
- name: Install .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.0.x
- 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.bad
perl lcov-fix.pl < lcov.bad > lcov.info
- name: Upload coverage report
uses: coverallsapp/[email protected]
with:
github-token: ${{secrets.GITHUB_TOKEN }}
path-to-lcov: lcov.info
- name: Publish
run: |
dotnet publish RepopulatorCli/RepopulatorCli.csproj -o RepopulatorCli-win-x64 -c Release -p:PublishReadyToRun=true -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=true -p:PublishSingleFile=true -p:PublishTrimmed=false --self-contained true -r linux-x64
dotnet publish TemplateBuilder/TemplateBuilder.csproj -o template-builder -c Release -p:PublishReadyToRun=true -p:PublishSingleFile=true --self-contained true -r win-x64
- name: Sign & compress results
shell: bash
run: |
dotnet tool install --global AzureSignTool
AzureSignTool sign -kvu "${{ secrets.AZURE_KEY_VAULT_URI }}" -kvi "${{ secrets.AZURE_CLIENT_ID }}" -kvt "${{ secrets.AZURE_TENANT_ID }}" -kvs "${{ secrets.AZURE_CLIENT_SECRET }}" -kvc ${{ secrets.AZURE_CERT_NAME }} -tr http://timestamp.digicert.com -v RepopulatorCli-win-x64/RepopulatorCli.exe
AzureSignTool sign -kvu "${{ secrets.AZURE_KEY_VAULT_URI }}" -kvi "${{ secrets.AZURE_CLIENT_ID }}" -kvt "${{ secrets.AZURE_TENANT_ID }}" -kvs "${{ secrets.AZURE_CLIENT_SECRET }}" -kvc ${{ secrets.AZURE_CERT_NAME }} -tr http://timestamp.digicert.com -v template-builder/TemplateBuilder.exe
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@v4
with:
name: dist
path: |
dist
# Remove the pfx
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
if: contains(github.ref, 'refs/tags/v')
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/*.zip
tag: ${{ github.ref }}
overwrite: true
file_glob: true