Repository navigation
99 lines (92 loc) · 3.36 KB
/
Copy pathrelease-polars.yml
File metadata and controls
99 lines (92 loc) · 3.36 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
96
97
98
99
name: Release Polars plugin
# Push a tag such as polars-v0.1.0. PyPI trusts this workflow directly, so no
# token is stored anywhere.
on:
push:
tags: ["polars-v*"]
# GitHub can deliver one tag push twice; the second run waits for the first.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
permissions:
contents: read
jobs:
check:
runs-on: ubuntu-latest
defaults:
run:
working-directory: native/polars
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- name: Tag is on main
run: git merge-base --is-ancestor "$GITHUB_SHA" origin/main
- uses: dtolnay/rust-toolchain@89b12181fb390509a0842a86cc55eeb8eb928c1d # stable
with:
toolchain: stable
components: clippy, rustfmt
- uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
- name: Tag matches package and crate versions
run: |
test "polars-v$(uv version --short)" = "$GITHUB_REF_NAME"
test "polars-v$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version')" = "$GITHUB_REF_NAME"
- run: cargo fmt --check
- run: cargo clippy --locked -- -D warnings
- run: uv run --group dev ruff format --check .
- run: uv run --group dev ruff check .
- run: uv run --group dev mypy
- run: uv run --group dev pytest
# One wheel per platform serves every Python from 3.10 on, as the extension uses the stable ABI.
wheels:
needs: check
strategy:
matrix:
include:
- { os: ubuntu-latest, target: x86_64 }
- { os: ubuntu-latest, target: aarch64 }
- { os: macos-latest, target: x86_64 }
- { os: macos-latest, target: aarch64 }
- { os: windows-latest, target: x64 }
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
with:
working-directory: native/polars
target: ${{ matrix.target }}
args: --release --locked --out dist
manylinux: auto
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: wheel-${{ matrix.os }}-${{ matrix.target }}
path: native/polars/dist/
sdist:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
with:
working-directory: native/polars
command: sdist
args: --out dist
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: sdist
path: native/polars/dist/
publish:
needs: [wheels, sdist]
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/ng-postcode-polars/
permissions:
id-token: write
steps:
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
path: dist/
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
with:
skip-existing: true