Skip to content

scipy-openblas32

scipy-openblas32 #5

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 }}