-
Notifications
You must be signed in to change notification settings - Fork 0
156 lines (149 loc) · 5.56 KB
/
release.yaml
File metadata and controls
156 lines (149 loc) · 5.56 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
name: Release
on:
workflow_dispatch:
push:
tags: ['v*']
defaults:
run:
shell: bash
jobs:
build-wheels:
name: Build wheels on ${{ matrix.os }} for ${{ matrix.cibw_archs }}
runs-on: ${{ matrix.os }}
env:
# 3.9, 3.10 seem to not be happy on windows arm64
# because you can't install numpy from a wheel for the build environment
# (and we're not going to try recompiling from source)
CIBW_SKIP: "cp39-win_arm64 cp310-win_arm64"
# TODO: consider turning this on
# CIBW_ENABLE: cpython-freethreading
CIBW_BEFORE_BUILD_WINDOWS: >-
pip install delvewheel
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: >-
delvewheel repair -w {dest_dir} {wheel}
CIBW_BEFORE_TEST: >-
pip install -r {project}/requirements-only-tests-min-locked.txt
CIBW_TEST_COMMAND: >-
pytest {project}/tests
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
cibw_archs: "x86_64"
- os: ubuntu-24.04-arm
cibw_archs: "aarch64"
- os: windows-2025
cibw_archs: "AMD64"
- os: windows-11-arm
cibw_archs: "ARM64"
- os: macos-13
cibw_archs: "x86_64"
- os: macos-14
cibw_archs: "arm64"
steps:
- uses: actions/checkout@v5
- name: Install Fortran compiler - MacOS
# When building on Mac, we need to have a Fortran compiler
if: ${{ startsWith(matrix.os, 'macos') }}
uses: fortran-lang/setup-fortran@v1
id: setup-fortran-macos
with:
# TODO: figure out whether we need/want to use other compilers too
compiler: "gcc"
version: "13"
- name: Set deployment target - MacOS 13.0
if: ${{ matrix.os == 'macos-13' }}
run: |
echo "MACOSX_DEPLOYMENT_TARGET=13.0" >> $GITHUB_ENV
- name: Set deployment target - MacOS 14.0
if: ${{ matrix.os == 'macos-14' }}
run: |
echo "MACOSX_DEPLOYMENT_TARGET=14.0" >> $GITHUB_ENV
- name: Specify LLVM - windows-arm
if: ${{ matrix.os == 'windows-11-arm' }}
shell: pwsh
run: |
Invoke-WebRequest https://github.com/llvm/llvm-project/releases/download/llvmorg-20.1.8/LLVM-20.1.8-woa64.exe -OutFile LLVM-woa64.exe
Start-Process -FilePath ".\LLVM-woa64.exe" -ArgumentList "/S" -Wait
$env:PATH = "C:\Program Files\LLVM\bin;" + $env:PATH
echo "C:\Program Files\LLVM\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "CC=clang-cl" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "CXX=clang-cl" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "FC=flang-new" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "AR=llvm-lib.exe" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Build wheels
uses: pypa/cibuildwheel@v3.1.4 # matplotlib had v3.1.3
with:
package-dir: .
output-dir: wheelhouse
config-file: "{package}/pyproject.toml"
env:
CIBW_ARCHS: ${{ matrix.cibw_archs }}
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ matrix.cibw_archs }}
path: ./wheelhouse/*.whl
if-no-files-found: error
make-sdist:
name: Make source distribution
runs-on: "ubuntu-latest"
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/actions/setup
with:
python-version: ${{ matrix.python-version }}
uv-dependency-install-flags: "--all-extras --group dev"
- name: Create source distribution
run: uv build --sdist
- name: Upload the source distribution artefact
uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz
draft-release:
name: Create draft release
needs: [ build-wheels, make-sdist ]
strategy:
matrix:
os: [ "ubuntu-latest" ]
python-version: [ "3.11" ]
runs-on: "${{ matrix.os }}"
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/actions/setup
with:
python-version: ${{ matrix.python-version }}
uv-dependency-install-flags: "--all-extras --group dev"
- name: Generate Release Notes
run: |
echo "" >> ".github/release_template.md"
echo "## Changelog" >> ".github/release_template.md"
echo "" >> ".github/release_template.md"
uv run --no-sync python scripts/changelog-to-release-template.py >> ".github/release_template.md"
echo "" >> ".github/release_template.md"
echo "## Changes" >> ".github/release_template.md"
echo "" >> ".github/release_template.md"
git log $(git describe --tags --abbrev=0 HEAD^)..HEAD --pretty='format:* %h %s' --no-merges >> ".github/release_template.md"
- name: Download artifacts
uses: actions/download-artifact@v5
with:
pattern: cibw-*
path: dist
merge-multiple: true
- name: Create Release Draft
uses: softprops/action-gh-release@v2
with:
body_path: ".github/release_template.md"
token: "${{ secrets.PERSONAL_ACCESS_TOKEN }}"
draft: true
files: |
dist/example_fgen_basic-*.whl
dist/example_fgen_basic-*.tar.gz