forked from bitshares/bitshares-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Write sha256 sums to file on package and deploy
- Loading branch information
Showing
8 changed files
with
2,280 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
cd $TRAVIS_BUILD_DIR | ||
unamestr=`uname` | ||
if [[ "$unamestr" == 'Linux' && -n $TRAVIS_TAG ]] | ||
if [ "$unamestr" == 'Linux' ] | ||
then | ||
# npm run build-github | ||
npm run build-hash | ||
fi | ||
if [ $TRAVIS_TAG ] | ||
then | ||
npm run-script package | ||
# shasum -a256 $TRAVIS_BUILD_DIR/build/binaries/* > $TRAVIS_BUILD_DIR/shasums_$TRAVIS_JOB_NUMBER.txt | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
var crypto = require("crypto"); | ||
var fs = require("fs"); | ||
var os = require("os"); | ||
var path = require("path"); | ||
var packageJSON = require("./package.json"); | ||
var jetpack = require("fs-jetpack"); | ||
var releasesDir = jetpack.dir("./build"); | ||
|
||
console.log(`\nUI version ${packageJSON.version} sha256 sums:\n`); | ||
|
||
var platform = os.platform(); | ||
|
||
var binaryPath = "build/binaries/"; | ||
var htmlPath = "build/"; | ||
|
||
var files = []; | ||
var binaries = fs.readdirSync(binaryPath).filter(function(a) { | ||
return a.indexOf(packageJSON.version) !== -1; | ||
}); | ||
binaries.forEach(function(file) { | ||
files.push({fullPath: path.resolve(binaryPath, file), fileName: file}); | ||
}); | ||
var htmlZipFiles = fs.readdirSync(htmlPath).filter(function(a) { | ||
return a.indexOf(packageJSON.version) !== -1 && a.indexOf("zip") !== -1; | ||
}); | ||
htmlZipFiles.forEach(function(file) { | ||
files.push({fullPath: path.resolve(htmlPath, file), fileName: file}); | ||
}); | ||
|
||
if (!files.length) return; | ||
releasesDir.remove(`release-checksums-${platform}`); | ||
files.forEach(function(file) { | ||
var sha256 = crypto.createHash("sha256"); | ||
var s = fs.ReadStream(file.fullPath); | ||
s.on("data", function(d) { | ||
sha256.update(d); | ||
}); | ||
|
||
s.on("end", function() { | ||
var d2 = sha256.digest("hex"); | ||
|
||
console.log(`__${file.fileName}__`); | ||
console.log("`" + d2 + "`"); | ||
|
||
releasesDir.append( | ||
`release-checksums-${platform}`, | ||
`\n__${file.fileName}__` + "\n`" + d2 + "`" | ||
); | ||
}); | ||
}); |