1
1
name : Build Keeper SDK for .NET
2
2
3
3
on :
4
- # push:
5
- # branches:
6
- # - 'release_*'
7
4
workflow_dispatch :
8
5
inputs :
9
- sqlite_storage :
10
- description : Build SQLite Vault storage
11
- type : boolean
12
- required : false
13
- default : false
14
6
cli :
15
7
description : Build CLI package
16
8
type : boolean
43
35
- uses : actions/setup-dotnet@v4
44
36
with :
45
37
dotnet-version : ' 8.0.x'
46
- - uses : microsoft/setup-msbuild@v2
47
-
48
- - uses : nuget/setup-nuget@v2
49
- - run : nuget restore KeeperSdk.sln
50
-
51
-
38
+
52
39
- name : Load signing certificate
53
40
run : |
54
41
if (Test-Path -Path certificate.txt) { Remove-Item certificate.txt }
@@ -58,25 +45,21 @@ jobs:
58
45
Remove-Item certificate.txt
59
46
shell : powershell
60
47
48
+ - name : Restore solution
49
+ run : |
50
+ dotnet restore KeeperSdk.sln
51
+ shell : powershell
52
+
61
53
- name : Build Keeper SDK Nuget package
62
54
working-directory : ./KeeperSdk
63
55
run : |
64
56
if (Test-Path bin) { Remove-Item -Force -Recurse bin }
65
57
dotnet build /P:Configuration=Release /P:Version=${Env:PACKAGE_VERSION} /P:AssemblyVersion=${Env:BUILD_VERSION} /P:FileVersion=${Env:BUILD_VERSION}
66
- & 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe' sign /f ..\certificate.pfx /t "http://timestamp.digicert.com" /v /p "${{ secrets.PFX_PASS }}" /d ".NET Keeper SDK" "bin\Release\net452\KeeperSdk.dll"
67
58
& 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe' sign /f ..\certificate.pfx /t "http://timestamp.digicert.com" /v /p "${{ secrets.PFX_PASS }}" /d ".NET Keeper SDK" "bin\Release\netstandard2.0\KeeperSdk.dll"
59
+ & 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe' sign /f ..\certificate.pfx /t "http://timestamp.digicert.com" /v /p "${{ secrets.PFX_PASS }}" /d ".NET Keeper SDK" "bin\Release\net8.0\KeeperSdk.dll"
68
60
dotnet pack --no-build --no-restore --no-dependencies /P:Configuration=Release /P:Version=${Env:PACKAGE_VERSION} /P:IncludeSymbols=true /P:SymbolPackageFormat=snupkg
69
61
shell : powershell
70
62
71
- - name : Build SQLite Vault Storage
72
- working-directory : ./OfflineStorageSqlite
73
- run : |
74
- if (Test-Path bin) { Remove-Item -Force -Recurse bin }
75
- dotnet build --configuration=Release --no-dependencies
76
- & 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe' sign /f ..\certificate.pfx /t "http://timestamp.digicert.com" /v /p "${{ secrets.PFX_PASS }}" /d ".NET Keeper SDK Offline SQLite Storage" "bin\Release\\netstandard2.0\OfflineStorageSqlite.dll"
77
- dotnet pack --no-build --no-restore --configuration=Release /P:IncludeSymbols=true /P:SymbolPackageFormat=snupkg
78
- shell : powershell
79
-
80
63
- name : Build CLI library
81
64
working-directory : ./Cli
82
65
run : |
@@ -91,17 +74,29 @@ jobs:
91
74
working-directory : ./Commander
92
75
run : |
93
76
if (Test-Path bin) { Remove-Item -Force -Recurse bin }
94
- msbuild /T:Restore /P:Configuration =Release
95
- msbuild /T:Build /P:Configuration=Release /p:BuildProjectReferences=false
96
- & 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe' sign /f ..\certificate.pfx /t "http://timestamp.digicert.com" /v /p "${{ secrets.PFX_PASS }}" /d ".NET Keeper SDK" "bin\Release\Commander.exe "
77
+ dotnet build --configuration =Release --no-dependencies
78
+ & 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe' sign /f ..\certificate.pfx /t "http://timestamp.digicert.com" /v /p "${{ secrets.PFX_PASS }}" /d ".NET Keeper SDK" "bin\Release\net472\Commander.exe"
79
+ & 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe' sign /f ..\certificate.pfx /t "http://timestamp.digicert.com" /v /p "${{ secrets.PFX_PASS }}" /d ".NET Keeper SDK" "bin\Release\net8.0\ Commander.dll "
97
80
shell : powershell
98
81
99
- - name : Zip Commander
82
+ - name : Zip .Net Framework Commander
83
+ working-directory : " ./Commander/bin/Release/net472"
100
84
run : |
101
85
$params = @{
102
- Path = "Commander/bin/Release/ *.exe", "Commander/bin/Release/Commander .exe.config", "Commander/bin/Release/ *.dll", "OfflineStorageSqlite/bin/Release/netstandard2.0/OfflineStorageSqlite.dll "
86
+ Path = "*.exe", "Commander.exe.config", "*.dll", "x64/", "x86/ "
103
87
CompressionLevel = "Fastest"
104
- DestinationPath = "Commander-${Env:PACKAGE_VERSION}.zip"
88
+ DestinationPath = "Commander-win-${Env:PACKAGE_VERSION}.zip"
89
+ }
90
+ Compress-Archive @params
91
+ shell : powershell
92
+
93
+ - name : Zip .Net 8.0 Commander
94
+ working-directory : " ./Commander/bin/Release/net8.0"
95
+ run : |
96
+ $params = @{
97
+ Path = "*.dll", "Commander.dll.config", "Commander.deps.json", "runtimes/", "Commander.runtimeconfig.json"
98
+ CompressionLevel = "Fastest"
99
+ DestinationPath = "Commander-net-${Env:PACKAGE_VERSION}.zip"
105
100
}
106
101
Compress-Archive @params
107
102
shell : powershell
@@ -118,18 +113,15 @@ jobs:
118
113
- name : Store Commander artifacts
119
114
uses : actions/upload-artifact@v4
120
115
with :
121
- name : Commander-${{ env.PACKAGE_VERSION }}
122
- path : Commander-${{ env.PACKAGE_VERSION }}.zip
116
+ name : Commander-win- ${{ env.PACKAGE_VERSION }}
117
+ path : Commander/bin/Release/net472/Commander-win -${{ env.PACKAGE_VERSION }}.zip
123
118
retention-days : 1
124
119
125
- - name : Store SQLite Offline Storage artifacts
126
- if : ${{ inputs.sqlite_storage }}
120
+ - name : Store Commander artifacts
127
121
uses : actions/upload-artifact@v4
128
122
with :
129
- name : OfflineStorageSqlite
130
- path : |
131
- OfflineStorageSqlite/bin/Release/Keeper.Storage.Sqlite.*.nupkg
132
- OfflineStorageSqlite/bin/Release/Keeper.Storage.Sqlite.*.snupkg
123
+ name : Commander-net-${{ env.PACKAGE_VERSION }}
124
+ path : Commander/bin/Release/net6.0/Commander-net-${{ env.PACKAGE_VERSION }}.zip
133
125
retention-days : 1
134
126
135
127
- name : Store artifacts
0 commit comments