electron-chromedriver 16.0.0 → 19.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,35 @@
1
+ name: Release For New Electron Version
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ version:
7
+ description: 'version'
8
+ required: true
9
+
10
+ env:
11
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12
+
13
+ jobs:
14
+ main:
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: actions/checkout@v3
18
+ - name: Set Git Credentials
19
+ run: |
20
+ git config user.name electron-bot
21
+ git config user.email electron@github.com
22
+ - name: Update Version
23
+ run: node script/update-version.js ${{ github.event.inputs.version }}
24
+ - name: Push Update Commit
25
+ run: |
26
+ git add .
27
+ git commit -m "chore: update version to ${{ github.event.inputs.version }}"
28
+ git push origin main
29
+ - name: Push New Tag
30
+ run: |
31
+ git tag ${{ github.event.inputs.version }}
32
+ git push origin ${{ github.event.inputs.version }}
33
+ - name: Create Release
34
+ run: |
35
+ gh release create ${{ github.event.inputs.version }} -t ${{ github.event.inputs.version }}
@@ -0,0 +1,20 @@
1
+ name: "Check Semantic Commit"
2
+
3
+ on:
4
+ pull_request_target:
5
+ types:
6
+ - opened
7
+ - edited
8
+ - synchronize
9
+
10
+ jobs:
11
+ main:
12
+ name: Validate PR Title
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - name: semantic-pull-request
16
+ uses: amannn/action-semantic-pull-request@v4
17
+ env:
18
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19
+ with:
20
+ validateSingleCommit: true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "electron-chromedriver",
3
- "version": "16.0.0",
3
+ "version": "19.0.0",
4
4
  "description": "Electron ChromeDriver",
5
5
  "repository": "https://github.com/electron/chromedriver",
6
6
  "bin": {
@@ -0,0 +1,37 @@
1
+ const { promises: fs } = require('fs')
2
+ const path = require('path')
3
+
4
+ const versionFormat = /^(\d+\.)(\d+\.)(\d+)$/
5
+
6
+ const normalizeVersion = (version = '') => {
7
+ return version.startsWith('v') ? version.slice(1) : version
8
+ }
9
+
10
+ async function updateVersion () {
11
+ const version = normalizeVersion(process.argv[2])
12
+ if (!versionFormat.test(version)) {
13
+ console.error(`Invalid version ${version}`)
14
+ process.exit(1)
15
+ }
16
+
17
+ const PJ_PATH = path.join(__dirname, '..', 'package.json')
18
+ const pj = require(PJ_PATH)
19
+
20
+ const PJLOCK_PATH = path.join(__dirname, '..', 'package-lock.json')
21
+ const pjLock = require(PJLOCK_PATH)
22
+
23
+ try {
24
+ pj.version = version
25
+ await fs.writeFile(PJ_PATH, JSON.stringify(pj, null, 2))
26
+ console.log(`Updated package.json version to ${version}`)
27
+
28
+ pjLock.version = version
29
+ await fs.writeFile(PJLOCK_PATH, JSON.stringify(pjLock, null, 2))
30
+ console.log(`Updated package-lock.json version to ${version}`)
31
+ } catch (e) {
32
+ console.error('Failed to update chromedriver version: ', e)
33
+ process.exit(1)
34
+ }
35
+ }
36
+
37
+ updateVersion()