22
22
description : ' Build date in format YYYYMMDD. Must provide if reusing base image'
23
23
required : false
24
24
type : string
25
- default : ' '
25
+ default : ' 20250123 '
26
26
browser-name :
27
27
description : ' Browser name to build. E.g: chrome'
28
28
required : true
29
29
type : string
30
30
default : ' chrome'
31
- browser-version :
32
- description : ' Browser version to build. E.g: 120 '
31
+ browser-versions :
32
+ description : ' List browser version to build. E.g: [130, 131] '
33
33
required : true
34
- type : string
34
+ default : ' [97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132] '
35
35
push-image :
36
36
description : ' Push image after testing successfully'
37
37
required : true
38
38
type : boolean
39
+ default : false
40
+ pr-changelog :
41
+ description : ' Create a PR for CHANGELOG'
42
+ required : true
43
+ type : boolean
39
44
default : true
40
45
41
46
env :
42
47
GRID_VERSION : ${{ github.event.inputs.grid-version }}
43
48
BROWSER_NAME : ${{ github.event.inputs.browser-name }}
44
- BROWSER_VERSION : ${{ github.event.inputs.browser-version }}
45
49
REUSE_BASE : ${{ github.event.inputs.reuse-base || true }}
46
50
BUILD_DATE : ${{ github.event.inputs.build-date || '' }}
47
51
NAMESPACE : ${{ vars.DOCKER_NAMESPACE || 'selenium' }}
48
52
AUTHORS : ${{ vars.AUTHORS || 'SeleniumHQ' }}
49
53
PUSH_IMAGE : ${{ github.event.inputs.push-image || false }}
54
+ PR_CHANGELOG : ${{ github.event.inputs.pr-changelog || true }}
55
+ RUN_ID : ${{ github.run_id }}
50
56
51
57
jobs :
52
58
deploy :
53
- name : Deploy Node/Standalone Chrome with specific browser version
59
+ name : Node/Standalone Chrome
54
60
runs-on : ubuntu-24.04
55
61
permissions : write-all
62
+ strategy :
63
+ fail-fast : false
64
+ matrix :
65
+ browser-version : ${{ fromJSON(github.event.inputs.browser-versions)}}
66
+ outputs :
67
+ GRID_VERSION : ${{ steps.display_grid_version.outputs.GRID_VERSION }}
56
68
steps :
57
69
- name : Checkout code
58
70
uses : actions/checkout@main
@@ -81,21 +93,32 @@ jobs:
81
93
echo "BUILD_DATE=${BUILD_DATE}" >> $GITHUB_ENV
82
94
fi
83
95
echo "NAME=${NAMESPACE}" >> $GITHUB_ENV
96
+ echo "BROWSER_VERSION=${BROWSER_VERSION}" >> $GITHUB_ENV
97
+ env :
98
+ BROWSER_VERSION : ${{ matrix.browser-version }}
84
99
- name : Get Grid version
85
100
if : env.GRID_VERSION == ''
86
101
run : |
87
102
echo ${BASE_VERSION}
88
103
echo "GRID_VERSION=${BASE_VERSION}" >> $GITHUB_ENV
89
104
- name : Display Grid version
90
- run : echo ${GRID_VERSION}
105
+ id : display_grid_version
106
+ run : |
107
+ echo ${GRID_VERSION}
108
+ echo "GRID_VERSION=${GRID_VERSION}" >> "$GITHUB_OUTPUT"
91
109
- name : Login Docker Hub
92
110
run : docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
93
111
env :
94
112
DOCKER_USERNAME : ${{secrets.DOCKER_USERNAME}}
95
113
DOCKER_PASSWORD : ${{secrets.DOCKER_PASSWORD}}
96
114
- name : Build images with Grid core ${{ env.GRID_VERSION }} and ${{ env.BROWSER_NAME }} v${{ env.BROWSER_VERSION }}
97
- run : |
98
- ./tests/build-backward-compatible/bootstrap.sh ${GRID_VERSION} ${BROWSER_VERSION} ${BROWSER_NAME} ${REUSE_BASE}
115
+ uses : nick-invision/retry@master
116
+ with :
117
+ timeout_minutes : 20
118
+ max_attempts : 3
119
+ retry_wait_seconds : 60
120
+ command : |
121
+ ./tests/build-backward-compatible/bootstrap.sh ${GRID_VERSION} ${BROWSER_VERSION} ${BROWSER_NAME} ${REUSE_BASE}
99
122
- name : Build Hub image for testing
100
123
if : env.REUSE_BASE == 'false'
101
124
run : make hub
@@ -114,3 +137,48 @@ jobs:
114
137
name : image_tags_${{ env.GRID_VERSION }}_${{ env.BROWSER_NAME }}_${{ env.BROWSER_VERSION }}
115
138
path : ./CHANGELOG/${{ env.GRID_VERSION }}/${{ env.BROWSER_NAME }}_${{ env.BROWSER_VERSION }}.md
116
139
if-no-files-found : ignore
140
+
141
+ pr-results :
142
+ name : Create a PR with changelog
143
+ if : (!failure() && !cancelled() && (github.event.inputs.pr-changelog == 'true'))
144
+ runs-on : ubuntu-24.04
145
+ needs : deploy
146
+ steps :
147
+ - name : Checkout code
148
+ uses : actions/checkout@main
149
+ with :
150
+ persist-credentials : false
151
+ fetch-depth : 0
152
+ - name : Get Grid version
153
+ run : |
154
+ echo "GRID_VERSION=${GRID_VERSION}" >> $GITHUB_ENV
155
+ env :
156
+ GRID_VERSION : ${{ needs.deploy.outputs.GRID_VERSION }}
157
+ - name : Download results
158
+ uses : actions/download-artifact@v4
159
+ with :
160
+ path : ./CHANGELOG/${{ env.GRID_VERSION }}
161
+ pattern : ' image_tags_*'
162
+ merge-multiple : ' true'
163
+ run-id : ${{ env.RUN_ID }}
164
+ github-token : ${{ secrets.GITHUB_TOKEN }}
165
+ - name : Commit configs
166
+ run : |
167
+ git config --local user.email "selenium-ci@users.noreply.github.com"
168
+ git config --local user.name "Selenium CI Bot"
169
+ - name : Create Pull Request
170
+ id : cpr
171
+ uses : peter-evans/create-pull-request@main
172
+ with :
173
+ token : ${{ secrets.SELENIUM_CI_TOKEN }}
174
+ commit-message : " [ci] Upload CHANGELOG for Node/Standalone ${{ env.BROWSER_NAME }} version with Grid ${{ env.GRID_VERSION }}"
175
+ title : " [ci] Upload CHANGELOG for Node/Standalone ${{ env.BROWSER_NAME }} version with Grid ${{ env.GRID_VERSION }}"
176
+ body : " This PR contains the CHANGELOG for Node/Standalone Chrome with specific browser versions: ${{ github.event.inputs.browser-versions }}"
177
+ committer : ' Selenium CI Bot <selenium-ci@users.noreply.github.com>'
178
+ author : ' Selenium CI Bot <selenium-ci@users.noreply.github.com>'
179
+ branch : browser-node-changelog
180
+ - name : Check outputs
181
+ if : ${{ steps.cpr.outputs.pull-request-number }}
182
+ run : |
183
+ echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
184
+ echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
0 commit comments