Commit b019d922 authored by John Chen's avatar John Chen Committed by Commit Bot

[ChromeDriver] Add scripts for making releases

NOTRY=true

Change-Id: Ibef4ab717ab4bc38313abec958434143a7fb3456
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2053930
Commit-Queue: John Chen <johnchen@chromium.org>
Reviewed-by: default avatarCaleb Rouleau <crouleau@chromium.org>
Cr-Commit-Position: refs/heads/master@{#742698}
parent 1ca4328b
This directory contains scripts used by ChromeDriver team to make public
releases of ChromeDriver.
The following steps are involved:
* Go to the following URL to review bugs fixed in the release, replacing the
trailing 81 with actual ChromeDriver major version number:
https://crbug.com/chromedriver?can=1&sort=id&q=label:ChromeDriver-81
* After reviewing the above page and making and necessary updates, click on the
"CSV" link near the lower-right corner to download the bug list to
~/Download/chromedriver-issues.csv.
* Run Python script `release_notes.py` to generate release notes. It requires
one command line argument, which is the full
[4-part version number](https://www.chromium.org/developers/version-numbers)
of the new release.
The script is hardcoded to read ~/Download/chromedriver-issues.csv,
and save the resulting file in notes.txt in the current directory.
* Run shell script `release.sh` to copy ChromeDriver binaries and release notes
to the release web site. This script takes one argument, the full 4-part
version number of the new release.
Notes:
* If you encounter error that gsutil can't be found, install it with:
sudo apt-get install google-cloud-sdk
* If you encounter permission errors from gsutil, run the following command and
login with an account that has permission to update gs://chromedriver.
gcloud auth login
* If `LATEST_RELEASE` file needs updating, it can be done manually, e.g.,
gsutil cp gs://chromedriver/LATEST_RELEASE_81 gs://chromedriver/LATEST_RELEASE
#!/bin/bash
# Copyright 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Script to release ChromeDriver, by copying it from chrome-unsigned bucket to
# chromedriver bucket.
if [[ $# -ne 1 || -z $1 ]]
then
echo usage: $0 version
exit 1
fi
workdir=`mktemp -d`
if [[ -z $workdir ]]
then
echo Unable to create working directory, exiting
exit 1
fi
echo Working directory: $workdir
cd $workdir
if [[ `pwd` != $workdir ]]
then
echo Failed to chdir to working directory, exiting
exit 1
fi
version=$1
src=from
tgt=to
rm -rf $src
rm -rf $tgt
rm -rf chromedriver_linux64
rm -rf chromedriver_mac64
rm -rf chromedriver_win32
mkdir $src
mkdir $tgt
gsutil cp gs://chrome-unsigned/desktop-5c0tCh/$version/linux64/chromedriver_linux64.zip $src
gsutil cp gs://chrome-unsigned/desktop-5c0tCh/$version/mac64/chromedriver_mac64.zip $src
gsutil cp gs://chrome-unsigned/desktop-5c0tCh/$version/win-clang/chromedriver_win32.zip $src
unzip $src/chromedriver_linux64.zip
unzip $src/chromedriver_mac64.zip
unzip $src/chromedriver_win32.zip
strip chromedriver_linux64/chromedriver
zip -j $tgt/chromedriver_linux64.zip chromedriver_linux64/chromedriver
zip -j $tgt/chromedriver_mac64.zip chromedriver_mac64/chromedriver
zip -j $tgt/chromedriver_win32.zip chromedriver_win32/chromedriver.exe
gsutil cp $tgt/chromedriver_linux64.zip gs://chromedriver/$version/chromedriver_linux64.zip
gsutil cp $tgt/chromedriver_mac64.zip gs://chromedriver/$version/chromedriver_mac64.zip
gsutil cp $tgt/chromedriver_win32.zip gs://chromedriver/$version/chromedriver_win32.zip
echo -n $version > latest
build=`echo $version | sed 's/\.[0-9]\+$//'`
major=`echo $version | sed 's/\.[0-9.]\+$//'`
gsutil -h Content-Type:text/plain cp latest gs://chromedriver/LATEST_RELEASE_$build
gsutil -h Content-Type:text/plain cp latest gs://chromedriver/LATEST_RELEASE_$major
if [[ -f notes.txt ]]
then
gsutil cp notes.txt gs://chromedriver/$version/notes.txt
fi
#!/usr/bin/env python
# Copyright 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Script to generate ChromeDriver release notes.
# Before running this script, download list of fixed issues from
# https://crbug.com/chromedriver?can=1&sort=id&q=label:ChromeDriver-81
# to ~/Download/chromedriver-issues.csv. Output is ./notes.txt.
import csv
import datetime
import os
import sys
if len(sys.argv) != 2:
print 'usage: python %s version' % sys.argv[0]
sys.exit(1)
version = sys.argv[1]
major_version = version.split('.')[0]
notes_name = 'notes.txt'
csv_file = os.path.join(os.getenv('HOME'), 'Downloads',
'chromedriver-issues.csv')
f = open(csv_file, 'r')
lines = f.read().split('\n')
f.close()
fixed_issues = []
seen_header = False
for issue in csv.reader(lines):
if not issue:
continue
if not seen_header:
if issue[0] == 'ID':
for i,title in enumerate(issue):
if title == 'Pri':
pri_col = i
elif title == 'Summary':
summary_col = i
if pri_col is None or summary_col is None:
print 'Missing Pri or Summary in headers'
sys.exit(1)
seen_header = True
continue
issue_id = issue[0]
desc = issue[summary_col]
pri = issue[pri_col]
fixed_issues.append('Resolved issue %s: %s [Pri-%s]' % (issue_id, desc, pri))
new_notes = '---------ChromeDriver %s (%s)---------\n%s\n%s\n' % (
version, datetime.date.today().isoformat(),
'Supports Chrome version %s' % major_version,
'\n'.join(fixed_issues))
with open(notes_name, 'w') as f:
f.write(new_notes)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment