Skip to content

Commit e6ea3ce

Browse files
committed
[ci] Update workflows release backward versions
[skip ci] Signed-off-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com>
1 parent 1c9a025 commit e6ea3ce

File tree

4 files changed

+99
-150
lines changed

4 files changed

+99
-150
lines changed
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Create changelog PR
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
grid-version:
7+
required: true
8+
type: string
9+
browser-name:
10+
required: true
11+
type: string
12+
browser-versions:
13+
required: true
14+
type: string
15+
run-id:
16+
required: true
17+
type: string
18+
19+
jobs:
20+
pr-results:
21+
name: Create a PR with changelog
22+
runs-on: ubuntu-24.04
23+
steps:
24+
- name: Checkout code
25+
uses: actions/checkout@main
26+
with:
27+
persist-credentials: false
28+
fetch-depth: 0
29+
- name: Check existing PR
30+
id: check-pr
31+
run: |
32+
PR_NUMBER=$(gh pr list --base trunk --head browser-node-changelog --json number --jq '.[0].number')
33+
if [ "$PR_NUMBER" != "null" ] && [ -n "$PR_NUMBER" ]; then
34+
echo "pr-exists=true" >> $GITHUB_OUTPUT
35+
else
36+
echo "pr-exists=false" >> $GITHUB_OUTPUT
37+
fi
38+
env:
39+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
- name: Checkout PR branch
41+
if: steps.check-pr.outputs.pr-exists == 'true'
42+
run: |
43+
git checkout browser-node-changelog
44+
- name: Create CHANGELOG directory
45+
run: mkdir -p ./CHANGELOG/${{ inputs.grid-version }}
46+
- name: Fetch latest version
47+
run: make update_browser_versions_matrix
48+
- name: Download results
49+
uses: actions/download-artifact@v5
50+
with:
51+
path: ./CHANGELOG/${{ inputs.grid-version }}
52+
pattern: 'image_tags_*'
53+
merge-multiple: 'true'
54+
run-id: ${{ inputs.run-id }}
55+
github-token: ${{ secrets.GITHUB_TOKEN }}
56+
- name: Commit configs
57+
run: |
58+
git config --local user.email "selenium-ci@users.noreply.github.com"
59+
git config --local user.name "Selenium CI Bot"
60+
git add .
61+
git commit -m "[ci] Upload CHANGELOG for Node/Standalone ${{ inputs.browser-name }} version with Grid ${{ inputs.grid-version }}" || exit 0
62+
- name: Push changes
63+
if: steps.check-pr.outputs.pr-exists == 'true'
64+
run: git push origin browser-node-changelog
65+
- name: Create Pull Request
66+
if: steps.check-pr.outputs.pr-exists == 'false'
67+
uses: peter-evans/create-pull-request@main
68+
with:
69+
token: ${{ secrets.SELENIUM_CI_TOKEN }}
70+
commit-message: |
71+
[ci] Upload CHANGELOG for Node/Standalone ${{ inputs.browser-name }} version with Grid ${{ inputs.grid-version }}
72+
73+
Browser versions: ${{ inputs.browser-versions }}
74+
title: "[ci] CHANGELOG for Node/Standalone browser versions with Grid ${{ inputs.grid-version }}"
75+
body: "This PR contains the CHANGELOG for Node/Standalone with backward browser versions"
76+
committer: 'Selenium CI Bot <selenium-ci@users.noreply.github.com>'
77+
author: 'Selenium CI Bot <selenium-ci@users.noreply.github.com>'
78+
branch: browser-node-changelog

.github/workflows/release-chrome-versions.yml

Lines changed: 7 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -155,55 +155,12 @@ jobs:
155155
if-no-files-found: ignore
156156

