Repository navigation
112 lines (100 loc) · 3.81 KB
/
Copy pathpython-package.yml
File metadata and controls
112 lines (100 loc) · 3.81 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
name: Build python wheels
on:
push:
branches:
- main
pull_request:
branches:
- main
types: [opened, synchronize, reopened, labeled]
release:
types:
- published
schedule:
- cron: '0 4 * * 1' # Every Monday at 04:00 UTC
workflow_dispatch:
permissions:
contents: read
# Cancel a PR's previous run when a new commit is pushed. A run started by adding a label waits
# instead of cancelling, so labelling a PR never cancels a full-ci run already in progress.
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: ${{ github.event_name == 'pull_request' && github.event.action != 'labeled' }}
jobs:
build_wheels_cloud:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
# Minutes are billed on the private repo (macOS at about 10x Linux), so this runs there only
# for PRs labelled full-ci or on manual dispatch. The public repo runs it for every event.
# Adding any other label is ignored.
if: >-
(github.event.action != 'labeled' || github.event.label.name == 'full-ci')
&& (github.repository == 'PalamaraLab/ASMC'
|| github.event_name == 'workflow_dispatch'
|| contains(github.event.pull_request.labels.*.name, 'full-ci'))
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-24.04
arch: x86_64
py-vers-full: cp310-* cp311-* cp312-* cp313-* cp314-*
py-vers-pr: cp311-*
before-all: dnf -y install boost-devel zlib
extra-env: ""
mdt: ""
- os: ubuntu-24.04-arm
arch: aarch64
py-vers-full: cp310-* cp311-* cp312-* cp313-* cp314-*
py-vers-pr: cp312-*
before-all: dnf -y install boost-devel zlib
extra-env: ""
mdt: ""
- os: macos-15
arch: arm64
py-vers-full: cp310-* cp311-* cp312-* cp313-* cp314-*
py-vers-pr: cp314-*
before-all: brew install boost zlib libomp
extra-env: CC=clang CXX=clang++
mdt: 15
env:
CIBW_BUILD: ${{ github.event_name != 'pull_request' && matrix.py-vers-full || matrix.py-vers-pr }}
CIBW_SKIP: cp3*-musllinux_*
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
CIBW_BEFORE_ALL: ${{ matrix.before-all }}
CIBW_BEFORE_BUILD: pip install --upgrade pip setuptools wheel ninja numpy cython
CIBW_ENVIRONMENT: ${{ matrix.extra-env }}
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.mdt }}
steps:
- name: checkout repo & submodules
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: true
fetch-depth: 0
persist-credentials: false
- name: Build wheels
uses: pypa/cibuildwheel@f9b966cfadf4109556cadc5bb39ddb72d0ce664e # v4.3.5
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: wheels-cloud-${{ matrix.os }}
path: ./wheelhouse/*.whl
retention-days: 1
upload_all:
name: Upload to PyPI
needs: [build_wheels_cloud]
runs-on: ubuntu-latest
if: ${{ github.event_name == 'release' && github.event.action == 'published' && github.repository == 'PalamaraLab/ASMC' }}
environment: release
permissions:
id-token: write # for PyPI Trusted Publishing
steps:
- name: Download wheels from cloud runners
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
pattern: wheels-cloud-*
merge-multiple: true
path: wheels
- uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
with:
packages_dir: wheels/