electron-chromedriver 17.0.0 → 20.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,54 @@
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
+ run_tests:
15
+ strategy:
16
+ matrix:
17
+ os: [ubuntu-latest, macos-latest]
18
+ runs-on: ${{ matrix.os }}
19
+ steps:
20
+ - uses: actions/checkout@v3
21
+ - name: Install Dependencies
22
+ run: npm i
23
+ - name: Update Version
24
+ run: node script/update-version.js ${{ github.event.inputs.version }}
25
+ - name: Run Tests
26
+ run: npm test
27
+ create_new_version:
28
+ runs-on: ubuntu-latest
29
+ needs: run_tests
30
+ steps:
31
+ - uses: actions/checkout@v3
32
+ - name: Set Git Credentials
33
+ run: |
34
+ git config user.name electron-bot
35
+ git config user.email electron@github.com
36
+ - name: Update Version
37
+ run: node script/update-version.js ${{ github.event.inputs.version }}
38
+ - name: Push Update Commit
39
+ run: |
40
+ git add .
41
+ git commit -m "chore: update version to ${{ github.event.inputs.version }}"
42
+ git push origin main
43
+ - name: Push New Tag
44
+ run: |
45
+ git tag ${{ github.event.inputs.version }}
46
+ git push origin ${{ github.event.inputs.version }}
47
+ - name: Create Release
48
+ run: |
49
+ gh release create ${{ github.event.inputs.version }} -t ${{ github.event.inputs.version }}
50
+ - name: Publish to npm
51
+ run: npm publish
52
+ env:
53
+ NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
54
+
@@ -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": "17.0.0",
3
+ "version": "20.0.0",
4
4
  "description": "Electron ChromeDriver",
5
5
  "repository": "https://github.com/electron/chromedriver",
6
6
  "bin": {
@@ -24,4 +24,4 @@
24
24
  "mocha": "^8.3.0",
25
25
  "standard": "^13.1.0"
26
26
  }
27
- }
27
+ }
@@ -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()