Skip to content

Commit

Permalink
🚧 prepare for release
Browse files Browse the repository at this point in the history
  • Loading branch information
fluffynuts committed Sep 6, 2020
1 parent 3242db5 commit fd53aa1
Show file tree
Hide file tree
Showing 9 changed files with 131 additions and 22 deletions.
51 changes: 51 additions & 0 deletions local-tasks/hash-build-artifacts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
const
gulp = requireModule("gulp");

gulp.task("hash-build-artifacts", async () => {
const
path = require("path"),
crypto = require("crypto"),
{ readFile, writeFile, ls, FsEntities } = require("yafs"),
artifactsFolder = path.join("build", "artifacts");
const
buildArtifacts = await ls(artifactsFolder, {
fullPaths: true,
entities: FsEntities.files
}),
nupkg = buildArtifacts.find(p => p.match(/\.nupkg$/)),
binaries = buildArtifacts.find(p => p.match(/apache-log4net-binaries-\d+\.\d+\.\d+.zip$/)),
source = buildArtifacts.find(p => p.match(/apache-log4net-source-\d+\.\d+\.\d+.zip$/));

if (!nupkg) {
throw new Error(`apache-log4net nupkg not found in ${artifactsFolder}`);
}
if (!binaries) {
throw new Error(`apache-log4net binaries zip not found in ${artifactsFolder}`);
}
if (!source) {
throw new Error(`apache-log4net source zip not found in ${artifactsFolder}`);
}

await writeSHA512For(nupkg);
await writeSHA512For(binaries);
await writeSHA512For(source);

function writeSHA512For(filepath) {
return new Promise(async (resolve, reject) => {
try {
const
hash = crypto.createHash("sha512"),
data = await readFile(filepath);
hash.update(data);
const
outfile = `${filepath}.sha512`,
hex = hash.digest("hex"),
contents = `${hex} *${path.basename(filepath)}`;
await writeFile(outfile, contents);
resolve();
} catch (e) {
reject(e);
}
});
}
});
23 changes: 23 additions & 0 deletions local-tasks/prefix-build-artifacts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const { renameSync } = require("fs");

const gulp = requireModule("gulp");

gulp.task("prefix-build-artifacts", async () => {
// prefixes build artifacts with 'apache-'
const
{ ls, rename, FsEntities } = require("yafs"),
path = require("path"),
artifactsFolder = path.join("build/artifacts"),
contents = await ls(artifactsFolder, { fullPaths: true, entities: FsEntities.files });
for (let item of contents) {
const basename = path.basename(item);
if (basename.match(/^apache-/)) {
continue;
}
const newName = path.join(
path.dirname(item),
`apache-${basename}`
);
await rename(item, newName, true);
}
});
8 changes: 8 additions & 0 deletions local-tasks/prepare-build-artifacts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const
gulp = requireModule("gulp");

