@@ -19,6 +19,18 @@ permissions:
1919 contents : read
2020
2121jobs :
22+ get-approval :
23+ name : Get Approval
24+ uses : ./.github/workflows/get-approval.yml
25+ with :
26+ title : Release approval needed
27+ message : |
28+ Selenium ${{ github.event.inputs.version }} release preparation started.
29+ Please approve to lock trunk when ready.
30+ secrets :
31+ SLACK_WEBHOOK_URL : ${{ secrets.SLACK_WEBHOOK_URL }}
32+
33+ # Rust jobs run in parallel with approval since work is not on trunk
2234 update-rust :
2335 name : Update Rust Version
2436 runs-on : ubuntu-latest
@@ -82,10 +94,18 @@ jobs:
8294 run : |
8395 git push origin --delete rust-release-${{ github.event.inputs.version }}
8496
97+ restrict-trunk :
98+ name : Restrict Trunk Branch
99+ needs : [get-approval, selenium-manager]
100+ uses : ./.github/workflows/restrict-trunk.yml
101+ with :
102+ restrict : true
103+ secrets : inherit
104+
85105 update-files :
86106 name : Update Files
87107 runs-on : ubuntu-latest
88- needs : selenium-manager
108+ needs : restrict-trunk
89109 steps :
90110 - name : " Checkout project"
91111 uses : actions/checkout@v4
@@ -94,11 +114,8 @@ jobs:
94114 fetch-depth : 0
95115 fetch-tags : true
96116 ref : trunk
97- - name : Install Ruby
98- uses : ruby/setup-ruby@v1
99- with :
100- ruby-version : ' 3.2'
101- working-directory : ' rb'
117+ - name : Get latest trunk
118+ run : git pull --ff-only origin trunk
102119 - name : Setup curl for Ubuntu
103120 run : sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev
104121 - name : Setup Bazel
@@ -116,6 +133,19 @@ jobs:
116133 run : |
117134 git config --local user.email "[email protected] " 118135 git config --local user.name "Selenium CI Bot"
136+ - name : Normalize version
137+ id : version
138+ shell : bash
139+ run : |
140+ VERSION="${{ github.event.inputs.version }}"
141+ VERSION="${VERSION//[[:space:]]/}"
142+ if [[ "$VERSION" =~ ^[0-9]+\.[0-9]+$ ]]; then
143+ VERSION="${VERSION}.0"
144+ elif [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
145+ echo "::error::Invalid version format: '$VERSION'. Expected major.minor or major.minor.patch"
146+ exit 1
147+ fi
148+ echo "value=$VERSION" >> "$GITHUB_OUTPUT"
119149 - name : Update browser versions
120150 id : browsers
121151 run : |
@@ -168,7 +198,7 @@ jobs:
168198 fi
169199 - name : Bump versions
170200 run : |
171- ./go all:version ${{ github.event.inputs.version }}
201+ ./go all:version ${{ steps.version.outputs.value }}
172202 git commit -m "bump versions in preparation for release"
173203 - name : Update changelogs
174204 run : |
@@ -180,9 +210,9 @@ jobs:
180210 token : ${{ secrets.SELENIUM_CI_TOKEN }}
181211 author :
Selenium CI Bot <[email protected] > 182212 delete-branch : true
183- branch : release-preparation-${{ github.event.inputs.version }}
213+ branch : release-preparation-${{ steps.version.outputs.value }}
184214 base : trunk
185- title : " [build] Prepare for release of Selenium ${{ github.event.inputs.version }}"
215+ title : " [build] Prepare for release of Selenium ${{ steps.version.outputs.value }}"
186216 body : |
187217
188218 ### Updates Applied
0 commit comments