-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (90 loc) · 3.06 KB
/
Copy pathwheels.yml
File metadata and controls
96 lines (90 loc) · 3.06 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
name: Wheels (faker2)
# Build the pure-Rust `faker2` package (PyO3/maturin) for every platform.
# On a `v*` tag the wheels + sdist are attached to the GitHub Release and
# published to PyPI via trusted publishing.
on:
push:
tags: ["v*"]
pull_request:
paths:
- "native/**"
- "rust/**"
- "data/**"
- ".github/workflows/wheels.yml"
workflow_dispatch:
permissions:
contents: write
jobs:
wheels:
name: ${{ matrix.platform }} ${{ matrix.target }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- { platform: linux, runner: ubuntu-latest, target: x86_64, manylinux: auto }
- { platform: linux, runner: ubuntu-latest, target: aarch64, manylinux: auto }
- { platform: macos, runner: macos-latest, target: aarch64, manylinux: "" }
- { platform: macos, runner: macos-latest, target: x86_64, manylinux: "" }
- { platform: windows, runner: windows-latest, target: x64, manylinux: "" }
steps:
- uses: actions/checkout@v4
- name: Stage dataset
shell: bash
run: |
mkdir -p native/python/faker2/data
cp data/first_names.parquet data/balanced_params.json native/python/faker2/data/
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
command: build
args: --release --out dist -m native/Cargo.toml
target: ${{ matrix.target }}
manylinux: ${{ matrix.manylinux }}
- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.platform }}-${{ matrix.target }}
path: dist/*.whl
sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Stage dataset
run: |
mkdir -p native/python/faker2/data
cp data/first_names.parquet data/balanced_params.json native/python/faker2/data/
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist -m native/Cargo.toml
- uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz
release:
needs: [wheels, sdist]
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
environment: pypi # matches the PyPI trusted-publisher config
permissions:
contents: write
id-token: write # PyPI trusted publishing (OIDC)
steps:
- uses: actions/download-artifact@v8
with:
pattern: "{wheels-*,sdist}"
merge-multiple: true
path: dist
- name: Attach to the Release
uses: softprops/action-gh-release@v2
with:
files: dist/*
# One-time PyPI setup: project `faker2` -> Publishing -> add a GitHub
# trusted publisher (owner jqueguiner, repo faker2, workflow wheels.yml,
# environment pypi). Until then this step is skipped, not failed.
- name: Publish to PyPI (trusted publishing)
uses: pypa/gh-action-pypi-publish@release/v1
continue-on-error: true
with:
packages-dir: dist