-
Notifications
You must be signed in to change notification settings - Fork 140
/
deploy.bat
28 lines (21 loc) · 1.38 KB
/
deploy.bat
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
REM Scripts to build .net driver and deploy
SET VERSION=%1
SET API_KEY=%2
SET SNKEY=%3
SET ROOT_DIR=%~dp0
cd %ROOT_DIR%
echo -----BEGIN CERTIFICATE----- > %WORKSPACE%\coded.txt
echo %SNKEY% >> %WORKSPACE%\coded.txt
echo -----END CERTIFICATE----- >> %WORKSPACE%\coded.txt
certutil -decode %WORKSPACE%\coded.txt %WORKSPACE%\key.snk
dotnet build Snowflake.Data\Snowflake.Data.csproj -c Release --force -v n /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=%WORKSPACE%\key.snk
"C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64"\sn.exe -v %WORKSPACE%"\Snowflake.Data\bin\Release\netstandard2.0\Snowflake.Data.dll"
dotnet pack Snowflake.Data\Snowflake.Data.csproj -c Release --force -v n --no-build --output %ROOT_DIR%
aws s3 cp s3://sfc-eng-jenkins/repository/net/sign-artifact.exe .
@For /F Delims^= %%G In ('""certutil.exe" -HashFile "sign-artifact.exe" SHA512|"find.exe" /V ":""')Do @Set "SHA=%%G"
if not %SHA%==94f0b4a78979ded42f7f8c8ce2534691f9f874888bcf7963876f5be881cf6d0ce00e6f8d3e656492249fcfcb890ad656745f2cf68f98e828eb02ded6189a87d4 (
echo "Failed to verify the sha for the signing script"
exit 1
)
sign-artifact.exe sign-artifact -o snowflakedb -r snowflake-connector-net -t v%VERSION% -l 20 -v -u -f Snowflake.Data.%VERSION%.nupkg
dotnet nuget push Snowflake.Data.%VERSION%.nupkg -k %API_KEY% -s https://api.nuget.org/v3/index.json