Skip to content

Commit

Permalink
[js] Using nightly now
Browse files Browse the repository at this point in the history
  • Loading branch information
diemol committed Apr 19, 2024
1 parent 0e2cee9 commit 11bd94b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 16 deletions.
25 changes: 12 additions & 13 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -529,35 +529,34 @@ 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|
text = File.read(file).gsub(old_version, new_version)
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

Expand Down
2 changes: 1 addition & 1 deletion javascript/node/selenium-webdriver/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion javascript/node/selenium-webdriver/package.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 11bd94b

Please sign in to comment.