Skip to content

🎥 Make videos programmatically with React

fix release script for lambda

Jonny Burger1d3b81434b36
diff --git a/packages/lambda/ensure-version-match.js b/packages/lambda/ensure-version-match.js
index 995646ce9b..8a7d76fe05 100644
--- a/packages/lambda/ensure-version-match.js
+++ b/packages/lambda/ensure-version-match.js
@@ -1,19 +1,23 @@
const cp = require('node:child_process');
const fs = require('node:fs');
-cp.execSync('unzip -o remotionlambda.zip -d extracted');
-const contents = fs.readFileSync('extracted/index.js', 'utf-8');
-fs.rmSync('extracted', {recursive: true});
-const [, inLambda] = contents.match(/exports\.VERSION = "(.*)"/);
+const versions = [`remotionlambda-arm64.zip`, `remotionlambda-x64.zip`];
-const inConstants = fs.readFileSync('../core/dist/version.js', 'utf-8');
-const [, inPkg] = inConstants.match(/exports\.VERSION = '(.*)'/);
+for (const version of versions) {
+ cp.execSync(`unzip -o ${version} -d extracted`);
+ const contents = fs.readFileSync('extracted/index.js', 'utf-8');
+ fs.rmSync('extracted', {recursive: true});
+ const [, inLambda] = contents.match(/exports\.VERSION = "(.*)"/);
-if (inLambda !== inPkg) {
- console.error(
- `Version in Lambda is ${inLambda}, and in package ${inPkg}. Align the versions.`
- );
- process.exit(1);
-}
+ const inConstants = fs.readFileSync('../core/dist/version.js', 'utf-8');
+ const [, inPkg] = inConstants.match(/exports\.VERSION = '(.*)'/);
+
+ if (inLambda !== inPkg) {
+ console.error(
+ `Version in Lambda is ${inLambda}, and in package ${inPkg}. Align the versions.`
+ );
+ process.exit(1);
+ }
-console.log(`Lambda version ${inLambda} aligns.`);
+ console.log(`Lambda version ${inLambda} aligns in ${version}`);
+}