File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# Trigger: any `v*` release tag (e.g. v1.40.0).
2- # Can also be queued manually from the ADO UI.
2+ # Can also be queued manually from the ADO UI. A manual 'stable' run is possible only
3+ # on a `release-*` branch: it publishes the images of the last release tag of that
4+ # branch again, from the tip of the branch.
35trigger :
46 tags :
57 include :
Original file line number Diff line number Diff line change @@ -16,6 +16,21 @@ if [[ "${RELEASE_CHANNEL}" != "stable" && "${RELEASE_CHANNEL}" != "canary" ]]; t
1616fi
1717
1818PW_VERSION=$( python -c " from playwright._repo_version import version;print(version)" )
19+ # A stable run on a release branch publishes the images of the last release of that
20+ # branch again, for example with a cherry-picked fix of the image. The commit has no
21+ # tag then, so setuptools-scm gives a dev version: use the version of the last tag,
22+ # also for the wheels that build.sh puts into the image.
23+ if [[ " ${RELEASE_CHANNEL} " == " stable" && " ${BUILD_SOURCEBRANCH:- } " =~ ^refs/heads/release-([0-9]+\. [0-9]+)$ ]]; then
24+ BRANCH_VERSION=" ${BASH_REMATCH[1]} "
25+ LAST_TAG=$( git describe --tags --abbrev=0 --match ' v[0-9]*' )
26+ if [[ ! " ${LAST_TAG} " =~ ^v${BRANCH_VERSION// ./ \\ .} \. [0-9]+$ ]]; then
27+ echo " ERROR: the last tag '${LAST_TAG} ' is not a release of ${BUILD_SOURCEBRANCH} "
28+ exit 1
29+ fi
30+ PW_VERSION=" ${LAST_TAG# v} "
31+ export SETUPTOOLS_SCM_PRETEND_VERSION=" ${PW_VERSION} "
32+ echo " == STABLE build from ${BUILD_SOURCEBRANCH} : publishing as v${PW_VERSION} =="
33+ fi
1934if [[ " ${RELEASE_CHANNEL} " == " stable" && ! " ${PW_VERSION} " =~ ^[0-9]+\. [0-9]+\. [0-9]+$ ]]; then
2035 echo " ERROR: cannot publish stable docker with Playwright version '${PW_VERSION} '"
2136 exit 1
You can’t perform that action at this time.
0 commit comments