-
Notifications
You must be signed in to change notification settings - Fork 8
119 lines (106 loc) · 3.29 KB
/
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
name: Build wheels
on:
schedule:
- cron: '42 8 2-30/2 * *' # At 08:42 UTC on every 2nd day-of-month
pull_request:
paths: # only run this with PRs that touch these files
- ".github/workflows/release.yml"
- "scripts/build_lib.*"
- "pyproject.toml"
- "setup.py"
push:
branches:
- main
tags:
- "*"
release:
types:
- published
workflow_dispatch:
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}-${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
arch: x86_64
- os: ubuntu-22.04
arch: aarch64
- os: windows-2022
arch: AMD64
- os: macos-13
arch: x86_64
macosx_deployment_target: "13.0"
cmake_osx_architectures: x86_64
- os: macos-14
arch: arm64
macosx_deployment_target: "14.0"
cmake_osx_architectures: arm64
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
if: runner.os == 'Linux' && matrix.arch == 'aarch64'
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- name: Install MinGW-w64 tools (Windows)
if: runner.os == 'Windows'
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
path-type: inherit
install: >-
mingw-w64-x86_64-gcc-fortran
mingw-w64-x86_64-lapack
mingw-w64-x86_64-meson
mingw-w64-x86_64-ninja
- name: Build pestutils (Windows)
if: runner.os == 'Windows'
shell: msys2 {0}
env:
LDFLAGS: -static-libgcc -static-libgfortran -static-libquadmath -Wl,-Bstatic,--whole-archive -lwinpthread -Wl,--no-whole-archive
run: bash scripts/build_lib.sh
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_ENVIRONMENT_MACOS:
FC=gfortran-13
MACOSX_DEPLOYMENT_TARGET='${{ matrix.macosx_deployment_target }}'
CMAKE_OSX_ARCHITECTURES='${{ matrix.cmake_osx_architectures }}'
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ matrix.arch }}
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build sdist
run: pipx run build --sdist
- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz
upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
if: github.event_name == 'release' && github.event.action == 'published'
# or, alternatively, upload to PyPI on every tag starting with 'v' (remove on: release above to use this)
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v4
with:
# unpacks all CIBW artifacts into dist/
pattern: cibw-*
path: dist
merge-multiple: true
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1