forked from westpa/westpa
-
Notifications
You must be signed in to change notification settings - Fork 0
158 lines (145 loc) · 5.35 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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
name: build
# Build on every branch push, tag push, and pull request change:
#on: [push] #, pull_request]
# Alternatively, to publish when a (published) GitHub Release is created, use the following:
on:
push:
branches:
- 'westpa2'
- 'develop'
tags:
- 'v*'
pull_request:
branches:
- 'westpa2'
release:
types:
- published
jobs:
build_wheels:
name: Build py3.${{ matrix.python-version }} wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["ubuntu-latest", "macos-13", "macos-latest"] # macos-13 is x86_64, macos-latest is arm64
python-version: [8, 9, 10, 11, 12] # sub-versions of Python
exclude:
- os: macos-14
python-version: 8
steps:
- uses: actions/checkout@v4
- name: "Install HDF5 with brew"
if: ${{ matrix.os == 'macos-latest' }}
run: "brew install hdf5"
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_SKIP: "pp* *-musllinux*"
CIBW_BUILD: "cp3${{ matrix.python-version }}-*"
CIBW_ARCHS_MACOS: "auto64" # x86_64 and arm64, depending on the os
CIBW_ARCHS_LINUX: "auto64" # x86_64 only
CIBW_DEPENDENCY_VERSIONS: "latest"
CIBW_TEST_COMMAND: >
python -c "import westpa; print(westpa.__version__)" &&
python -c "import westpa.core.propagators" &&
python -c "import westpa.core.binning" &&
python -c "import westpa.core.kinetics" &&
python -c "import westpa.core.reweight" &&
python -c "import westpa.work_managers" &&
python -c "import westpa.tools" &&
python -c "import westpa.fasthist" &&
python -c "import westpa.mclib" &&
echo "All done with the import tests!"
# Currently blocked by https://github.com/westpa/westpa/issues/70
#python -c "import westpa.trajtree"
with:
package-dir: .
output-dir: wheelhouse
config-file: "{package}/pyproject.toml"
- uses: actions/upload-artifact@v4
with:
name: artifact-wheels-${{ matrix.os }}-${{ matrix.python-version }}
path: ./wheelhouse/*.whl
overwrite: true
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Build sdist
run: pipx run build --sdist
- name: Install from sdist and import
run: |
python -m pip install dist/*.tar.gz &&
python -c "import westpa; print(westpa.__version__)" &&
python -c "import westpa.core.propagators" &&
python -c "import westpa.core.binning" &&
python -c "import westpa.core.kinetics" &&
python -c "import westpa.core.reweight" &&
python -c "import westpa.work_managers" &&
python -c "import westpa.tools" &&
python -c "import westpa.fasthist" &&
python -c "import westpa.mclib" &&
echo "All done with the import tests!"
# Currently blocked by https://github.com/westpa/westpa/issues/70
# python -c "import westpa.trajtree"
- uses: actions/upload-artifact@v4
with:
name: artifact-sdist
path: dist/*.tar.gz
overwrite: true
upload_testpypi:
name: test.pypi
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
environment:
name: test.pypi
url: https://test.pypi.org/p/westpa
permissions:
id-token: write
# upload to test.PyPI on every tag starting with 'v'; only in westpa/westpa repository
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
# alternatively, to publish when a GitHub Release is created, use the following rule:
if: |
github.repository == 'westpa/westpa' &&
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v'))
steps:
- uses: actions/download-artifact@v4
with:
# unpacks default artifact into dist/
# if `name: artifact` is omitted, the action will create extra parent dir
pattern: artifact-*
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1
with:
repository_url: https://test.pypi.org/legacy/
upload_pypi:
name: PyPI
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/westpa
permissions:
id-token: write
# upload to PyPI on every tag starting with 'v'
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
# alternatively, to publish when a GitHub Release is created, use the following rule:
if: |
github.repository == 'westpa/westpa' &&
(github.event_name == 'release' && github.event.action == 'published')
steps:
- uses: actions/download-artifact@v4
with:
# unpacks default artifact into dist/
# if `name: artifact` is omitted, the action will create extra parent dir
pattern: artifact-*
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1
# To test:
#repository_url: https://test.pypi.org/legacy/