Skip to content

Commit

Permalink
Merge pull request #181 from apache/Feature/181-automate-version-bumps
Browse files Browse the repository at this point in the history
automate version bumps
  • Loading branch information
FreeAndNil committed Sep 16, 2024
2 parents 56edca6 + 24dee13 commit fd4703e
Show file tree
Hide file tree
Showing 9 changed files with 382 additions and 344 deletions.
13 changes: 13 additions & 0 deletions doc/MailTemplate.Announce.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
To: announce@apache.org, dev@logging.apache.org
Subject: [ANNOUNCE] Apache log4net 3.1.0 released

Hi,

the Apache log4net team is pleased to announce the 3.1.0 release.
For further information (support, download, etc.) see
- https://logging.apache.org/log4net/release/release-notes.html
- https://github.com/apache/logging-log4net/releases/tag/rel%2F3.1.0
- https://www.nuget.org/packages/log4net/3.1.0

== Release Notes

10 changes: 5 additions & 5 deletions doc/MailTemplate.Result.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
To: dev@logging.apache.org
Subject: [RESULT][VOTE] Release Apache Log4net 3.0.0
Subject: [RESULT][VOTE] Release Apache Log4net 3.1.0

Hi,

with +3 binding votes (Davyd, Volkan and myself), apache log4net 3.0.0 is released and available:
https://github.com/apache/logging-log4net/releases/tag/rel%2F3.0.0
with +3 binding votes (Davyd, Volkan and myself), apache log4net 3.1.0 is released and available:
https://github.com/apache/logging-log4net/releases/tag/rel%2F3.1.0

Source snapshot at:
https://downloads.apache.org/logging/log4net/source/apache-log4net-source-3.0.0.zip
https://downloads.apache.org/logging/log4net/source/apache-log4net-source-3.1.0.zip

Thanks

---------------------------------------------------------------------------------------------------
This is a vote to release the Apache Log4net 3.0.0.
This is a vote to release the Apache Log4net 3.1.0.

...
6 changes: 3 additions & 3 deletions doc/MailTemplate.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
To: dev@logging.apache.org
Subject: [VOTE] Release Apache Log4net 3.0.0
Subject: [VOTE] Release Apache Log4net 3.1.0

This is a vote to release the Apache Log4net 3.0.0.
This is a vote to release the Apache Log4net 3.1.0.

