-
-
Notifications
You must be signed in to change notification settings - Fork 95
95 lines (84 loc) · 3.09 KB
/
patchright_release.yml
File metadata and controls
95 lines (84 loc) · 3.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Patchright Release Workflow
on:
# enabling manual trigger
workflow_dispatch:
inputs:
version:
description: 'Playwright Version (Base)'
default: ''
patchright_release:
description: 'Patchright Release Version (e.g. `1.55.2`)'
default: ''
# running every hour
schedule:
- cron: '0 * * * *'
env:
REPO: ${{ github.repository }}
jobs:
patchright-release-workflow:
name: "Patchright-Python Workflow: Install, Patch, Build and Publish Patchright Python Package"
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/patchright
permissions:
contents: write
id-token: write # For trusted Publishing
steps:
- name: Checkout Repository
uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Set up Python
run: uv python install
- name: Check Release Version
id: version_check
run: |
echo "patchright_release=${{ github.event.inputs.patchright_release }}" >> $GITHUB_ENV
if [ -n "${{ github.event.inputs.version }}" ]; then
echo "proceed=true" >>$GITHUB_OUTPUT
echo "playwright_version=${{ github.event.inputs.version }}" >> $GITHUB_ENV
else
chmod +x utils/release_version_check.sh
utils/release_version_check.sh
fi
- name: Install Playwright-Python Package
if: steps.version_check.outputs.proceed == 'true'
run: |
uv sync
uv pip install -r requirements-dev.txt
git clone https://github.com/microsoft/playwright-python --branch ${{ env.playwright_version }}
cd playwright-python
uv add -r local-requirements.txt
- name: Patch Playwright-Python Package
if: steps.version_check.outputs.proceed == 'true'
run: |
uv run patch_python_package.py
uvx ruff format playwright-python
- name: Build Patchright-Python Package
if: steps.version_check.outputs.proceed == 'true'
run: |
cd playwright-python
uv pip install -e .
for wheel in $(python setup.py --list-wheels); do
PLAYWRIGHT_TARGET_WHEEL=$wheel uv build --wheel
done
- name: Create Empty Versioning Release
if: steps.version_check.outputs.proceed == 'true'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.playwright_version }}
release_name: ${{ env.playwright_version }}
body: |
This is an automatic deployment in response to a new release of [microsoft/playwright-python](https://github.com/microsoft/playwright-python).
This Release is only used for Versioning.
draft: false
prerelease: false
- name: Publish Patchright-Python Package
if: steps.version_check.outputs.proceed == 'true'
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: playwright-python/dist/
verbose: true