|
1 | 1 | param(
|
2 |
| - $Version = '3.1.0' |
| 2 | + $Version = '3.2.0' |
3 | 3 | )
|
4 |
| -"cleaning $PSScriptRoot/../build/ ..." |
5 |
| -rm -rf $PSScriptRoot/../build/* |
| 4 | + |
| 5 | +Set-StrictMode -Version Latest |
| 6 | +$ErrorActionPreference = 'Stop' |
| 7 | + |
| 8 | +function Write-HashAndSignature |
| 9 | +{ |
| 10 | + param |
| 11 | + ( |
| 12 | + [Parameter(Mandatory=$true, HelpMessage='The file to hash.')] |
| 13 | + [System.IO.FileInfo]$File |
| 14 | + ) |
| 15 | + $File.FullName |
| 16 | + $ComputedHash = (Get-FileHash -Algorithm 'SHA512' $File).Hash.ToLowerInvariant() |
| 17 | + $ComputedHash |
| 18 | + Set-Content -Path "$($File.FullName).sha512" -Value "$ComputedHash *./$($File.Name)" |
| 19 | + gpg --armor --output "$($File.FullName).asc" --detach-sig $File.FullName |
| 20 | +} |
| 21 | + |
| 22 | +"cleaning $PSScriptRoot/../build/ ..." |
| 23 | +Remove-Item $PSScriptRoot/../build/ -Force -Recurse -ErrorAction SilentlyContinue |
6 | 24 | 'building ...'
|
7 | 25 | dotnet test -c Release "-p:GeneratePackages=true;PackageVersion=$Version" $PSScriptRoot/../src/log4net/log4net.csproj
|
8 | 26 | 'compressing source ...'
|
9 | 27 | pushd $PSScriptRoot/..
|
10 | 28 | git archive --format=zip --output $PSScriptRoot/../build/artifacts/apache-log4net-source-$Version.zip master
|
11 | 29 | popd
|
12 | 30 | 'compressing binaries ...'
|
13 |
| -cp $PSScriptRoot/verify-release.* $PSScriptRoot/../build/artifacts/ |
14 |
| -cp $PSScriptRoot/../LICENSE $PSScriptRoot/../build/Release/ |
15 |
| -cp $PSScriptRoot/../NOTICE $PSScriptRoot/../build/Release/ |
| 31 | +Copy-Item $PSScriptRoot/verify-release.* $PSScriptRoot/../build/artifacts/ |
| 32 | +Copy-Item $PSScriptRoot/../LICENSE $PSScriptRoot/../build/Release/ |
| 33 | +Copy-Item $PSScriptRoot/../NOTICE $PSScriptRoot/../build/Release/ |
16 | 34 | pushd $PSScriptRoot/../build/Release
|
17 | 35 | zip -r $PSScriptRoot/../build/artifacts/apache-log4net-binaries-$Version.zip .
|
18 | 36 | popd
|
19 | 37 | 'signing ...'
|
20 |
| -mv $PSScriptRoot/../build/artifacts/log4net.$Version.nupkg $PSScriptRoot/../build/artifacts/apache-log4net.$Version.nupkg |
21 |
| -pushd $PSScriptRoot/../build/artifacts |
22 |
| -gpg --armor --output ./apache-log4net.$Version.nupkg.asc --detach-sig ./apache-log4net.$Version.nupkg |
23 |
| -sha512sum -b ./apache-log4net.$Version.nupkg > ./apache-log4net.$Version.nupkg.sha512 |
24 |
| -gpg --armor --output ./apache-log4net-source-$Version.zip.asc --detach-sig ./apache-log4net-source-$Version.zip |
25 |
| -sha512sum -b ./apache-log4net-source-$Version.zip > ./apache-log4net-source-$Version.zip.sha512 |
26 |
| -gpg --armor --output ./apache-log4net-binaries-$Version.zip.asc --detach-sig ./apache-log4net-binaries-$Version.zip |
27 |
| -sha512sum -b ./apache-log4net-binaries-$Version.zip > ./apache-log4net-binaries-$Version.zip.sha512 |
28 |
| -gpg --armor --output ./verify-release.ps1.asc --detach-sig ./verify-release.ps1 |
29 |
| -sha512sum -b ./verify-release.ps1 > ./verify-release.ps1.sha512 |
30 |
| -gpg --armor --output ./verify-release.ps1.asc --detach-sig ./verify-release.sh |
31 |
| -sha512sum -b ./verify-release.ps1 > ./verify-release.sh.sha512 |
32 |
| -popd |
| 38 | +Move-Item $PSScriptRoot/../build/artifacts/log4net.$Version.nupkg $PSScriptRoot/../build/artifacts/apache-log4net.$Version.nupkg |
| 39 | +Write-HashAndSignature $PSScriptRoot/../build/artifacts/apache-log4net.$Version.nupkg |
| 40 | +Write-HashAndSignature $PSScriptRoot/../build/artifacts/apache-log4net-source-$Version.zip |
| 41 | +Write-HashAndSignature $PSScriptRoot/../build/artifacts/apache-log4net-binaries-$Version.zip |
| 42 | +Write-HashAndSignature $PSScriptRoot/../build/artifacts/verify-release.ps1 |
| 43 | +Write-HashAndSignature $PSScriptRoot/../build/artifacts/verify-release.sh |
33 | 44 | 'cleaning site ...'
|
34 |
| -rm -rf $PSScriptRoot/../target/* |
| 45 | +Remove-Item $PSScriptRoot/../target/ -Force -Recurse -ErrorAction SilentlyContinue |
35 | 46 | 'building site ...'
|
36 | 47 | pushd $PSScriptRoot/..
|
37 | 48 | ./mvnw site
|
|
0 commit comments