-
Notifications
You must be signed in to change notification settings - Fork 4
124 lines (116 loc) · 3.27 KB
/
cd.yml
File metadata and controls
124 lines (116 loc) · 3.27 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
name: CD
on:
push:
tags: v*
pull_request:
paths:
- pyproject.toml
- meson.*
- .github/workflows/cd.yml
workflow_dispatch:
permissions: {}
jobs:
build_wheels:
name: Build ${{matrix.select}}-${{ matrix.archs }} wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
archs: x86_64
select: '*manylinux*'
id: manylinux_x86_64
- os: ubuntu-latest
archs: x86_64
select: '*musllinux*'
id: musllinux_x86_64
- os: ubuntu-24.04-arm
archs: aarch64
select: '*manylinux*'
id: manylinux_aarch64
- os: ubuntu-24.04-arm
archs: aarch64
select: '*musllinux*'
id: musllinux_aarch64
- os: macos-15-intel
archs: x86_64
select: '*'
id: macos_x86_64
- os: macos-latest
archs: arm64
select: '*'
id: macos_arm64
- os: windows-latest
archs: AMD64
select: '*'
id: windows_AMD64
- os: windows-11-arm
archs: ARM64
select: '*'
id: windows_ARM64
steps:
- name: Checkout repo
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Build wheels for CPython
uses: pypa/cibuildwheel@ee02a1537ce3071a004a6b08c41e72f0fdc42d9a # v3.4.0
env:
CIBW_ARCHS: ${{ matrix.archs }}
CIBW_BUILD: ${{ matrix.select }}
with:
extras: uv
output-dir: dist
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: wheels-${{ matrix.os }}-${{ matrix.id }}
path: dist/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
with:
enable-cache: true
prune-cache: false
- name: Build sdist
run: |
uv sync --only-dev
uv build --sdist
- name: Upload sdist
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: sdist
path: dist/*.tar.gz
deploy:
name: Publish to PyPI
needs:
- build_wheels
- build_sdist
environment:
name: pypi
url: https://pypi.org/p/gpgi
permissions:
id-token: write
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
steps:
- name: Download sdist
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: sdist
path: dist
- name: Download wheels
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
path: dist
pattern: wheels-*
merge-multiple: true
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0