Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update our release scripts to match changes in electron-builder #1484

Merged
merged 1 commit into from
Sep 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,13 +308,16 @@ module.exports = function(grunt) {
var urlBase = "https://s3-us-west-1.amazonaws.com/signal-desktop-builds";
var keyBase = 'WhisperSystems/Signal-Desktop';
var sha = gitinfo.local.branch.current.SHA;
var files = [
'signal-desktop-' + package_json.version + '.zip',
'Signal-Setup_' + package_json.version + '.zip'
];
var files = [{
zip: 'signal-desktop-' + package_json.version + '.zip',
extractedTo: 'linux'
}, {
zip: 'Signal-Setup_' + package_json.version + '.zip',
extractedTo: 'windows'
}];

var extract = require('extract-zip');
var download = function(url, dest, cb) {
var download = function(url, dest, extractedTo, cb) {
var file = fs.createWriteStream(dest);
var request = https.get(url, function(response) {
if (response.statusCode !== 200) {
Expand All @@ -323,7 +326,7 @@ module.exports = function(grunt) {
response.pipe(file);
file.on('finish', function() {
file.close(function() {
extract(dest, {dir: 'release'}, cb);
extract(dest, {dir: 'release/' + extractedTo}, cb);
});
});
}
Expand All @@ -333,13 +336,13 @@ module.exports = function(grunt) {
});
};

Promise.all(files.map(function(fileName) {
var key = [ keyBase, sha, 'dist', fileName].join('/');
Promise.all(files.map(function(item) {
var key = [ keyBase, sha, 'dist', item.zip].join('/');
var url = [urlBase, key].join('/');
var dest = 'release/' + fileName;
var dest = 'release/' + item.zip;
return new Promise(function(resolve) {
console.log(url);
download(url, dest, function(err) {
download(url, dest, item.extractedTo, function(err) {
if (err) {
console.log('failed', dest, err);
resolve(err);
Expand All @@ -357,8 +360,6 @@ module.exports = function(grunt) {
});
done();
});

// TODO: chmod u+r win-unpacked/**/*
});

grunt.registerTask('unit-tests', 'Run unit tests inside Electron', function() {
Expand Down
10 changes: 5 additions & 5 deletions fix_broken_perms.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
set -e
find release/linux-unpacked -type d | xargs chmod 755
find release/linux-unpacked -type f | xargs chmod 644
find release/win-unpacked -type d | xargs chmod 755
find release/win-unpacked -type f | xargs chmod 644
chmod +x release/linux-unpacked/signal-desktop
find release/linux -type d | xargs chmod 755
find release/linux -type f | xargs chmod 644
find release/windows -type d | xargs chmod 755
find release/windows -type f | xargs chmod 644
chmod +x release/linux/signal-desktop
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
"prep-mac-release": "npm run build-release -- -m --dir",
"prep-release": "npm run generate && grunt prep-release && npm run build-release && npm run build-mas-release && grunt test-release",
"release-mac": "npm run build-release -- -m --prepackaged release/mac/Signal.app --publish=always",
"release-win": "npm run build-release -- -w --prepackaged release/win-unpacked --publish=always",
"release-lin": "npm run build-release -- -l --prepackaged release/linux-unpacked && VERSION=$npm_package_version ./aptly.sh",
"release-win": "npm run build-release -- -w --prepackaged release/windows --publish=always",
"release-lin": "npm run build-release -- -l --prepackaged release/linux && VERSION=$npm_package_version ./aptly.sh",
"release": "npm run release-mac && npm run release-win && npm run release-lin"
},
"build": {
Expand Down