Fix #2081 - include ref in release zip
This commit is contained in:
parent
167cc398ce
commit
3fd0cc1c02
@ -89,6 +89,7 @@ module.exports = function (grunt) {
|
|||||||
const compileYear = grunt.template.today("UTC:yyyy"),
|
const compileYear = grunt.template.today("UTC:yyyy"),
|
||||||
compileTime = grunt.template.today("UTC:dd/mm/yyyy HH:MM:ss") + " UTC",
|
compileTime = grunt.template.today("UTC:dd/mm/yyyy HH:MM:ss") + " UTC",
|
||||||
pkg = grunt.file.readJSON("package.json"),
|
pkg = grunt.file.readJSON("package.json"),
|
||||||
|
downloadZipFilename = `CyberChef_${process.env.GITHUB_SHA || `v${pkg.version}`}.zip`,
|
||||||
webpackConfig = require("./webpack.config.js"),
|
webpackConfig = require("./webpack.config.js"),
|
||||||
BUILD_CONSTANTS = {
|
BUILD_CONSTANTS = {
|
||||||
COMPILE_YEAR: JSON.stringify(compileYear),
|
COMPILE_YEAR: JSON.stringify(compileYear),
|
||||||
@ -130,6 +131,7 @@ module.exports = function (grunt) {
|
|||||||
compileYear: compileYear,
|
compileYear: compileYear,
|
||||||
compileTime: compileTime,
|
compileTime: compileTime,
|
||||||
version: pkg.version,
|
version: pkg.version,
|
||||||
|
downloadZipFilename: downloadZipFilename,
|
||||||
minify: {
|
minify: {
|
||||||
removeComments: true,
|
removeComments: true,
|
||||||
collapseWhitespace: true,
|
collapseWhitespace: true,
|
||||||
@ -245,7 +247,7 @@ module.exports = function (grunt) {
|
|||||||
"!build/prod/index.html",
|
"!build/prod/index.html",
|
||||||
"!build/prod/BundleAnalyzerReport.html",
|
"!build/prod/BundleAnalyzerReport.html",
|
||||||
],
|
],
|
||||||
dest: `build/prod/CyberChef_v${pkg.version}.zip`
|
dest: `build/prod/${downloadZipFilename}`
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
connect: {
|
connect: {
|
||||||
@ -333,12 +335,12 @@ module.exports = function (grunt) {
|
|||||||
switch (process.platform) {
|
switch (process.platform) {
|
||||||
case "darwin":
|
case "darwin":
|
||||||
return chainCommands([
|
return chainCommands([
|
||||||
`shasum -a 256 build/prod/CyberChef_v${pkg.version}.zip | awk '{print $1;}' > build/prod/sha256digest.txt`,
|
`shasum -a 256 build/prod/${downloadZipFilename} | awk '{print $1;}' > build/prod/sha256digest.txt`,
|
||||||
`sed -i '' -e "s/DOWNLOAD_HASH_PLACEHOLDER/$(cat build/prod/sha256digest.txt)/" build/prod/index.html`
|
`sed -i '' -e "s/DOWNLOAD_HASH_PLACEHOLDER/$(cat build/prod/sha256digest.txt)/" build/prod/index.html`
|
||||||
]);
|
]);
|
||||||
default:
|
default:
|
||||||
return chainCommands([
|
return chainCommands([
|
||||||
`sha256sum build/prod/CyberChef_v${pkg.version}.zip | awk '{print $1;}' > build/prod/sha256digest.txt`,
|
`sha256sum build/prod/${downloadZipFilename} | awk '{print $1;}' > build/prod/sha256digest.txt`,
|
||||||
`sed -i -e "s/DOWNLOAD_HASH_PLACEHOLDER/$(cat build/prod/sha256digest.txt)/" build/prod/index.html`
|
`sed -i -e "s/DOWNLOAD_HASH_PLACEHOLDER/$(cat build/prod/sha256digest.txt)/" build/prod/index.html`
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -876,7 +876,7 @@
|
|||||||
<li>Released under the Apache Licence, Version 2.0</li>
|
<li>Released under the Apache Licence, Version 2.0</li>
|
||||||
<li>SHA256 hash: DOWNLOAD_HASH_PLACEHOLDER</li>
|
<li>SHA256 hash: DOWNLOAD_HASH_PLACEHOLDER</li>
|
||||||
</ul>
|
</ul>
|
||||||
<a href="CyberChef_v<%= htmlWebpackPlugin.options.version %>.zip" download class="btn btn-outline-primary">Download ZIP file</a>
|
<a href="<%= htmlWebpackPlugin.options.downloadZipFilename %>" download class="btn btn-outline-primary">Download ZIP file</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-primary" data-dismiss="modal">Ok</button>
|
<button type="button" class="btn btn-primary" data-dismiss="modal">Ok</button>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user