2222 description : ' Build date in format YYYYMMDD. Must provide if reusing base image'
2323 required : false
2424 type : string
25- default : ' '
25+ default : ' 20250123 '
2626 browser-name :
2727 description : ' Browser name to build. E.g: chrome'
2828 required : true
2929 type : string
3030 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] '
3333 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] '
3535 push-image :
3636 description : ' Push image after testing successfully'
3737 required : true
3838 type : boolean
39+ default : false
40+ pr-changelog :
41+ description : ' Create a PR for CHANGELOG'
42+ required : true
43+ type : boolean
3944 default : true
4045
4146env :
4247 GRID_VERSION : ${{ github.event.inputs.grid-version }}
4348 BROWSER_NAME : ${{ github.event.inputs.browser-name }}
44- BROWSER_VERSION : ${{ github.event.inputs.browser-version }}
4549 REUSE_BASE : ${{ github.event.inputs.reuse-base || true }}
4650 BUILD_DATE : ${{ github.event.inputs.build-date || '' }}
4751 NAMESPACE : ${{ vars.DOCKER_NAMESPACE || 'selenium' }}
4852 AUTHORS : ${{ vars.AUTHORS || 'SeleniumHQ' }}
4953 PUSH_IMAGE : ${{ github.event.inputs.push-image || false }}
54+ PR_CHANGELOG : ${{ github.event.inputs.pr-changelog || true }}
55+ RUN_ID : ${{ github.run_id }}
5056
5157jobs :
5258 deploy :
53- name : Deploy Node/Standalone Chrome with specific browser version
59+ name : Node/Standalone Chrome
5460 runs-on : ubuntu-24.04
5561 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 }}
5668 steps :
5769 - name : Checkout code
5870 uses : actions/checkout@main
@@ -81,21 +93,32 @@ jobs:
8193 echo "BUILD_DATE=${BUILD_DATE}" >> $GITHUB_ENV
8294 fi
8395 echo "NAME=${NAMESPACE}" >> $GITHUB_ENV
96+ echo "BROWSER_VERSION=${BROWSER_VERSION}" >> $GITHUB_ENV
97+ env :
98+ BROWSER_VERSION : ${{ matrix.browser-version }}
8499 - name : Get Grid version
85100 if : env.GRID_VERSION == ''
86101 run : |
87102 echo ${BASE_VERSION}
88103 echo "GRID_VERSION=${BASE_VERSION}" >> $GITHUB_ENV
89104 - 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"
91109 - name : Login Docker Hub
92110 run : docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
93111 env :
94112 DOCKER_USERNAME : ${{secrets.DOCKER_USERNAME}}
95113 DOCKER_PASSWORD : ${{secrets.DOCKER_PASSWORD}}
96114 - 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}
99122 - name : Build Hub image for testing
100123 if : env.REUSE_BASE == 'false'
101124 run : make hub
@@ -114,3 +137,48 @@ jobs:
114137 name : image_tags_${{ env.GRID_VERSION }}_${{ env.BROWSER_NAME }}_${{ env.BROWSER_VERSION }}
115138 path : ./CHANGELOG/${{ env.GRID_VERSION }}/${{ env.BROWSER_NAME }}_${{ env.BROWSER_VERSION }}.md
116139 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 "[email protected] " 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 <[email protected] >' 178+ author :
' Selenium CI Bot <[email protected] >' 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