Files
playlet-piped/tools/sign-package.js
T
2023-07-05 21:00:10 -04:00

35 lines
1.0 KiB
JavaScript

// Description: Publish, sign the package and retrieve it from the Roku device
// It expects release/playelt.zip to exist
const getEnvVars = require('./get-env-vars');
const rokuDeploy = require('roku-deploy');
const config = getEnvVars();
const options = {
host: config.ROKU_DEV_TARGET,
password: config.ROKU_DEVPASSWORD,
outDir: 'release',
outFile: 'playlet.zip',
failOnCompileError: true,
stagingDir: 'dist/build/playlet',
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;
}
})();