forked from equinor/xtgeo
-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (75 loc) · 2.33 KB
/
publish.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
name: Build & Publish
on:
pull_request:
branches: [main, "version-*"]
release:
types: [published]
jobs:
build:
name: Python ${{ matrix.python[0] }} on ${{ matrix.os_arch[0] }}-${{ matrix.os_arch[1] }}
runs-on: ${{ matrix.os_arch[0] }}
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
python:
- ['3.8', cp38]
- ['3.9', cp39]
- ['3.10', cp310]
- ['3.11', cp311]
- ['3.12', cp312]
os_arch:
- [ubuntu-latest, manylinux_x86_64]
- [windows-latest, win_amd64]
- [macos-13, macosx_x86_64] # macos-13 is the last x86-64 runner
- [macos-latest, macosx_arm64] # macos-latest is always arm64 going forward
exclude:
- os_arch: [macos-latest, macosx_arm64]
python: ['3.8', cp38]
- os_arch: [macos-latest, macosx_arm64]
python: ['3.9', cp39]
env:
CIBW_BUILD: ${{ matrix.python[1] }}-${{ matrix.os_arch[1] }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python[0] }}
- name: Install HDF5 for macOS arm64
if: ${{ matrix.os_arch[1] == 'macosx_arm64' }}
run: |
brew install hdf5
- name: Install cibuildwheel
run: python -m pip install -U pip wheel cibuildwheel twine
- name: Run cibuildwheel
run: cibuildwheel --output-dir wheelhouse
- name: Check metadata
run: twine check wheelhouse/*
- uses: actions/upload-artifact@v4
if: ${{ github.event_name == 'release' && github.event.action == 'published' }}
with:
name: cibw-${{ env.CIBW_BUILD }}
path: wheelhouse/*.whl
publish:
needs: [build]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
environment:
name: pypi
url: https://pypi.org/project/xtgeo
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
pattern: cibw-*
path: wheelhouse
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true
packages-dir: wheelhouse
verbose: true