Skip to content

Commit

Permalink
#189 separate review instructions for log4net (#190)
Browse files Browse the repository at this point in the history
* #189 separate review instructions for log4net

* implemented release verification in powershell for windows #189

* added missing license header #189 

* #189 separate Vote result from announcement

* #189 Link to Github rc no longer needed
  • Loading branch information
FreeAndNil authored Sep 27, 2024
1 parent 8bf4313 commit 910e2c3
Show file tree
Hide file tree
Showing 9 changed files with 187 additions and 12 deletions.
Binary file modified doc/MailTemplate.Announce.txt
Binary file not shown.
Binary file modified doc/MailTemplate.Result.txt
Binary file not shown.
Binary file modified doc/MailTemplate.txt
Binary file not shown.
14 changes: 6 additions & 8 deletions doc/RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ release version 2.0.123:
- currently, this _must_ happen on a windows machine because of older
.net framework requirements which cannot be met on a Linux machine
(or at least, I haven't figured out how - in particular CF)
- TODO: the following are still manual and need to be built into the `release` script:
- log4net.build: update package.version property
- pom.xml: update version
4. Sign release artifacts (zips & nupkg) under `build/artifacts`
- eg `gpg --armor --output log4net-2.0.123.nupkg.asc --detach-sig log4net-2.0.123.nupkg`
- there is an accompanying `sign-log4net-libraries.sh/ps1` under scripts which you could invoke if you cd
Expand Down Expand Up @@ -58,12 +55,12 @@ release version 2.0.123:
- `svn co https://dist.apache.org/repos/dist/dev/logging -N apache-dist-logging-dev`
- `cd apache-dist-logging-dev`
- `svn up log4net`
- copy in source & binary artifacts to respective locations
- `svn delete *`
- `mkdir 2.0.123`
- copy all artifacts to the new folder
- `svn add *`
- `svn commit`
- check https://dist.apache.org/repos/dist/dev/logging/log4net/binaries/
and https://dist.apache.org/repos/dist/dev/logging/log4net/source/
- `svn commit -m 'log4net 2.0.123'`
- check https://dist.apache.org/repos/dist/dev/logging/log4net/2.0.123/
13. raise a vote on the log4net mailing list ([email protected]) - see MailTemplate.txt
14. wait
15. when the vote has 3 or more +1's, it's time to go live!
Expand All @@ -82,4 +79,5 @@ release version 2.0.123:
- `git pull --rebase`
- `git merge asf-staging`
18. rename the release at github, eg to `rel/2.0.123`
- double-check that the `rel` tag is created
- double-check that the `rel` tag is created
19. apply the next version by calling `./scripts/update-version.ps1 2.0.123 2.0.124`
59 changes: 59 additions & 0 deletions scripts/verify-release.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
Param (
[Parameter()]
[System.IO.DirectoryInfo]$Directory
)

Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
if (!$Directory)
{
$Directory = $PSScriptRoot
}

function Verify-Hash
{
param
(
[Parameter(Mandatory=$true, HelpMessage='The file containing the hash.')]
[System.IO.FileInfo]$File
)
$Line = @(Get-Content $File.FullName)[0]
$Fields = $Line -split '\s+'
$Hash = $Fields[0].Trim().ToUpper()
$Filename = $Fields[1].Trim()
if ($Filename.StartsWith("*"))
{
$Filename = $Filename.Substring(1).Trim()
}

$ComputedHash = (Get-FileHash -Algorithm 'SHA512' "$($File.DirectoryName)/$Filename").Hash.ToUpper()

if($Hash -eq $ComputedHash)
{
"$($Filename): Passed"
}
else
{
Write-Error "$($Filename): Not Passed" -ErrorAction Continue
Write-Error "Read from file: $Hash" -ErrorAction Continue
Write-Error "Computed: $ComputedHash" -ErrorAction Continue
}
}

foreach ($File in Get-ChildItem $Directory *.sha512)
{
Verify-Hash $File
}

Invoke-WebRequest https://downloads.apache.org/logging/KEYS -OutFile $Directory/KEYS
gpg --import -q $Directory/KEYS

foreach ($File in Get-ChildItem $Directory *.asc)
{
gpg --verify $File
}

Expand-Archive $Directory/*source*.zip -DestinationPath $Directory/src
$VersionDirectory = "$Directory/src/$(@(Get-ChildItem $Directory/src)[0])"
$VersionDirectory
pushd $VersionDirectory
18 changes: 18 additions & 0 deletions src/log4net/Core/Serializable.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
#region Apache License
//
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to you under the Apache License, Version 2.0
// (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#endregion
#if NET462_OR_GREATER
global using Log4NetSerializableAttribute = System.SerializableAttribute;
global using ILog4NetSerializable = System.Runtime.Serialization.ISerializable;
Expand Down
1 change: 1 addition & 0 deletions src/site/site.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<item name="Download" href="/release/download.html"/>
<item name="Support" href="https://logging.apache.org/support.html" />
<item name="Release Notes" href="/release/release-notes.html"/>
<item name="Release Review" href="/release/release-review-instructions.html"/>
<item name="License" href="/license.html"/>
</menu>

Expand Down
8 changes: 4 additions & 4 deletions src/site/xdoc/release/manual/installation.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
The ASF licenses this file to you under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
99 changes: 99 additions & 0 deletions src/site/xdoc/release/release-review-instructions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
<?xml version="1.0"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to you under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<document>
<properties>
<title>Apache log4net release verification</title>
</properties>

<body>
<section id ="release.verification" name="Release verification">
<p>
Releases of log4net can be verified with following steps:
</p>
<ul>
<li>
Windows (PowerShell)
<ol>
<li>
Prerequisites
<pre class="code">winget install -e --id GnuPG.Gpg4win
winget install -e --id TortoiseSVN.TortoiseSVN</pre>
</li>
<li>
Check out the release distribution
<pre class="code">svn co https://dist.apache.org/repos/dist/dev/logging/log4net/source/{releaseVersion} log4net-{releaseVersion}
pushd log4net-{releaseVersion}</pre>
</li>
<li>
Verify and extract
<pre class="code">&amp; ./verify-release.ps1</pre>
</li>
<li>
<p>Verify the build</p>
<pre class="code">winget install -e --id Mono.Mono
winget install Microsoft.DotNet.SDK.8
dotnet test ./src/log4net.sln</pre>
</li>
</ol>
</li>
<li>
Linux
<ol>
<li>
<p>Check out the release distribution</p>
<pre class="code">svn co https://dist.apache.org/repos/dist/dev/logging/log4net/{releaseVersion} log4net-{releaseVersion} &amp;&amp; cd $_</pre>
</li>
<li>
<p>Verify checksums</p>
<pre class="code">sha512sum --check *.sha512</pre>
</li>
<li>
<p>Import the release manager GPG keys, unless you haven’t earlier done so</p>
<pre class="code">wget -O - https://downloads.apache.org/logging/KEYS | gpg --import</pre>
</li>
<li>
<p>Verify signatures</p>
<pre class="code">for sigFile in *.asc; do gpg --verify $sigFile; done</pre>
</li>
<li>
<p>Extract sources</p>
<pre class="code">umask 0022
unzip -q *-src.zip -d src
cd src</pre>
</li>
<li>
<p>Verify the build</p>
<ul>
<li>install <a href="https://docs.docker.com/engine/install/">docker</a> (if you haven't already) </li>
<li>
<pre class="code">docker build -t log4net-builder .
docker run -it log4net-builder
# this will
# - install all dependencies in the container
# - build src/log4net.sln
# inside the container run
dotnet test /logging-log4net/src/log4net.sln</pre>
</li>
</ul>
</li>
</ol>
</li>
</ul>
</section>
</body>
</document>

0 comments on commit 910e2c3

Please sign in to comment.