Skip to content

Commit

Permalink
Merge pull request #1038 from Microsoft/toanzian/v4-linux-update
Browse files Browse the repository at this point in the history
Fixed linux auto update and packaging
  • Loading branch information
tonyanziano committed Oct 26, 2018
2 parents 19e9ceb + d526fbc commit 5e40ab3
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 21 deletions.
37 changes: 36 additions & 1 deletion packages/app/main/gulpfile.linux.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const gulp = require('gulp');
const common = require('./gulpfile.common.js');
const packageJson = require('./package.json');

/** Package the emulator using electron-builder
* and output artifacts to /dist/
Expand All @@ -14,7 +15,7 @@ gulp.task('package', async () => {

// create build artifacts
const filenames = await builder.build({
targets: builder.Platform.LINUX.createTarget(['deb', 'AppImage'], builder.Arch.ia32, builder.Arch.x64),
targets: builder.Platform.LINUX.createTarget(['deb', 'AppImage'], builder.Arch.ia32),
config
});

Expand All @@ -29,3 +30,37 @@ gulp.task('package', async () => {
.on('end', resolve);
});
});

/** Generates latest-linux.yml */
gulp.task('redist:metadata-only', async () => {
const { hashFileAsync, getReleaseFilename } = common;
const releaseFileName = `${getReleaseFilename()}.AppImage`;
const sha512 = await hashFileAsync(`./dist/${releaseFileName}`);
const releaseDate = new Date().toISOString();

writeYamlMetadataFile(
releaseFileName,
'latest-linux-ia32.yml',
'./dist',
sha512,
releaseDate
);
});

/** Writes the .yml metadata file */
function writeYamlMetadataFile(releaseFilename, yamlFilename, path, fileHash, releaseDate) {
const { getEnvironmentVar } = common;
var fsp = require('fs-extra');
var yaml = require('js-yaml');
const version = getEnvironmentVar('EMU_VERSION', packageJson.version);

const ymlInfo = {
version,
releaseDate,
githubArtifactName: releaseFilename,
path: releaseFilename,
sha512: fileHash
};
const ymlStr = yaml.safeDump(ymlInfo);
fsp.writeFileSync(`./${path}/${yamlFilename}`, ymlStr);
}
2 changes: 0 additions & 2 deletions packages/app/main/scripts/config/linux-dir.json

This file was deleted.

2 changes: 0 additions & 2 deletions packages/app/main/scripts/config/linux-package.json

This file was deleted.

1 change: 1 addition & 0 deletions packages/app/main/scripts/config/linux.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"linux": {
"artifactName": "BotFramework-Emulator-${version}-linux.${ext}",
"category": "Development"
}
}
2 changes: 0 additions & 2 deletions packages/app/main/scripts/config/mac-package.json

This file was deleted.

2 changes: 0 additions & 2 deletions packages/app/main/scripts/config/windows-package.json

This file was deleted.

12 changes: 0 additions & 12 deletions packages/app/main/scripts/config/windows-squirrel.json

This file was deleted.

0 comments on commit 5e40ab3

Please sign in to comment.