-
Notifications
You must be signed in to change notification settings - Fork 1
167 lines (133 loc) · 4.06 KB
/
cd.yml
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
name: CD
on:
push:
tags:
- "v*"
permissions:
id-token: "write"
contents: "write"
packages: "write"
pull-requests: "read"
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Switch to Current Branch
run: git checkout ${{ env.BRANCH }}
- name: Setup Python 3.10.4
uses: actions/setup-python@v3
with:
python-version: "3.10.4"
- name: Setup Poetry
uses: abatilo/actions-poetry@v3
with:
poetry-version: 1.8.2
- name: Install Dependencies
run: |
poetry install --only test
- name: Setup CMake
uses: jwlawson/actions-setup-cmake@v1.13
with:
cmake-version: "3.16.x"
- name: Build
run: |
cmake . -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DBUILD_PYBIND11=ON -DPRINT_BENCHMARK=OFF -DBUILD_TESTS=ON -DBUILD_BENCHMARKS=OFF
make libstreamvbyte libstreamvbyte_tests
- name: Test
run: |
./libstreamvbyte_tests
poetry run python -m pytest ./tests/test.py
build_sdist:
name: Build SDist
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Build SDist
run: pipx run build --sdist
- name: Check metadata
run: pipx run twine check dist/*
- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz
build_wheels:
name: Build wheels of ${{ matrix.version }} ${{ matrix.os }}
runs-on: ${{ matrix.os }}
needs: build_sdist
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
version: [cp38-*, cp39-*, cp310-*, cp311-*, cp312-*, cp313-*]
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Switch to Current Branch
run: git checkout ${{ env.BRANCH }}
- uses: actions/setup-python@v5
- name: Setup QEMU
if: matrix.os == 'ubuntu-latest'
uses: docker/setup-qemu-action@v2
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.19.2
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: ${{ matrix.version }}
CIBW_ARCHS_MACOS: x86_64 arm64
CIBW_ARCHS_LINUX: auto aarch64
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.8"
CIBW_BUILD_VERBOSITY_MACOS: 3
CIBW_PRERELEASE_PYTHONS: True
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
release-pypi:
name: Release to PyPI
needs: build_wheels
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Switch to Current Branch
run: git checkout ${{ env.BRANCH }}
- uses: actions/setup-python@v5
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@v1.6.4
with:
password: ${{ secrets.PYPI_TOKEN }}
verbose: true
release-github:
name: Release to GitHub
needs: build_wheels
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Switch to Current Branch
run: git checkout ${{ env.BRANCH }}
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- name: Release Tagged Version
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: |
dist/**