@@ -2,15 +2,111 @@ name: Release
22
33on :
44 push :
5- tags : ['v*']
5+ # tags: ['v*']
66
77defaults :
88 run :
99 shell : bash
1010
1111jobs :
12+ build-wheels :
13+ name : Build wheels on ${{ matrix.os }} for ${{ matrix.cibw_archs }}
14+ runs-on : ${{ matrix.os }}
15+ env :
16+ # 3.9, 3.10 seem to not be happy on windows arm64
17+ # because you can't install numpy from a wheel for the build environment
18+ # (and we're not going to try recompiling from source)
19+ CIBW_SKIP : " cp39-win_arm64 cp310-win_arm64"
20+ # TODO: consider turning this on
21+ # CIBW_ENABLE: cpython-freethreading
22+ CIBW_BEFORE_BUILD_WINDOWS : >-
23+ pip install delvewheel
24+ CIBW_REPAIR_WHEEL_COMMAND_WINDOWS : >-
25+ delvewheel repair -w {dest_dir} {wheel}
26+ CIBW_BEFORE_TEST : >-
27+ pip install -r {project}/requirements-only-tests-min-locked.txt
28+ CIBW_TEST_COMMAND : >-
29+ pytest {project}/tests
30+ MACOSX_DEPLOYMENT_TARGET : " 13.0"
31+ strategy :
32+ fail-fast : false
33+ matrix :
34+ include :
35+ - os : ubuntu-latest
36+ cibw_archs : " x86_64"
37+ - os : ubuntu-24.04-arm
38+ cibw_archs : " aarch64"
39+ - os : windows-2025
40+ cibw_archs : " AMD64"
41+ - os : windows-11-arm
42+ cibw_archs : " ARM64"
43+ - os : macos-13
44+ cibw_archs : " x86_64"
45+ - os : macos-14
46+ cibw_archs : " arm64"
47+
48+ steps :
49+ - uses : actions/checkout@v5
50+ - name : Install Fortran compiler - MacOS
51+ # When building on Mac, we need to have a Fortran compiler
52+ if : ${{ startsWith(matrix.os, 'macos') }}
53+ uses : fortran-lang/setup-fortran@v1
54+ id : setup-fortran-macos
55+ with :
56+ # TODO: figure out whether we need/want to use other compilers too
57+ compiler : " gcc"
58+ version : " 13"
59+ - name : Specify LLVM - windows-arm
60+ if : ${{ matrix.os == 'windows-11-arm' }}
61+ shell : pwsh
62+ run : |
63+ Invoke-WebRequest https://github.com/llvm/llvm-project/releases/download/llvmorg-20.1.8/LLVM-20.1.8-woa64.exe -OutFile LLVM-woa64.exe
64+ Start-Process -FilePath ".\LLVM-woa64.exe" -ArgumentList "/S" -Wait
65+
66+ $env:PATH = "C:\Program Files\LLVM\bin;" + $env:PATH
67+ echo "C:\Program Files\LLVM\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
68+ echo "CC=clang-cl" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
69+ echo "CXX=clang-cl" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
70+ echo "FC=flang-new" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
71+ echo "AR=llvm-lib.exe" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
72+ - name : Build wheels
73+ uses : pypa/cibuildwheel@v3.1.4 # matplotlib had v3.1.3
74+ with :
75+ package-dir : .
76+ output-dir : wheelhouse
77+ config-file : " {package}/pyproject.toml"
78+ env :
79+ CIBW_ARCHS : ${{ matrix.cibw_archs }}
80+ - name : Upload wheels
81+ uses : actions/upload-artifact@v4
82+ with :
83+ name : cibw-wheels-${{ matrix.os }}-${{ matrix.cibw_archs }}
84+ path : ./wheelhouse/*.whl
85+ if-no-files-found : error
86+
87+ make-sdist :
88+ name : Make source distribution
89+ runs-on : " ubuntu-latest"
90+ steps :
91+ - name : Check out repository
92+ uses : actions/checkout@v4
93+ with :
94+ fetch-depth : 0
95+ - uses : ./.github/actions/setup
96+ with :
97+ python-version : ${{ matrix.python-version }}
98+ uv-dependency-install-flags : " --all-extras --group dev"
99+ - name : Create source distribution
100+ run : uv build --sdist
101+ - name : Upload the source distribution artefact
102+ uses : actions/upload-artifact@v4
103+ with :
104+ name : cibw-sdist
105+ path : dist/*.tar.gz
106+
12107 draft-release :
13108 name : Create draft release
109+ needs : [ build-wheels, make-sdist ]
14110 strategy :
15111 matrix :
16112 os : [ "ubuntu-latest" ]
@@ -29,11 +125,6 @@ jobs:
29125 run : |
30126 PROJECT_VERSION=`sed -ne 's/^version = "\([0-9\.]*\)"/\1/p' pyproject.toml`
31127 echo "PROJECT_VERSION=$PROJECT_VERSION" >> $GITHUB_ENV
32- - name : Build package for PyPI
33- run : |
34- uv build
35- # Just in case, undo the changes to `pyproject.toml`
36- git restore --staged . && git restore .
37128 - name : Generate Release Notes
38129 run : |
39130 echo "" >> ".github/release_template.md"
@@ -44,12 +135,18 @@ jobs:
44135 echo "## Changes" >> ".github/release_template.md"
45136 echo "" >> ".github/release_template.md"
46137 git log $(git describe --tags --abbrev=0 HEAD^)..HEAD --pretty='format:* %h %s' --no-merges >> ".github/release_template.md"
138+ - name : Download artifacts
139+ uses : actions/download-artifact@v5
140+ with :
141+ pattern : cibw-*
142+ path : dist
143+ merge-multiple : true
47144 - name : Create Release Draft
48145 uses : softprops/action-gh-release@v2
49146 with :
50147 body_path : " .github/release_template.md"
51148 token : " ${{ secrets.PERSONAL_ACCESS_TOKEN }}"
52149 draft : true
53150 files : |
54- dist/example_fgen_basic-${{ env.PROJECT_VERSION }}-py3-none-any .whl
151+ dist/example_fgen_basic-${{ env.PROJECT_VERSION }}-* .whl
55152 dist/example_fgen_basic-${{ env.PROJECT_VERSION }}.tar.gz
0 commit comments