Repository navigation
78 lines (62 loc) · 1.78 KB
/
Copy pathworkflow.yml
File metadata and controls
78 lines (62 loc) · 1.78 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
name: Release
on:
push:
branches:
- main
permissions:
contents: read
concurrency:
group: release
cancel-in-progress: false
jobs:
release:
runs-on: ubuntu-latest
environment: pypi
permissions:
contents: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v7
with:
ref: ${{ github.ref_name }}
fetch-depth: 0
- name: Reset to the workflow commit
run: git reset --hard ${{ github.sha }}
- name: Setup Python
uses: actions/setup-python@v7
with:
python-version: "3.12"
- name: Install dependencies
run: pip install -e ".[dev]" httpx types-jsonschema
- name: Ruff
run: ruff check .
- name: Mypy
run: mypy .
- name: Generate types
run: python -m decodo.codegen.codegen
- name: Pytest
run: pytest
- name: Release
id: release
uses: python-semantic-release/python-semantic-release@v10.7.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
commit: "false"
changelog: "false"
- name: Build
if: steps.release.outputs.released == 'true'
run: |
pip install build
python -m build
- name: Import typed params from the wheel
if: steps.release.outputs.released == 'true'
run: |
python -m venv /tmp/wheel-env
/tmp/wheel-env/bin/pip install dist/*.whl
cd /tmp && /tmp/wheel-env/bin/python -c "import decodo; assert decodo._codegen_available; from decodo import ScrapeRequest"
- name: Publish to PyPI
if: steps.release.outputs.released == 'true'
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/