gulp.task("prepare-build-artifacts", gulp.series(
"zip",
"prefix-build-artifacts",
"hash-build-artifacts"
));
4 changes: 2 additions & 2 deletions local-tasks/zip.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ gulp.task("zip", [ "zip-binaries", "zip-source"], () => Promise.resolve());
gulp.task("zip-binaries", async () => {
const version = await readVersion();
return promisify(
gulp.src("build/Release/**/*")
gulp.src(["build/Release/**/*", "LICENSE", "NOTICE"])
.pipe(zip(`log4net-binaries-${version}.zip`))
.pipe(gulp.dest(target))
);
Expand Down Expand Up @@ -39,4 +39,4 @@ gulp.task("zip-source", async () => {

function readVersion() {
return readCsProjVersion("src/log4net/log4net.csproj");
}
}
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
"build": "run-s clean-build \"zarro build\"",
"build-release": "cross-env BUILD_CONFIGURATION=Release run-s clean-build \"zarro build\"",
"build-site": "run-s \"zarro build-site\"",
"zip": "run-s \"zarro zip\"",
"prepare-build-artifacts": "run-s \"zarro prepare-build-artifacts\"",
"dump-env": "node -e \"console.log(process.env);\"",
"release": "run-s build-release zip",
"release": "run-s build-release prepare-build-artifacts build-site",
"zarro": "cross-env BUILD_INCLUDE=src/log4net.sln zarro"
},
"repository": {
Expand All @@ -28,7 +28,8 @@
"gulp-zip": "^5.0.1",
"npm-run-all": "^4.1.5",
"rimraf": "^3.0.2",
"zarro": "^1.77.0",
"which": "^2.0.2"
"which": "^2.0.2",
"yafs": "^1.5.0",
"zarro": "^1.77.0"
}
}
4 changes: 2 additions & 2 deletions src/log4net/log4net.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<PackageId>log4net</PackageId>
<Version>2.0.9</Version>
<Version>2.0.10</Version>
<Title>Apache log4net</Title>
<Product>Apache log4net</Product>
<Description>
Expand All @@ -14,7 +14,7 @@
<Authors>The Apache Software Foundation</Authors>
<Owners>Apache Logging Project, Jiří Činčura</Owners>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageProjectUrl>http://logging.apache.org/log4net/</PackageProjectUrl>
<PackageProjectUrl>https://logging.apache.org/log4net/</PackageProjectUrl>
<PackageIcon>package-icon.png</PackageIcon>
<Copyright>Copyright 2004-2017 The Apache Software Foundation</Copyright>
<PackageTags>logging log tracing logfiles</PackageTags>
Expand Down
24 changes: 12 additions & 12 deletions src/site/xdoc/download_log4net.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ limitations under the License.
<p>Users who download the ZIP files to Windows may need to unblock the
archive (right click on the ZIP and press the "Unblock" button)
before extracting it.</p>

</section>

<section name="log4net 2.0.9">
<section name="log4net 2.0.10">

<subsection name="Source">
<table>
<tr>
<td><a href="https://downloads.apache.org/logging/log4net/source/apache-log4net-source-2.0.9.zip">apache-log4net-source-2.0.9.zip</a></td>
<td><a href="https://downloads.apache.org/logging/log4net/source/apache-log4net-source-2.0.9.zip.sha512">sha512</a></td>
<td><a href="https://downloads.apache.org/logging/log4net/source/apache-log4net-source-2.0.9.zip.asc">pgp</a></td>
<td><a href="https://downloads.apache.org/logging/log4net/source/apache-log4net-source-2.0.10.zip">apache-log4net-source-2.0.10.zip</a></td>
<td><a href="https://downloads.apache.org/logging/log4net/source/apache-log4net-source-2.0.10.zip.sha512">sha512</a></td>
<td><a href="https://downloads.apache.org/logging/log4net/source/apache-log4net-source-2.0.10.zip.asc">pgp</a></td>
</tr>
</table>
</subsection>
Expand All @@ -52,14 +52,14 @@ limitations under the License.
<p>Binaries are available in a zip file or nupkg, which is also available from <a href="https://www.nuget.org/packages/log4net/">nuget.org</a></p>
<table>
<tr>
<td><a href="https://downloads.apache.org/logging/log4net/binaries/apache-log4net-binaries-2.0.9.zip">log4net-binaries-2.0.9.zip</a></td>
<td><a href="https://downloads.apache.org/logging/log4net/binaries/apache-log4net-binaries-2.0.9.zip.sha512">sha512</a></td>
<td><a href="https://downloads.apache.org/logging/log4net/binaries/apache-log4net-binaries-2.0.9.zip.asc">pgp</a></td>
</tr>
<td><a href="https://downloads.apache.org/logging/log4net/binaries/apache-log4net-binaries-2.0.10.zip">log4net-binaries-2.0.10.zip</a></td>
<td><a href="https://downloads.apache.org/logging/log4net/binaries/apache-log4net-binaries-2.0.10.zip.sha512">sha512</a></td>
<td><a href="https://downloads.apache.org/logging/log4net/binaries/apache-log4net-binaries-2.0.10.zip.asc">pgp</a></td>
</tr>
<tr>
<td><a href="https://downloads.apache.org/logging/log4net/binaries/apache-log4net.2.0.9.nupkg">log4net-2.0.9.nupkg</a></td>
<td><a href="https://downloads.apache.org/logging/log4net/binaries/apache-log4net.2.0.9.nupkg.sha512">sha512</a></td>
<td><a href="https://downloads.apache.org/logging/log4net/binaries/apache-log4net.2.0.9.nupkg.asc">pgp</a></td>
<td><a href="https://downloads.apache.org/logging/log4net/binaries/apache-log4net.2.0.10.nupkg">log4net-2.0.10.nupkg</a></td>
<td><a href="https://downloads.apache.org/logging/log4net/binaries/apache-log4net.2.0.10.nupkg.sha512">sha512</a></td>
<td><a href="https://downloads.apache.org/logging/log4net/binaries/apache-log4net.2.0.10.nupkg.asc">pgp</a></td>
</tr>
</table>
</subsection>
Expand Down
24 changes: 22 additions & 2 deletions src/site/xdoc/release/release-notes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,22 @@ limitations under the License.
<body>

<section id="main" name="Apache log4net&#x2122; Release Notes">
<section id="2.0.10" name="2.0.10">
<p>
Apache log4net 2.0.10 improves <code>netstandard2.0</code> support
thanks to community member @NicholasNoise.
</p>
<section id="2.0.10-bug" name="Bug Fixes">
<ul>
<li>
[<a href="https://issues.apache.org/jira/browse/LOG4NET-575">LOG4NET-575</a>]
Addresses CVE-2018-1285 by cherry-picking the fix from
Dominik Psenner, reported by Karthik Balasundaram, as it already
existed in the the develop branch
</li>
</ul>
</section>
</section>

<section id="2.0.9" name="2.0.9">
<p>
Expand All @@ -36,8 +52,12 @@ limitations under the License.
</p>
<section id="2.0.9-bug" name="Bug Fixes">
<ul>
<li>[<a href="https://issues.apache.org/jira/browse/LOG4NET-559">LOG4NET-559</a>] Add null checkes to avoid issues thrown by custom appenders</li>
<li>[<a href="https://issues.apache.org/jira/browse/LOG4NET-563">LOG4NET-563</a>] Site styling copied from log4j</li>
<li>[<a href="https://issues.apache.org/jira/browse/LOG4NET-559">LOG4NET-559</a>] Add null
checkes to avoid issues thrown by custom appenders
</li>
<li>[<a href="https://issues.apache.org/jira/browse/LOG4NET-563">LOG4NET-563</a>] Site styling
copied from log4j
</li>
</ul>
</section>
</section>
Expand Down

0 comments on commit fd53aa1

Please sign in to comment.