-
Notifications
You must be signed in to change notification settings - Fork 6
139 lines (117 loc) · 3.33 KB
/
build.yaml
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
name: build_and_test
on:
push:
branches:
- main
- master
tags:
- "*"
pull_request:
jobs:
build_and_test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: "setup.cfg"
allow-prereleases: true
- name: Update pip/wheel infrastructure
run: |
python -m pip install --upgrade pip
pip install wheel uv
- name: Install pytest packages
run: uv pip install --system pytest
- name: List installed packages
run: pip list -v
- name: Build and install
run: uv pip install --system -v -e .
- name: Run tests
run: |
pytest test_pal.py
pypi_sdist_build:
runs-on: ubuntu-latest
needs: [build_and_test]
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
# Full git history.
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install dependencies
run: |
pip install --upgrade setuptools wheel build
- name: Build and create distribution
run: |
python -m build --sdist
- uses: actions/upload-artifact@v4
with:
name: palpy-sdist
path: dist/*
pypi_wheel_build:
strategy:
matrix:
os: ["ubuntu-latest", "macos-12"]
runs-on: ${{ matrix.os }}
needs: [build_and_test]
if: startsWith(github.ref, 'refs/tags/')
env:
CIBW_BUILD: "cp3{8,9,10,11,12,13}-{manylinux_x86_64,manylinux_aarch64,macosx_arm64,macosx_x86_64}"
CIBW_ARCHS_MACOS: "x86_64 arm64"
# use line below to enable aarch64 builds
# CIBW_ARCHS_LINUX: "auto aarch64"
CIBW_ARCHS_LINUX: "auto"
steps:
# uncomment when building aarch64
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v2
# if: runner.os == 'Linux'
# with:
# platforms: arm64
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install dependencies
run: |
pip install --upgrade setuptools wheel cibuildwheel
- name: Build and create distribution
run: |
python -m cibuildwheel --output-dir dist
- uses: actions/upload-artifact@v4
with:
name: palpy-${{ matrix.os }}
path: dist/*
pypi-publish:
name: Upload release to PyPI
needs: [pypi_sdist_build, pypi_wheel_build]
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
path: dist
pattern: palpy-*
merge-multiple: true
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1