-
Notifications
You must be signed in to change notification settings - Fork 34
172 lines (156 loc) · 4.34 KB
/
Copy pathbuild.yml
File metadata and controls
172 lines (156 loc) · 4.34 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
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
168
169
170
171
172
name: CI
on: [push, pull_request]
jobs:
sdist:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: mamba-org/provision-with-micromamba@main
with:
environment-file: environment.yml
extra-specs: |
meson-python
python-build
- run: |
python -m build . --sdist --outdir . -n ${{ env.SETUP_ARGS }}
env:
SETUP_ARGS: >-
-Csetup-args=-Dxtb-6.5.1:la_backend=netlib
-Csetup-args=-Dmctc-lib:json=disabled
- uses: actions/upload-artifact@v3
with:
name: xtb-python-sdist
path: ./*.tar.gz
retention-days: 5
build:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
python: ['3.7', '3.8', '3.9', '3.10', '3.11']
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: mamba-org/provision-with-micromamba@main
with:
environment-file: environment.yml
extra-specs: |
c-compiler
fortran-compiler
meson-python
python=${{ matrix.python }}
pytest
- name: Setup build of extension module
run: |
pip3 install . ${{ env.SETUP_ARGS }}
env:
SETUP_ARGS: >-
--config-settings setup-args=-Dxtb-6.5.1:la_backend=netlib
- name: Test Python package
run: pytest -v --pyargs xtb
env:
OMP_NUM_THREADS: 2,1
manylinux:
needs:
- sdist
runs-on: ubuntu-latest
container: condaforge/linux-anvil-cos7-x86_64
strategy:
fail-fast: false
matrix:
python: ['3.7', '3.8', '3.9', '3.10', '3.11']
defaults:
run:
shell: ${{ matrix.shell || 'bash -l {0}' }}
steps:
- name: Create environment
run: >-
mamba create -n wheel
--yes
c-compiler
fortran-compiler
python=${{ matrix.python }}
auditwheel
git
python-build
pkg-config
patchelf
cffi
numpy
meson
unzip
wheel
xtb
- name: Download sdist
uses: actions/download-artifact@v2
with:
name: xtb-python-sdist
- name: Build wheel
run: |
conda activate wheel
set -ex
tar xvf xtb-*.tar.gz
python -m build xtb-*/ --wheel ${{ env.SETUP_ARGS }}
auditwheel show xtb-*/dist/*.whl
auditwheel repair -w . xtb-*/dist/*.whl --plat ${{ env.plat }}
env:
plat: manylinux${{ matrix.python == '3.6' && '2010' || '_2_12' }}_x86_64
SETUP_ARGS: >-
-Csetup-args=-Dxtb-6.5.1:la_backend=netlib
-Csetup-args=-Dmctc-lib:json=disabled
- uses: actions/upload-artifact@v3
with:
name: xtb-python-${{ matrix.python }}
path: ./*.whl
retention-days: 5
release:
needs:
- sdist
- manylinux
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v2
with:
path: ${{ github.workspace }} # This will download all files
- name: Create SHA256 checksums
run: |
set -ex
for output in xtb*/xtb*; do
pushd $(dirname "$output")
sha256sum $(basename "$output") | tee $(basename "$output").sha256
popd
done
- name: Copy release artifacts
run: |
mkdir dist/
cp -v xtb*/xtb*.whl xtb*/xtb*.tar.gz dist/
# - name: Publish to Test PyPI
# if: ${{ github.event_name == 'release' }}
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# user: __token__
# password: ${{ secrets.TEST_PYPI_TOKEN }}
# repository_url: https://test.pypi.org/legacy/
- name: Upload assets
uses: svenstaro/upload-release-action@v2
if: ${{ github.event_name == 'release' }}
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: xtb*/xtb*
file_glob: true
tag: ${{ github.ref }}
overwrite: true
# - name: Publish to PyPI
# if: ${{ github.event_name == 'release' }}
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# user: __token__
# password: ${{ secrets.PYPI_TOKEN }}