|
| 1 | +name: Deploy specific Edge version |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + stable: |
| 7 | + description: 'Use upstream stable build' |
| 8 | + required: true |
| 9 | + type: string |
| 10 | + default: 'true' |
| 11 | + reuse-base: |
| 12 | + description: 'Reuse base image to build' |
| 13 | + required: false |
| 14 | + type: boolean |
| 15 | + default: true |
| 16 | + grid-version: |
| 17 | + description: 'Grid version to build. E.g: 4.28.1. Must provide if reusing base image' |
| 18 | + required: false |
| 19 | + type: string |
| 20 | + default: '' |
| 21 | + build-date: |
| 22 | + description: 'Build date in format YYYYMMDD. Must provide if reusing base image' |
| 23 | + required: false |
| 24 | + type: string |
| 25 | + default: '20250123' |
| 26 | + browser-name: |
| 27 | + description: 'Browser name to build. E.g: edge' |
| 28 | + required: true |
| 29 | + type: string |
| 30 | + default: 'edge' |
| 31 | + browser-versions: |
| 32 | + description: 'List browser version to build. E.g: [130, 131]' |
| 33 | + required: true |
| 34 | + default: '[114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132]' |
| 35 | + push-image: |
| 36 | + description: 'Push image after testing successfully' |
| 37 | + required: true |
| 38 | + type: boolean |
| 39 | + default: false |
| 40 | + pr-changelog: |
| 41 | + description: 'Create a PR for CHANGELOG' |
| 42 | + required: true |
| 43 | + type: boolean |
| 44 | + default: true |
| 45 | + |
| 46 | +env: |
| 47 | + GRID_VERSION: ${{ github.event.inputs.grid-version }} |
| 48 | + BROWSER_NAME: ${{ github.event.inputs.browser-name }} |
| 49 | + REUSE_BASE: ${{ github.event.inputs.reuse-base || true }} |
| 50 | + BUILD_DATE: ${{ github.event.inputs.build-date || '' }} |
| 51 | + NAMESPACE: ${{ vars.DOCKER_NAMESPACE || 'selenium' }} |
| 52 | + AUTHORS: ${{ vars.AUTHORS || 'SeleniumHQ' }} |
| 53 | + PUSH_IMAGE: ${{ github.event.inputs.push-image || false }} |
| 54 | + PR_CHANGELOG: ${{ github.event.inputs.pr-changelog || true }} |
| 55 | + RUN_ID: ${{ github.run_id }} |
| 56 | + |
| 57 | +jobs: |
| 58 | + deploy: |
| 59 | + name: Node/Standalone Edge |
| 60 | + runs-on: ubuntu-24.04 |
| 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 }} |
| 68 | + steps: |
| 69 | + - name: Checkout code |
| 70 | + uses: actions/checkout@main |
| 71 | + with: |
| 72 | + persist-credentials: false |
| 73 | + fetch-depth: 0 |
| 74 | + - name: Set up containerd image store feature |
| 75 | + uses: nick-invision/retry@master |
| 76 | + with: |
| 77 | + timeout_minutes: 10 |
| 78 | + max_attempts: 3 |
| 79 | + command: | |
| 80 | + make setup_dev_env |
| 81 | + - name: Output Docker info |
| 82 | + run: docker info |
| 83 | + - name: Set Selenium base version |
| 84 | + uses: ./.github/actions/get-latest-upstream |
| 85 | + with: |
| 86 | + release: ${{ github.event.inputs.stable || true }} |
| 87 | + gh_cli_token: ${{ secrets.GITHUB_TOKEN }} |
| 88 | + - name: Sets build date |
| 89 | + run: | |
| 90 | + if [ -z "${BUILD_DATE}" ]; then |
| 91 | + echo "BUILD_DATE=$(date '+%Y%m%d')" >> $GITHUB_ENV |
| 92 | + else |
| 93 | + echo "BUILD_DATE=${BUILD_DATE}" >> $GITHUB_ENV |
| 94 | + fi |
| 95 | + echo "NAME=${NAMESPACE}" >> $GITHUB_ENV |
| 96 | + echo "BROWSER_VERSION=${BROWSER_VERSION}" >> $GITHUB_ENV |
| 97 | + env: |
| 98 | + BROWSER_VERSION: ${{ matrix.browser-version }} |
| 99 | + - name: Get Grid version |
| 100 | + if: env.GRID_VERSION == '' |
| 101 | + run: | |
| 102 | + echo ${BASE_VERSION} |
| 103 | + echo "GRID_VERSION=${BASE_VERSION}" >> $GITHUB_ENV |
| 104 | + - name: Display Grid version |
| 105 | + id: display_grid_version |
| 106 | + run: | |
| 107 | + echo ${GRID_VERSION} |
| 108 | + echo "GRID_VERSION=${GRID_VERSION}" >> "$GITHUB_OUTPUT" |
| 109 | + - name: Login Docker Hub |
| 110 | + run: docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" |
| 111 | + env: |
| 112 | + DOCKER_USERNAME: ${{secrets.DOCKER_USERNAME}} |
| 113 | + DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}} |
| 114 | + - name: Build images with Grid core ${{ env.GRID_VERSION }} and ${{ env.BROWSER_NAME }} v${{ env.BROWSER_VERSION }} |
| 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} |
| 122 | + - name: Build Hub image for testing |
| 123 | + if: env.REUSE_BASE == 'false' |
| 124 | + run: make hub |
| 125 | + - name: Test images with Grid core ${{ env.GRID_VERSION }} and ${{ env.BROWSER_NAME }} v${{ env.BROWSER_VERSION }} |
| 126 | + run: | |
| 127 | + make test_edge |
| 128 | + make test_edge_standalone |
| 129 | + - name: Push images with Grid core ${{ env.GRID_VERSION }} and ${{ env.BROWSER_NAME }} v${{ env.BROWSER_VERSION }} |
| 130 | + if: env.PUSH_IMAGE == 'true' |
| 131 | + run: | |
| 132 | + ./tests/build-backward-compatible/bootstrap.sh ${GRID_VERSION} ${BROWSER_VERSION} ${BROWSER_NAME} ${REUSE_BASE} true true |
| 133 | + - name: Upload changelog |
| 134 | + if: always() |
| 135 | + uses: actions/upload-artifact@main |
| 136 | + with: |
| 137 | + name: image_tags_${{ env.GRID_VERSION }}_${{ env.BROWSER_NAME }}_${{ env.BROWSER_VERSION }} |
| 138 | + path: ./CHANGELOG/${{ env.GRID_VERSION }}/${{ env.BROWSER_NAME }}_${{ env.BROWSER_VERSION }}.md |
| 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 Edge 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