devops: switch to ISO date string for Canary versions (#29142)

Fixes https://github.com/microsoft/playwright/issues/28906
This commit is contained in:
Max Schmitt 2024-01-24 17:13:00 +01:00 committed by GitHub
parent 0752f0202f
commit d50479a76f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -34,11 +34,8 @@ if (process.argv[2] === '--alpha') {
let newVersion; let newVersion;
if (process.argv[3] === '--today-date') { if (process.argv[3] === '--today-date') {
const date = new Date(); const isoDate = new Date().toISOString().split('T')[0];
const month = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'][date.getMonth()]; newVersion = `${baseVersion}-${prefix}-${isoDate}`;
const day = date.getDate();
const year = date.getFullYear();
newVersion = `${baseVersion}-${prefix}-${month}-${day}-${year}`;
} else if (process.argv[3] === '--commit-timestamp') { } else if (process.argv[3] === '--commit-timestamp') {
const timestamp = execSync('git show -s --format=%ct HEAD', { const timestamp = execSync('git show -s --format=%ct HEAD', {
stdio: ['ignore', 'pipe', 'ignore'] stdio: ['ignore', 'pipe', 'ignore']