Skip to content

Commit c39faa8

Browse files
committed
MAINT: reusable workflow
1 parent 8303599 commit c39faa8

3 files changed

Lines changed: 324 additions & 295 deletions

File tree

.github/workflows/publish.yml

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,23 @@ permissions:
1919

2020

2121
jobs:
22+
########################################
23+
# Workflows to build wheels
2224
call-posix:
2325
uses: ./.github/workflows/posix.yml
2426

25-
# call-windows:
26-
# uses: ./.github/workflows/windows.yml
27-
#
28-
# call-windows-arm:
29-
# uses: ./.github/workflows/windows-arm.yml
3027

31-
download-wheeks:
28+
call-windows:
29+
uses: ./.github/workflows/windows.yml
30+
31+
32+
call-windows-arm:
33+
uses: ./.github/workflows/windows-arm.yml
34+
########################################
35+
36+
download-wheels:
3237
runs-on: ubuntu-latest
33-
needs: [call-posix]
38+
needs: [call-posix, call-windows, call-windows-arm]
3439

3540
steps:
3641
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
@@ -39,3 +44,27 @@ jobs:
3944
pattern: wheels-*
4045
merge-multiple: true
4146
path: dist
47+
48+
49+
check-version:
50+
name: Ensure commit is tag before upload to PyPi
51+
if: github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'pypi'
52+
runs-on: ubuntu-latest
53+
54+
steps:
55+
- name: Checkout openblas-libs
56+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
57+
with:
58+
fetch-depth: 0
59+
fetch-tags: true
60+
submodules: true
61+
persist-credentials: false
62+
63+
- name: Examine git commit
64+
run: |
65+
if [ -n "$(git tag --points-at HEAD)" ]; then
66+
echo "Current HEAD is tagged."
67+
else
68+
echo "Current HEAD is not tagged."
69+
exit 1
70+
fi

.github/workflows/windows-arm.yml