Website: https://logging.staged.apache.org/log4net/release/release-notes.html
GitHub: https://github.com/apache/logging-log4net
GitHub release (pre-release): https://github.com/apache/logging-log4net/releases/tag/rc/3.0.0-rc1
GitHub release (pre-release): https://github.com/apache/logging-log4net/releases/tag/rc/3.1.0-rc1
Commit: <todo insert>
Distribution: https://dist.apache.org/repos/dist/dev/logging/log4net
Signing key: 0x7D24496A230E29D6349A99EF583E491578F02D5D
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "log4net",
"version": "3.0.0",
"version": "3.1.0",
"description": "Log4Net is a logging framework for .NET",
"scripts": {
"test": "run-s clean-build test-dotnet run-dotnet-core-tests",
Expand Down
15 changes: 5 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<groupId>log4net</groupId>
<artifactId>apache-log4net</artifactId>
<packaging>pom</packaging>
<version>3.0.0</version>
<version>3.1.0</version>
<name>Apache log4net</name>
<description>Logging framework for Microsoft .NET Framework.</description>
<url>http://logging.apache.org/log4net/</url>
Expand Down Expand Up @@ -72,7 +72,6 @@
</plugin>
</plugins>
</build>

<reporting>
<plugins>
<plugin>
Expand All @@ -89,7 +88,7 @@
<artifactId>apache-rat-plugin</artifactId>
<version>0.12</version>
<configuration>
<excludesFile>${basedir}/rat.excludesFile</excludesFile>
<excludesFile>${basedir}/rat.excludesFile</excludesFile>
</configuration>
</plugin>
<plugin>
Expand All @@ -99,7 +98,7 @@
<reportSets>
<reportSet>
<reports>
<report>cim</report>
<report>cim</report>
<report>scm</report>
<report>license</report>
<report>project-team</report>
Expand All @@ -109,7 +108,6 @@
</plugin>
</plugins>
</reporting>

<developers>
<developer>
<name>Davyd McColl</name>
Expand Down Expand Up @@ -148,7 +146,6 @@
<id>dpsenner</id>
</developer>
</developers>

<contributors>
<contributor>
<name>Erik Mavrinac</name>
Expand Down Expand Up @@ -187,14 +184,12 @@
<name>Jarrod Alexander</name>
</contributor>
</contributors>

<dependencies>
</dependencies>

<distributionManagement>
<site>
<id>logging.site</id>
<url>file:///${user.dir}/target/site-deploy</url>
</site>
</distributionManagement>
</project>
</distributionManagement>
</project>
78 changes: 78 additions & 0 deletions scripts/update-version.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
Param (
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[string]$OldVersion,
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[string]$NewVersion
)

Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'

function Update-XmlVersion([System.IO.FileInfo]$XmlFile, [string]$Version, [string]$NodePath)
{
[Xml]$XmlContent = Get-Content $XmlFile
$Node = $XmlContent.SelectSingleNode($NodePath)
$Node.InnerText = $Version
"$($Node.OuterXml)"
$XmlContent.Save($XmlFile)
}

function Update-JsonVersion([System.IO.FileInfo]$JsonFile, [string]$Version)
{
$JsonContent = Get-Content $JsonFile | ConvertFrom-Json
$JsonContent.version = $Version
"$($JsonFile): $($JsonContent.version)"
$JsonContent | ConvertTo-Json | Out-File $JsonFile
}

function Update-TextVersion([System.IO.FileInfo]$TextFile, [string]$OldVersion, [string]$NewVersion)
{
$OldContent = Get-Content $TextFile | Out-String
$NewContent = $OldContent.Replace($OldVersion, $NewVersion)
"$($TextFile): $NewVersion"
$NewContent | Out-File $TextFile
}

function Update-ReleaseNotes([System.IO.FileInfo]$XmlFile, [string]$Content, [string]$Version)
{
[Xml]$XmlContent = Get-Content $XmlFile
$NewChild = New-Object System.Xml.XmlDocument
$NewChild.LoadXml($Content.Replace('%Version%', $Version))
$Node = $XmlContent.SelectSingleNode('/document/body/section')
$Node.PrependChild($XmlContent.ImportNode($NewChild.DocumentElement, $true))
"$($XmlFile): $NewVersion"
$XmlContent.Save($XmlFile)
}

Update-XmlVersion $PSScriptRoot/../pom.xml $NewVersion '/*[local-name()="project"]/*[local-name()="version"]'
Update-JsonVersion $PSScriptRoot/../package.json $NewVersion
Update-TextVersion $PSScriptRoot/../doc/MailTemplate.txt $OldVersion $NewVersion
Update-TextVersion $PSScriptRoot/../doc/MailTemplate.Result.txt $OldVersion $NewVersion
Update-TextVersion $PSScriptRoot/../doc/MailTemplate.Announce.txt $OldVersion $NewVersion
Update-XmlVersion $PSScriptRoot/../src/log4net/log4net.csproj $NewVersion '/Project/PropertyGroup/Version'

$ReleaseNoteSection = '
<section id="a%Version%" name="%Version%">
<section id="a%Version%-breaking" name="Breaking Changes">
</section>
<br/>
Apache log4net %Version% addresses reported issues:
<section id="a%Version%-bug" name="Bug fixes">
<ul>
<li>
<a href="https://github.com/apache/logging-log4net/issues/tbd">tbd</a> (by tbd)
</li>
</ul>
</section>
<section id="a%Version%-enhancements" name="Enhancements">
<ul>
<li>
<a href="https://github.com/apache/logging-log4net/issues/tbd">tbd</a> (by tbd)
</li>
</ul>
</section>
</section>'

Update-ReleaseNotes $PSScriptRoot/../src/site/xdoc/release/release-notes.xml $ReleaseNoteSection $NewVersion
9 changes: 1 addition & 8 deletions src/log4net.sln
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".doc", ".doc", "{33D80AD3-8
..\doc\BUILDING.md = ..\doc\BUILDING.md
site\xdoc\release\config-examples.xml = site\xdoc\release\config-examples.xml
site\xdoc\download_log4net.xml = site\xdoc\download_log4net.xml
..\doc\MailTemplate.Announce.txt = ..\doc\MailTemplate.Announce.txt
..\doc\MailTemplate.Result.txt = ..\doc\MailTemplate.Result.txt
..\doc\MailTemplate.txt = ..\doc\MailTemplate.txt
site\xdoc\release\release-notes.xml = site\xdoc\release\release-notes.xml
..\doc\RELEASING.md = ..\doc\RELEASING.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".scripts", ".scripts", "{050E0D0D-D916-42FD-AE58-32965336D357}"
ProjectSection(SolutionItems) = preProject
..\scripts\build-preview.ps1 = ..\scripts\build-preview.ps1
..\scripts\install-dotnet-sdk.ps1 = ..\scripts\install-dotnet-sdk.ps1
..\scripts\sign-log4net-libraries.ps1 = ..\scripts\sign-log4net-libraries.ps1
..\scripts\sign-log4net-libraries.sh = ..\scripts\sign-log4net-libraries.sh
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down
11 changes: 6 additions & 5 deletions src/log4net/log4net.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Version>3.0.0</Version>
<Version>3.1.0</Version>
<PackageId>log4net</PackageId>
<Product>Apache log4net</Product>
<Title>$(Product)</Title>
Expand Down Expand Up @@ -55,7 +55,8 @@ log4net is designed with two distinct goals in mind: speed and flexibility
<AssemblyCopyright>$(Copyright)</AssemblyCopyright>
<AssemblyTrademark>Apache and Apache log4net are trademarks of The Apache Software Foundation</AssemblyTrademark>
<AssemblyDefaultAlias>$(AssemblyName)</AssemblyDefaultAlias>
<AssemblyCulture></AssemblyCulture>
<AssemblyCulture>
</AssemblyCulture>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)'=='net462'">
<AssemblyTitle>$(AssemblyTitle) Framework 4.6.2</AssemblyTitle>
Expand Down Expand Up @@ -114,15 +115,15 @@ log4net is designed with two distinct goals in mind: speed and flexibility
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All"/>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
</ItemGroup>
<Import Project="../MonoForFramework.targets" />
<Target Name="_ResolveCopyLocalNuGetPackagePdbsAndXml" Condition="$(CopyLocalLockFileAssemblies) == true" AfterTargets="ResolveReferences">
<!-- "Workaround" for missing '.pdb'-Files from NuGet Packages -->
<!-- https://github.com/dotnet/sdk/issues/1458#issuecomment-420456386 -->
<ItemGroup>
<ReferenceCopyLocalPaths Include="@(ReferenceCopyLocalPaths->'%(RootDir)%(Directory)%(Filename).pdb')" Condition="'%(ReferenceCopyLocalPaths.NuGetPackageId)' != '' and Exists('%(RootDir)%(Directory)%(Filename).pdb')" />
<ReferenceCopyLocalPaths Include="@(ReferenceCopyLocalPaths->'%(RootDir)%(Directory)%(Filename).xml')" Condition="'%(ReferenceCopyLocalPaths.NuGetPackageId)' != '' and Exists('%(RootDir)%(Directory)%(Filename).xml')" />
<ReferenceCopyLocalPaths Include="@(ReferenceCopyLocalPaths-&gt;'%(RootDir)%(Directory)%(Filename).pdb')" Condition="'%(ReferenceCopyLocalPaths.NuGetPackageId)' != '' and Exists('%(RootDir)%(Directory)%(Filename).pdb')" />
<ReferenceCopyLocalPaths Include="@(ReferenceCopyLocalPaths-&gt;'%(RootDir)%(Directory)%(Filename).xml')" Condition="'%(ReferenceCopyLocalPaths.NuGetPackageId)' != '' and Exists('%(RootDir)%(Directory)%(Filename).xml')" />
</ItemGroup>
</Target>
</Project>
Loading

0 comments on commit fd4703e

Please sign in to comment.