diff --git a/Rakefile b/Rakefile index 550a4d8925e5c..587fdd518cd47 100644 --- a/Rakefile +++ b/Rakefile @@ -529,27 +529,26 @@ namespace :node do # 2. Updating a nightly build for the next nightly build # 3. Switching from nightlies to a release build. - if bump_nightly && old_version.include?('-next') + if bump_nightly && old_version.include?('-nightly') # This is the case where we are updating a nightly build to the next nightly build. - # This change is usually done by the CI system and never committed. We use npm version for this. - sh 'npm --prefix ./javascript/node/selenium-webdriver version prerelease --preid=next' + # This change is usually done by the CI system and never committed. + # The "-nightlyYmdHM" is removed to add a new timestamp. + new_version = old_version.gsub(/\-nightly\d+$/, '') + "-nightly#{Time.now.strftime("%Y%m%d%H%M")}" elsif bump_nightly # This is the case after a production release and the version number is configured - # to start doing nightly builds. We use npm version for this. - # Bump to the next preminor version, e.g. from 4.19.x to 4.20.0-next.0 - sh 'npm --prefix ./javascript/node/selenium-webdriver version preminor --no-git-tag-version --preid=next' + # to start doing nightly builds. + new_version = old_version + "-nightly#{Time.now.strftime("%Y%m%d%H%M")}" else - if old_version.include?('-next') - # From a nightly build to a release build. We use npm version for this. - sh 'npm --prefix ./javascript/node/selenium-webdriver version minor --no-git-tag-version' + if old_version.include?('-nightly') + # From a nightly build to a release build. + new_version = old_version.gsub(/\-nightly\d+$/, '') else # From a release build to a nightly build. We use npm version for this. - sh 'npm --prefix ./javascript/node/selenium-webdriver version preminor --no-git-tag-version --preid=next' + new_version = updated_version(old_version.gsub(/\-nightly\d+$/, ''), arguments[:version]) + new_version = new_version + "-nightly#{Time.now.strftime("%Y%m%d%H%M")}" end end - # Fetching the new version number - new_version = node_version ['javascript/node/selenium-webdriver/package.json', 'package-lock.json', 'javascript/node/selenium-webdriver/BUILD.bazel'].each do |file| @@ -557,7 +556,7 @@ namespace :node do File.open(file, "w") { |f| f.puts text } end - Rake::Task['node:changelog'].invoke unless new_version.include?('-next') || bump_nightly + Rake::Task['node:changelog'].invoke unless new_version.include?('-nightly') || bump_nightly end end diff --git a/javascript/node/selenium-webdriver/BUILD.bazel b/javascript/node/selenium-webdriver/BUILD.bazel index 24b18d405da4c..15ad1553065a6 100644 --- a/javascript/node/selenium-webdriver/BUILD.bazel +++ b/javascript/node/selenium-webdriver/BUILD.bazel @@ -9,7 +9,7 @@ load("//javascript:defs.bzl", "mocha_test") npm_link_all_packages(name = "node_modules") -VERSION = "4.20.0-next.4" +VERSION = "4.20.0-nightly202404191827" BROWSER_VERSIONS = [ "v85", diff --git a/javascript/node/selenium-webdriver/package.json b/javascript/node/selenium-webdriver/package.json index f9d0d7a7c20c9..a67655565f154 100644 --- a/javascript/node/selenium-webdriver/package.json +++ b/javascript/node/selenium-webdriver/package.json @@ -1,6 +1,6 @@ { "name": "selenium-webdriver", - "version": "4.20.0-next.4", + "version": "4.20.0-nightly202404191827", "description": "The official WebDriver JavaScript bindings from the Selenium project", "license": "Apache-2.0", "keywords": [ diff --git a/package-lock.json b/package-lock.json index cd05500a63003..826a3f225c0a8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1874,7 +1874,7 @@ "license": "ISC" }, "javascript/node/selenium-webdriver": { - "version": "4.20.0-next.4", + "version": "4.20.0-nightly202404191827", "license": "Apache-2.0", "dependencies": { "jszip": "^3.10.1",