-
Notifications
You must be signed in to change notification settings - Fork 0
135 lines (131 loc) · 4.03 KB
/
build_and_release.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
name: Build and release to PyPI
on:
workflow_dispatch:
inputs:
apbs-release-tag:
description: APBS version to build
required: true
default: 3.4.1
version-tag:
description: Python package version to release to PyPI (without 'v')
required: true
default: 3.4.1.post1
dry-run:
description: Dry run
type: boolean
default: false
jobs:
build-all-platforms:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
pip install uv --break-system-packages
uv tool install build
uv tool install wheel
uv tool install huggingface_hub
huggingface-cli download --repo-type dataset --local-dir data Deargen/py-apbs-binary
- name: Build python wheels
run: |
bash build_python.sh ${{ inputs.apbs-release-tag }} ${{ inputs.version-tag }}
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels
path: dist/*.whl
test-ubuntu:
runs-on: ${{ matrix.os }}
strategy:
matrix:
# python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
# os: [ubuntu-20.04, ubuntu-22.04, ubuntu-24.04]
python-version: ['3.8']
os: [ubuntu-20.04]
needs: [build-all-platforms]
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
path: dist
name: wheels
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Test wheel
run: |
pip install uv --break-system-packages
uv venv
source .venv/bin/activate
uv pip install -r requirements_test.txt
uv pip install dist/*-manylinux*_x86_64.whl
pytest
test-macos:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
# os: [macos-12, macos-13, macos-14, macos-15]
os: [macos-14, macos-15]
needs: [build-all-platforms]
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
path: dist
name: wheels
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Test wheel
run: |
pip install uv --break-system-packages
uv venv --python python3
source .venv/bin/activate
uv pip install -r requirements_test.txt
if [[ ${{ matrix.os }} == 'macos-12' ]] || [[ ${{ matrix.os }} == 'macos-13' ]]; then
uv pip install dist/*-macosx_*_x86_64.whl
else
uv pip install dist/*-macosx_*_arm64.whl
fi
pytest
test-windows:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
os: [windows-2019, windows-2022]
needs: [build-all-platforms]
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
path: dist
name: wheels
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Test wheel
shell: pwsh
run: |
pip install uv --break-system-packages
uv venv
.venv\Scripts\activate
uv pip install -r requirements_test.txt
uv pip install (get-item dist/*-win_amd64.whl)
pytest
release:
name: Release
if: ${{ github.event.inputs.dry-run == 'false' }}
runs-on: ubuntu-24.04
needs: [test-ubuntu, test-macos]
steps:
- uses: actions/download-artifact@v4
with:
path: dist
name: wheels
- name: Build and upload to PyPI
run: |
pip install uv --break-system-packages
uv tool install twine
twine upload dist/* -u __token__ -p ${{ secrets.PYPI_API_TOKEN }} --non-interactive