-
-
Notifications
You must be signed in to change notification settings - Fork 2
52 lines (48 loc) · 1.74 KB
/
Copy pathpython-release.yml
File metadata and controls
52 lines (48 loc) · 1.74 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
name: Manual PyPI Publish
# Mirrors release.yml's manual, button-triggered shape for the Python adapter.
# Unlike npm (NPM_TOKEN), PyPI uses trusted publishing (OIDC) — no secret.
# Bump the version in packages/selenium-devtools-py/pyproject.toml before running.
on:
workflow_dispatch:
inputs:
target:
description: 'Publish target'
required: true
type: choice
default: pypi
options:
- pypi
- testpypi
defaults:
run:
working-directory: packages/selenium-devtools-py
jobs:
release:
runs-on: ubuntu-latest
environment: ${{ inputs.target }}
permissions:
id-token: write # PyPI trusted publishing (OIDC) — no token/secret needed
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: 'main'
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version: '3.12'
- name: 🧪 Unit tests (release guard)
run: PYTHONPATH=src python -m unittest discover -s tests
- name: 📦 Build sdist + wheel
run: |
python -m pip install --upgrade build
python -m build
- name: 🚀 Publish to PyPI
if: ${{ inputs.target == 'pypi' }}
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # release/v1
with:
packages-dir: packages/selenium-devtools-py/dist
- name: 🚀 Publish to TestPyPI
if: ${{ inputs.target == 'testpypi' }}
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # release/v1
with:
packages-dir: packages/selenium-devtools-py/dist
repository-url: https://test.pypi.org/legacy/