157157
pr-results:
158-
name: Create a PR with changelog
159158
if: (!failure() && !cancelled() && (github.event.inputs.pr-changelog == 'true'))
160-
runs-on: ubuntu-24.04
159+
uses: ./.github/workflows/create-changelog-pr.yml
161160
needs: deploy
162-
steps:
163-
- name: Checkout code
164-
uses: actions/checkout@main
165-
with:
166-
persist-credentials: false
167-
ref: browser-node-changelog
168-
fetch-depth: 0
169-
- name: Get Grid version
170-
run: |
171-
echo "GRID_VERSION=${GRID_VERSION}" >> $GITHUB_ENV
172-
env:
173-
GRID_VERSION: ${{ needs.deploy.outputs.GRID_VERSION }}
174-
- name: Create CHANGELOG directory
175-
run: mkdir -p ./CHANGELOG/${{ env.GRID_VERSION }}
176-
- name: Fetch latest version
177-
run: make update_browser_versions_matrix
178-
- name: Download results
179-
uses: actions/download-artifact@v5
180-
with:
181-
path: ./CHANGELOG/${{ env.GRID_VERSION }}
182-
pattern: 'image_tags_*'
183-
merge-multiple: 'true'
184-
run-id: ${{ env.RUN_ID }}
185-
github-token: ${{ secrets.GITHUB_TOKEN }}
186-
- name: Commit configs
187-
run: |
188-
git config --local user.email "selenium-ci@users.noreply.github.com"
189-
git config --local user.name "Selenium CI Bot"
190-
- name: Create Pull Request
191-
id: cpr
192-
uses: peter-evans/create-pull-request@main
193-
with:
194-
token: ${{ secrets.SELENIUM_CI_TOKEN }}
195-
commit-message: |
196-
[ci] Upload CHANGELOG for Node/Standalone ${{ env.BROWSER_NAME }} version with Grid ${{ env.GRID_VERSION }}
197-
198-
Browser versions: ${{ github.event.inputs.browser-versions }}
199-
title: "[ci] CHANGELOG for Node/Standalone browser versions with Grid ${{ env.GRID_VERSION }}"
200-
body: "This PR contains the CHANGELOG for Node/Standalone with backward browser versions"
201-
committer: 'Selenium CI Bot <selenium-ci@users.noreply.github.com>'
202-
author: 'Selenium CI Bot <selenium-ci@users.noreply.github.com>'
203-
branch: browser-node-changelog
204-
base: trunk
205-
- name: Check outputs
206-
if: ${{ steps.cpr.outputs.pull-request-number }}
207-
run: |
208-
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
209-
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
161+
with:
162+
grid-version: ${{ needs.deploy.outputs.GRID_VERSION }}
163+
browser-name: ${{ github.event.inputs.browser-name }}
164+
browser-versions: ${{ github.event.inputs.browser-versions }}
165+
run-id: ${{ github.run_id }}
166+
secrets: inherit

.github/workflows/release-edge-versions.yml

Lines changed: 7 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -155,55 +155,12 @@ jobs:
155155
if-no-files-found: ignore
156156

157157
pr-results:
158-
name: Create a PR with changelog
159158
if: (!failure() && !cancelled() && (github.event.inputs.pr-changelog == 'true'))
160-
runs-on: ubuntu-24.04
159+
uses: ./.github/workflows/create-changelog-pr.yml
161160
needs: deploy
162-
steps:
163-
- name: Checkout code
164-
uses: actions/checkout@main
165-
with:
166-
persist-credentials: false
167-
ref: browser-node-changelog
168-
fetch-depth: 0
169-
- name: Get Grid version
170-
run: |
171-
echo "GRID_VERSION=${GRID_VERSION}" >> $GITHUB_ENV
172-
env:
173-
GRID_VERSION: ${{ needs.deploy.outputs.GRID_VERSION }}
174-
- name: Create CHANGELOG directory
175-
run: mkdir -p ./CHANGELOG/${{ env.GRID_VERSION }}
176-
- name: Fetch latest version
177-
run: make update_browser_versions_matrix
178-
- name: Download results
179-
uses: actions/download-artifact@v5
180-
with:
181-
path: ./CHANGELOG/${{ env.GRID_VERSION }}
182-
pattern: 'image_tags_*'
183-
merge-multiple: 'true'
184-
run-id: ${{ env.RUN_ID }}
185-
github-token: ${{ secrets.GITHUB_TOKEN }}
186-
- name: Commit configs
187-
run: |
188-
git config --local user.email "selenium-ci@users.noreply.github.com"
189-
git config --local user.name "Selenium CI Bot"
190-
- name: Create Pull Request
191-
id: cpr
192-
uses: peter-evans/create-pull-request@main
193-
with:
194-
token: ${{ secrets.SELENIUM_CI_TOKEN }}
195-
commit-message: |
196-
[ci] Upload CHANGELOG for Node/Standalone ${{ env.BROWSER_NAME }} version with Grid ${{ env.GRID_VERSION }}
197-
198-
Browser versions: ${{ github.event.inputs.browser-versions }}
199-
title: "[ci] CHANGELOG for Node/Standalone browser versions with Grid ${{ env.GRID_VERSION }}"
200-
body: "This PR contains the CHANGELOG for Node/Standalone with backward browser versions"
201-
committer: 'Selenium CI Bot <selenium-ci@users.noreply.github.com>'
202-
author: 'Selenium CI Bot <selenium-ci@users.noreply.github.com>'
203-
branch: browser-node-changelog
204-
base: trunk
205-
- name: Check outputs
206-
if: ${{ steps.cpr.outputs.pull-request-number }}
207-
run: |
208-
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
209-
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
161+
with:
162+
grid-version: ${{ needs.deploy.outputs.GRID_VERSION }}
163+
browser-name: ${{ github.event.inputs.browser-name }}
164+
browser-versions: ${{ github.event.inputs.browser-versions }}
165+
run-id: ${{ github.run_id }}
166+
secrets: inherit

