fix: modernize docker publishing

This commit is contained in:
2026-04-29 12:58:06 +00:00
parent 27d4a5d3c1
commit 57f32661f3
11 changed files with 295 additions and 227 deletions
+31
View File
@@ -0,0 +1,31 @@
#!/usr/bin/env bash
set -euo pipefail
node --input-type=module <<'NODE'
import fs from 'node:fs';
import { execFileSync } from 'node:child_process';
const readJson = (path) => JSON.parse(fs.readFileSync(path, 'utf8'));
const arch = process.arch === 'x64' ? 'amd64' : process.arch;
const checks = {
packageVersion: readJson('/app/package.json').version,
hasCli: fs.existsSync('/app/cli.js'),
hasRustBinary: fs.existsSync(`/app/dist_rust/remoteingress-bin_linux_${arch}`) || fs.existsSync('/app/dist_rust/remoteingress-bin'),
};
await import('/app/dist_ts/index.js');
execFileSync('node', ['/app/cli.js', '--help'], { stdio: 'pipe' });
if (checks.packageVersion !== '4.17.1') {
throw new Error(`Unexpected remoteingress package version ${checks.packageVersion}`);
}
if (!checks.hasCli) {
throw new Error('Missing cli.js');
}
if (!checks.hasRustBinary) {
throw new Error(`Missing Rust binary for ${arch}`);
}
console.log(JSON.stringify(checks));
NODE