Files
playlet-piped/tools/sign-package.js
T
Brahim Hadriche 0bcf361eb0 Documentation, screenshots and a couple of tweaks (#142)
* Documentation, screenshots and a couple of tweaks

* Changelog

* changelog
2023-09-10 14:44:48 -04:00

35 lines
1.1 KiB
JavaScript

// Description: Publish, sign the package and retrieve it from the Roku device
// It expects release/playlet.zip to exist
const getEnvVars = require('./get-env-vars');
const rokuDeploy = require('roku-deploy');
const config = getEnvVars(['ROKU_DEV_TARGET', 'ROKU_DEVPASSWORD', 'ROKU_SIGN_PASSWORD']);
const options = {
host: config.ROKU_DEV_TARGET,
password: config.ROKU_DEVPASSWORD,
outDir: 'release',
outFile: 'playlet.zip',
failOnCompileError: true,
stagingDir: 'dist/build/playlet-app',
retainStagingDir: true,
signingPassword: config.ROKU_SIGN_PASSWORD,
};
(async () => {
try {
// Sideload playlet.zip
await rokuDeploy.publish(options);
// Sign the package
const remotePkgPath = await rokuDeploy.signExistingPackage(options);
// Retrieve the signed package
const localPkgFilePath = await rokuDeploy.retrieveSignedPackage(remotePkgPath, options);
console.log(`Created signed package: ${localPkgFilePath}`)
}
catch (error) {
console.error(error);
throw error;
}
})();