Skip to content

Commit 036b613

Browse files
authored
[ci] Create pre-release workflow (#13513)
[ci] create pre-release workflow
1 parent fea3262 commit 036b613

File tree

2 files changed

+132
-1
lines changed

2 files changed

+132
-1
lines changed

.github/workflows/ci-rust.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@ name: CI - Rust
22

33
on:
44
workflow_call:
5+
inputs:
6+
release:
7+
required: false
8+
type: string
9+
default: false
10+
branch:
11+
required: false
12+
type: string
13+
default: trunk
514
secrets:
615
SELENIUM_CI_TOKEN:
716
required: true
@@ -43,6 +52,8 @@ jobs:
4352
steps:
4453
- name: "Checkout project"
4554
uses: actions/checkout@v4
55+
with:
56+
ref: ${{ inputs.branch }}
4657
- name: "Update Rust"
4758
run: |
4859
rustup update
@@ -71,6 +82,8 @@ jobs:
7182
steps:
7283
- name: "Checkout project"
7384
uses: actions/checkout@v4
85+
with:
86+
ref: ${{ inputs.branch }}
7487
- name: "Update Rust"
7588
run: |
7689
rustup update
@@ -97,6 +110,8 @@ jobs:
97110
steps:
98111
- name: "Checkout project"
99112
uses: actions/checkout@v4
113+
with:
114+
ref: ${{ inputs.branch }}
100115
- name: "Update Rust"
101116
run: |
102117
rustup update
@@ -125,6 +140,8 @@ jobs:
125140
steps:
126141
- name: "Checkout project"
127142
uses: actions/checkout@v4
143+
with:
144+
ref: ${{ inputs.branch }}
128145
- name: "Update Rust"
129146
run: |
130147
rustup update
@@ -156,6 +173,8 @@ jobs:
156173
steps:
157174
- name: "Checkout project"
158175
uses: actions/checkout@v4
176+
with:
177+
ref: ${{ inputs.branch }}
159178
- name: "Update Rust"
160179
run: |
161180
rustup update
@@ -186,6 +205,8 @@ jobs:
186205
steps:
187206
- name: "Checkout project"
188207
uses: actions/checkout@v4
208+
with:
209+
ref: ${{ inputs.branch }}
189210
- name: "Update Rust"
190211
run: |
191212
rustup update
@@ -212,7 +233,7 @@ jobs:
212233
name: "Release Binaries"
213234
runs-on: ubuntu-latest
214235
needs: [macos-stable, linux-stable, windows-stable, macos-debug, linux-debug, windows-debug]
215-
if: github.event_name != 'schedule' && github.repository_owner == 'seleniumhq' && github.ref == 'refs/heads/trunk'
236+
if: github.event_name != 'schedule' && github.repository_owner == 'seleniumhq' && (github.ref == 'refs/heads/trunk' || inputs.release == 'true')
216237
steps:
217238
- name: "Checkout selenium_manager_artifacts"
218239
uses: actions/checkout@v4

.github/workflows/pre-release.yml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
name: Release Preparation
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Selenium version to release'
8+
required: true
9+
chrome_channel:
10+
description: 'Chrome Channel for CDP'
11+
required: true
12+
type: choice
13+
default: "stable"
14+
options:
15+
- stable
16+
- early-stable
17+
18+
jobs:
19+
update-rust:
20+
name: Update Rust Version
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: "Checkout repo"
24+
uses: actions/checkout@v4
25+
with:
26+
persist-credentials: false
27+
fetch-depth: 0
28+
fetch-tags: true
29+
- name: "Prep git"
30+
run: |
31+
git config --local user.email "[email protected]"
32+
git config --local user.name "Selenium CI Bot"
33+
if git rev-parse --verify release-${{ github.event.inputs.version }} >/dev/null 2>&1; then
34+
git branch -D release-${{ github.event.inputs.version }}
35+
fi
36+
git checkout -b release-${{ github.event.inputs.version }}
37+
- name: Update Rust Version
38+
run: |
39+
./go rust:version
40+
./go rust:version:commit
41+
- name: Push changes
42+
uses: ad-m/github-push-action@master
43+
with:
44+
github_token: ${{ secrets.SELENIUM_CI_TOKEN }}
45+
branch: release-${{ github.event.inputs.version }}
46+
force: true
47+
48+
selenium-manager:
49+
name: Release Selenium Manager
50+
needs: update-rust
51+
uses: ./.github/workflows/ci-rust.yml
52+
with:
53+
release: true
54+
branch: release-${{ github.event.inputs.version }}
55+
secrets:
56+
SELENIUM_CI_TOKEN: ${{ secrets.SELENIUM_CI_TOKEN }}
57+
58+
update-files:
59+
name: Update Files
60+
runs-on: ubuntu-latest
61+
needs: selenium-manager
62+
steps:
63+
- name: "Checkout project"
64+
uses: actions/checkout@v4
65+
with:
66+
persist-credentials: false
67+
fetch-depth: 0
68+
fetch-tags: true
69+
ref: release-${{ github.event.inputs.version }}
70+
- name: Install Ruby
71+
uses: ruby/setup-ruby@ec02537da5712d66d4d50a0f33b7eb52773b5ed1
72+
with:
73+
ruby-version: '3.1'
74+
- name: "Prep git"
75+
run: |
76+
git config --local user.email "[email protected]"
77+
git config --local user.name "Selenium CI Bot"
78+
- name: Undo rust changelog commit
79+
run: git reset HEAD~1
80+
- name: Update everything including early release CDP
81+
if: ${{ github.event.inputs.chrome_channel == 'early-stable' }}
82+
run: ./go all:prepare['Beta']
83+
- name: Update everything including released CDP
84+
if: ${{ github.event.inputs.chrome_channel == 'stable' }}
85+
run: ./go all:prepare
86+
- name: Create Pull Request
87+
uses: peter-evans/create-pull-request@v5
88+
with:
89+
token: ${{ secrets.SELENIUM_CI_TOKEN }}
90+
author: Selenium CI Bot <[email protected]>
91+
delete-branch: true
92+
title: "[build] Prepare for release of Selenium ${{ github.event.inputs.version }}"
93+
body: |
94+
**Warning: Manually update the changelogs before merging**
95+
96+
This PR:
97+
* Updates Rust version for Selenium Manager release
98+
* Updates Pinned browser version to coincide with new CDP release
99+
* Adds support for new CDP version and removes old CDP version
100+
* Selenium Manager references the new Selenium Manager release
101+
* Updates Maven Dependencies
102+
* Adds new authors to authors file
103+
* Updates all versions for all bindings
104+
* Generates *rough* change logs for each bindings (please tidy them up before merging this)
105+
106+
- Auto-generated by [create-pull-request][1]
107+
108+
[1]: https://github.com/peter-evans/create-pull-request
109+
labels: C-build
110+
draft: true

0 commit comments

Comments
 (0)