Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

chore: use last commit timestamp for @next builds (#4876)

Dmitry Gozman706c1e44d1da
diff --git a/utils/update_version.js b/utils/update_version.js
index 6b8b8b1a0e..2e6b8478a8 100755
--- a/utils/update_version.js
+++ b/utils/update_version.js
@@ -17,6 +17,7 @@
const fs = require('fs');
const path = require('path');
+const { execSync } = require('child_process');
const SCRIPT_NAME = path.basename(__filename);
const USAGE = `
@@ -48,7 +49,10 @@ if (version === '--next') {
version = packageJSON.version;
if (!version.includes('-'))
version += '-next';
- version += '.' + Date.now();
+ const timestamp = execSync('git show -s --format=%ct HEAD', {
+ stdio: ['ignore', 'pipe', 'ignore']
+ }).toString('utf8').trim() + '000';
+ version += '.' + timestamp;
console.log('Setting version to ' + version);
} else {
if (!version || !version.match(/^v\d+\.\d+\.\d+(-next)?$/)) {