Repository navigation
80 lines (63 loc) · 1.68 KB
/
Copy pathci-build.yml
File metadata and controls
80 lines (63 loc) · 1.68 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
name: CI
on:
push:
branches:
- main
tags:
- 'v*'
pull_request:
env:
PYTHON_BUILD_VERSION: '3.14'
jobs:
build:
name: Build and Test
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
steps:
- name: Checkout code
uses: actions/checkout@v7.0.1
- name: Setup Python
uses: actions/setup-python@v7.0.0
with:
python-version: ${{ matrix.python-version }}
- name: Setup uv
uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
- name: Install packages
run: uv sync --locked
- name: Check formatting
run: |
make check-format
- name: Check linting
run: |
make check-fix
- name: Run tests
run: make test
- name: Build package
run: uv build
- name: Upload artifacts
if: matrix.python-version == env.PYTHON_BUILD_VERSION
uses: actions/upload-artifact@v7
with:
name: python-package-distributions
path: dist/
publish:
name: Publish to PyPI
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
permissions:
id-token: write
contents: read
environment:
name: release
url: https://pypi.org/p/scraperwiki
steps:
- name: Download artifacts
uses: actions/download-artifact@v8
with:
name: python-package-distributions
path: dist/
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2