Skip to content

Commit

Permalink
does this work? [run ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
AtofStryker committed Jan 31, 2025
1 parent 99b449d commit a41513c
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 4 deletions.
27 changes: 23 additions & 4 deletions .circleci/workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -530,8 +530,7 @@ commands:
google-chrome-version:
description: Google Chrome version to install
type: string
# latest can also be used here
default: 132.0.6834.159
default: ""
install-firefox:
description: whether or not to install firefox
type: boolean
Expand Down Expand Up @@ -559,10 +558,30 @@ commands:
condition:
equal: [ true, << parameters.install-chrome >> ]
steps:
- when:
condition:
equal: [ "", << parameters.google-chrome-version >> ]
steps:
- run:
name: get chrome version
command: |
GOOGLE_CHROME_VERSION=$(node ./scripts/browser-versions.js << parameters.google-chrome-channel >>)
echo $GOOGLE_CHROME_VERSION
- when:
condition:
not:
equal: [ "", << parameters.google-chrome-version >> ]
steps:
- run:
name: get chrome version
command: |
GOOGLE_CHROME_VERSION=<< parameters.google-chrome-version >>
echo $GOOGLE_CHROME_VERSION
- run: echo $GOOGLE_CHROME_VERSION
- browser-tools/install-chrome:
# https://www.ubuntuupdates.org/package/google_chrome/stable/main/base/google-chrome-stable
channel: << parameters.google-chrome-channel >>
chrome-version: << parameters.google-chrome-version >>
channel: << parameters.google-chrome-channel >>
chrome-version: $GOOGLE_CHROME_VERSION
- when:
condition:
equal: [ 'beta', << parameters.google-chrome-channel>> ]
Expand Down
28 changes: 28 additions & 0 deletions scripts/browser-versions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
const fs = require('fs')

/**
* from root of directory run:
* node ./scripts/browser-versions.js
* to get stable chrome version, or:
* node ./scripts/browser-versions.js beta
* get get beta chrome version
*/
const getVersion = () => {
// file path is relative to repo root
const currentBrowserVersions = JSON.parse(fs.readFileSync('./browser-versions.json'))

const betaVersion = currentBrowserVersions['chrome:beta']
const stableVersion = currentBrowserVersions['chrome:stable']

if (process.argv.includes('beta')) {
console.log(betaVersion)
} else {
console.log(stableVersion)
}
}

module.exports = {
getVersion,
}

getVersion()

0 comments on commit a41513c

Please sign in to comment.