Lines changed: 100 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -1,100 +1,100 @@
1-
#name: Windows-on-ARM
2-
#
3-
#on:
4-
# push:
5-
# branches: [ main ]
6-
# pull_request:
7-
# branches:
8-
# - main
9-
# - maintenance/**
10-
#
11-
#env:
12-
# OPENBLAS_ROOT: "c:\\opt"
13-
# # Preserve working directory for calls into bash
14-
# # Without this, invoking bash will cd to the home directory
15-
# CHERE_INVOKING: "yes"
16-
# BASH_PATH: "C:\\Program Files\\Git\\bin\\bash.exe"
17-
# PLAT: arm64
18-
#
19-
#jobs:
20-
# build:
21-
# runs-on: windows-11-arm
22-
# timeout-minutes: 90
23-
#
24-
# strategy:
25-
# matrix:
26-
# INTERFACE64: ['1', '0']
27-
#
28-
# env:
29-
# INTERFACE64: ${{ matrix.INTERFACE64 }}
30-
#
31-
# steps:
32-
#
33-
# - uses: actions/checkout@v6.0.1
34-
#
35-
# - name: Set up Python
36-
# uses: actions/setup-python@v6.2.0
37-
# with:
38-
# python-version: 3.12
39-
# architecture: arm64
40-
#
41-
# - name: Download and install LLVM installer
42-
# run: |
43-
# Invoke-WebRequest https://github.com/llvm/llvm-project/releases/download/llvmorg-20.1.8/LLVM-20.1.8-woa64.exe -UseBasicParsing -OutFile LLVM-woa64.exe
44-
# Start-Process -FilePath ".\LLVM-woa64.exe" -ArgumentList "/S" -Wait
45-
# echo "C:\Program Files\LLVM\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
46-
#
47-
# - name: Install CMake and Ninja for Win-ARM64
48-
# shell: pwsh
49-
# run: |
50-
# Invoke-WebRequest https://github.com/Kitware/CMake/releases/download/v3.29.4/cmake-3.29.4-windows-arm64.msi -OutFile cmake-arm64.msi
51-
# Start-Process msiexec.exe -ArgumentList "/i cmake-arm64.msi /quiet /norestart" -Wait
52-
# echo "C:\Program Files\CMake\bin" >> $env:GITHUB_PATH
53-
#
54-
# Invoke-WebRequest https://github.com/ninja-build/ninja/releases/download/v1.13.1/ninja-winarm64.zip -OutFile ninja-winarm64.zip
55-
# Expand-Archive ninja-winarm64.zip -DestinationPath ninja
56-
# Copy-Item ninja\ninja.exe -Destination "C:\Windows\System32"
57-
#
58-
# - name: Set env variables
59-
# run: |
60-
# if ( ${{ matrix.INTERFACE64 }} -eq "1" ) {
61-
# echo "INTERFACE_BITS=64" >> $env:GITHUB_ENV
62-
# } else {
63-
# echo "INTERFACE_BITS=32" >> $env:GITHUB_ENV
64-
# }
65-
#
66-
# - name: Build
67-
# run: |
68-
# git submodule update --init --recursive
69-
# .\tools\build_steps_win_arm64.bat 64 ${env:INTERFACE_BITS}
70-
#
71-
# - name: Test ${{ matrix.INTERFACE_BITS }}-bit interface wheel
72-
# run: |
73-
# python -m pip install --no-index --find-links dist scipy_openblas${env:INTERFACE_BITS}
74-
# python -m scipy_openblas${env:INTERFACE_BITS}
75-
# python -c "import scipy_openblas${env:INTERFACE_BITS}; print(scipy_openblas${env:INTERFACE_BITS}.get_pkg_config())"
76-
#
77-
# - uses: actions/upload-artifact@v6.0.0
78-
# with:
79-
# name: wheels-${{ env.PLAT }}-${{ env.INTERFACE64 }}
80-
# path: dist/scipy_openblas*.whl
81-
#
82-
# - name: Install Anaconda client
83-
# run: |
84-
# # Rust installation needed for rpds-py.
85-
# Invoke-WebRequest https://static.rust-lang.org/rustup/dist/aarch64-pc-windows-msvc/rustup-init.exe -UseBasicParsing -Outfile rustup-init.exe
86-
# .\rustup-init.exe -y
87-
# $env:PATH="$env:PATH;$env:USERPROFILE\.cargo\bin"
88-
# # cryptography dropped win-arm64 for 46.0.4, make sure we don't try to compile from source
89-
# pip install --only-binary :all: cryptography
90-
# pip install anaconda-client
91-
#
92-
# - name: Upload
93-
# # see https://github.com/marketplace/actions/setup-miniconda for why
94-
# # `-el {0}` is required.
95-
# shell: bash -el {0}
96-
# env:
97-
# ANACONDA_SCIENTIFIC_PYTHON_UPLOAD: ${{ secrets.ANACONDA_SCIENTIFIC_PYTHON_UPLOAD }}
98-
# run: |
99-
# source tools/upload_to_anaconda_staging.sh
100-
# upload_wheels
1+
name: Windows-on-ARM
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches:
8+
- main
9+
- maintenance/**
10+
11+
env:
12+
OPENBLAS_ROOT: "c:\\opt"
13+
# Preserve working directory for calls into bash
14+
# Without this, invoking bash will cd to the home directory
15+
CHERE_INVOKING: "yes"
16+
BASH_PATH: "C:\\Program Files\\Git\\bin\\bash.exe"
17+
PLAT: arm64
18+
19+
jobs:
20+
build:
21+
runs-on: windows-11-arm
22+
timeout-minutes: 90
23+
24+
strategy:
25+
matrix:
26+
INTERFACE64: ['1', '0']
27+
28+
env:
29+
INTERFACE64: ${{ matrix.INTERFACE64 }}
30+
31+
steps:
32+
33+
- uses: actions/checkout@v6.0.1
34+
35+
- name: Set up Python
36+
uses: actions/setup-python@v6.2.0
37+
with:
38+
python-version: 3.12
39+
architecture: arm64
40+
41+
- name: Download and install LLVM installer
42+
run: |
43+
Invoke-WebRequest https://github.com/llvm/llvm-project/releases/download/llvmorg-20.1.8/LLVM-20.1.8-woa64.exe -UseBasicParsing -OutFile LLVM-woa64.exe
44+
Start-Process -FilePath ".\LLVM-woa64.exe" -ArgumentList "/S" -Wait
45+
echo "C:\Program Files\LLVM\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
46+
47+
- name: Install CMake and Ninja for Win-ARM64
48+
shell: pwsh
49+
run: |
50+
Invoke-WebRequest https://github.com/Kitware/CMake/releases/download/v3.29.4/cmake-3.29.4-windows-arm64.msi -OutFile cmake-arm64.msi
51+
Start-Process msiexec.exe -ArgumentList "/i cmake-arm64.msi /quiet /norestart" -Wait
52+
echo "C:\Program Files\CMake\bin" >> $env:GITHUB_PATH
53+
54+
Invoke-WebRequest https://github.com/ninja-build/ninja/releases/download/v1.13.1/ninja-winarm64.zip -OutFile ninja-winarm64.zip
55+
Expand-Archive ninja-winarm64.zip -DestinationPath ninja
56+
Copy-Item ninja\ninja.exe -Destination "C:\Windows\System32"
57+
58+
- name: Set env variables
59+
run: |
60+
if ( ${{ matrix.INTERFACE64 }} -eq "1" ) {
61+
echo "INTERFACE_BITS=64" >> $env:GITHUB_ENV
62+
} else {
63+
echo "INTERFACE_BITS=32" >> $env:GITHUB_ENV
64+
}
65+
66+
- name: Build
67+
run: |
68+
git submodule update --init --recursive
69+
.\tools\build_steps_win_arm64.bat 64 ${env:INTERFACE_BITS}
70+
71+
- name: Test ${{ matrix.INTERFACE_BITS }}-bit interface wheel
72+
run: |
73+
python -m pip install --no-index --find-links dist scipy_openblas${env:INTERFACE_BITS}
74+
python -m scipy_openblas${env:INTERFACE_BITS}
75+
python -c "import scipy_openblas${env:INTERFACE_BITS}; print(scipy_openblas${env:INTERFACE_BITS}.get_pkg_config())"
76+
77+
- uses: actions/upload-artifact@v6.0.0
78+
with:
79+
name: wheels-${{ env.PLAT }}-${{ env.INTERFACE64 }}
80+
path: dist/scipy_openblas*.whl
81+
82+
- name: Install Anaconda client
83+
run: |
84+
# Rust installation needed for rpds-py.
85+
Invoke-WebRequest https://static.rust-lang.org/rustup/dist/aarch64-pc-windows-msvc/rustup-init.exe -UseBasicParsing -Outfile rustup-init.exe
86+
.\rustup-init.exe -y
87+
$env:PATH="$env:PATH;$env:USERPROFILE\.cargo\bin"
88+
# cryptography dropped win-arm64 for 46.0.4, make sure we don't try to compile from source
89+
pip install --only-binary :all: cryptography
90+
pip install anaconda-client
91+
92+
- name: Upload
93+
# see https://github.com/marketplace/actions/setup-miniconda for why
94+
# `-el {0}` is required.
95+
shell: bash -el {0}
96+
env:
97+
ANACONDA_SCIENTIFIC_PYTHON_UPLOAD: ${{ secrets.ANACONDA_SCIENTIFIC_PYTHON_UPLOAD }}
98+
run: |
99+
source tools/upload_to_anaconda_staging.sh
100+
upload_wheels

0 commit comments

Comments
 (0)