-
Notifications
You must be signed in to change notification settings - Fork 2
79 lines (67 loc) · 2.04 KB
/
main.yml
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
name: main
on:
pull_request_review:
push:
branches:
- "*"
jobs:
test:
# if: false
strategy:
matrix:
os: [ubuntu-latest]
py_ver:
- "3.12"
- "3.11"
- "3.10"
- "3.9"
- "3.8"
pw_browser: [chromium, firefox, webkit]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.py_ver }}
- uses: pdm-project/setup-pdm@v3
- run: pdm install
- run: pdm list --graph
- run: pdm run playwright install --with-deps ${{ matrix.pw_browser }}
- run: pdm run pytest --browser=${{ matrix.pw_browser }}
release: # https://github.com/python-semantic-release/python-semantic-release/blob/master/.github/workflows/main.yml
if: ${{ github.ref == 'refs/heads/master' }}
needs:
- test
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
concurrency: release
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: python-semantic-release/python-semantic-release@v8.7.2
id: release
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
root_options: "-vv"
# https://python-semantic-release.readthedocs.io/en/latest/migrating_from_v7.html
- name: Publish package distributions to PyPI
id: pypi-publish
if: steps.release.outputs.released == 'true'
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true
user: ${{ secrets.PYPI_USERNAME }}
password: ${{ secrets.PYPI_PASSWORD }}
- name: Publish package distributions to GitHub Releases
id: github-release
if: steps.release.outputs.released == 'true'
uses: python-semantic-release/upload-to-gh-release@main
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.release.outputs.tag }}