.github/workflows/release-firefox-versions.yml

Lines changed: 7 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -155,55 +155,12 @@ jobs:
155155
if-no-files-found: ignore
156156

157157
pr-results:
158-
name: Create a PR with changelog
159158
if: (!failure() && !cancelled() && (github.event.inputs.pr-changelog == 'true'))
160-
runs-on: ubuntu-24.04
159+
uses: ./.github/workflows/create-changelog-pr.yml
161160
needs: deploy
162-
steps:
163-
- name: Checkout code
164-
uses: actions/checkout@main
165-
with:
166-
persist-credentials: false
167-
ref: browser-node-changelog
168-
fetch-depth: 0
169-
- name: Get Grid version
170-
run: |
171-
echo "GRID_VERSION=${GRID_VERSION}" >> $GITHUB_ENV
172-
env:
173-
GRID_VERSION: ${{ needs.deploy.outputs.GRID_VERSION }}
174-
- name: Create CHANGELOG directory
175-
run: mkdir -p ./CHANGELOG/${{ env.GRID_VERSION }}
176-
- name: Fetch latest version
177-
run: make update_browser_versions_matrix
178-
- name: Download results
179-
uses: actions/download-artifact@v5
180-
with:
181-
path: ./CHANGELOG/${{ env.GRID_VERSION }}
182-
pattern: 'image_tags_*'
183-
merge-multiple: 'true'
184-
run-id: ${{ env.RUN_ID }}
185-
github-token: ${{ secrets.GITHUB_TOKEN }}
186-
- name: Commit configs
187-
run: |
188-
git config --local user.email "selenium-ci@users.noreply.github.com"
189-
git config --local user.name "Selenium CI Bot"
190-
- name: Create Pull Request
191-
id: cpr
192-
uses: peter-evans/create-pull-request@main
193-
with:
194-
token: ${{ secrets.SELENIUM_CI_TOKEN }}
195-
commit-message: |
196-
[ci] Upload CHANGELOG for Node/Standalone ${{ env.BROWSER_NAME }} version with Grid ${{ env.GRID_VERSION }}
197-
198-
Browser versions: ${{ github.event.inputs.browser-versions }}
199-
title: "[ci] CHANGELOG for Node/Standalone browser versions with Grid ${{ env.GRID_VERSION }}"
200-
body: "This PR contains the CHANGELOG for Node/Standalone with backward browser versions"
201-
committer: 'Selenium CI Bot <selenium-ci@users.noreply.github.com>'
202-
author: 'Selenium CI Bot <selenium-ci@users.noreply.github.com>'
203-
branch: browser-node-changelog
204-
base: trunk
205-
- name: Check outputs
206-
if: ${{ steps.cpr.outputs.pull-request-number }}
207-
run: |
208-
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
209-
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
161+
with:
162+
grid-version: ${{ needs.deploy.outputs.GRID_VERSION }}
163+
browser-name: ${{ github.event.inputs.browser-name }}
164+
browser-versions: ${{ github.event.inputs.browser-versions }}
165+
run-id: ${{ github.run_id }}
166+
secrets: inherit

0 commit comments

Comments
 (0)