-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (92 loc) · 3.12 KB
/
scipy-openblas32.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
name: scipy-openblas32
on:
workflow_dispatch:
inputs:
app_version:
description: 'Build version'
required: true
default: 'main'
env:
REPO_DIR: OpenBLAS
OPENBLAS_COMMIT: "v0.3.28"
jobs:
build:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
PLAT: [loongarch64]
INTERFACE64: ['0', '1']
MB_ML_VER: ['_2_38']
MB_ML_LIBC: ['manylinux']
env:
NIGHTLY: ${{ github.event_name == 'schedule' }}
MB_ML_LIBC: ${{ matrix.MB_ML_LIBC }}
MB_ML_VER: ${{ matrix.MB_ML_VER }}
INTERFACE64: ${{ matrix.INTERFACE64 }}
BUILD_DIR: ${{ github.workspace }}
PLAT: ${{ matrix.PLAT }}
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
repository: loong64/openblas-libs
ref: ${{ github.event.inputs.app_version }}
submodules: recursive
fetch-depth: 0
- name: Setup QEMU
run: docker run --rm --privileged ghcr.io/loong64/qemu-user-static --reset -p yes
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Install VirtualEnv
run: |
python3 -m pip install --upgrade pip
pip install virtualenv
- name: Build OpenBLAS
run: |
set -xeo pipefail
source tools/build_steps.sh
echo "------ BEFORE BUILD ---------"
before_build
if [[ "$NIGHTLY" = "true" ]]; then
echo "------ CLEAN CODE --------"
clean_code $REPO_DIR develop
echo "------ BUILD LIB --------"
build_lib "$PLAT" "$INTERFACE64" "1"
else
echo "------ CLEAN CODE --------"
clean_code $REPO_DIR $OPENBLAS_COMMIT
echo "------ BUILD LIB --------"
build_lib "$PLAT" "$INTERFACE64" "0"
fi
- name: Build and test wheel
run: |
if [[ "$NIGHTLY" = "true" ]]; then
# Set the pyproject.toml version: convert v0.3.24-30-g138ed79f to 0.3.34.30
version=$(cd OpenBLAS && git describe --tags --abbrev=8 | sed -e "s/^v\(.*\)-g.*/\1/" | sed -e "s/-/./g")
sed -e "s/^version = .*/version = \"${version}\"/" -i.bak pyproject.toml
fi
if [ "macos-13" == "${{ matrix.os }}" ]; then
source tools/build_wheel.sh
else
libc=${MB_ML_LIBC:-manylinux}
docker_image=ghcr.io/loong64/${libc}${MB_ML_VER}_${PLAT}
docker run --rm -e INTERFACE64="${INTERFACE64}" \
-e MB_ML_LIBC="${MB_ML_LIBC}" \
-v $(pwd):/openblas $docker_image \
/bin/bash -xe /openblas/tools/build_wheel.sh
sudo chmod -R a+w dist
fi
- name: Upload wheels
run: |
pip install twine
twine upload --repository-url https://gitlab.com/api/v4/projects/65746188/packages/pypi dist/*.whl
env:
TWINE_USERNAME: ${{ github.repository_owner }}
TWINE_PASSWORD: ${{ secrets.GL_TOKEN }}