From d66444320646f15769b5ed5549df57e0fdff8306 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com> Date: Wed, 1 Jan 2025 14:09:12 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=85=8D=E7=BD=AE=E4=BB=93=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cffi.yml | 4 +- .github/workflows/cmake.yml | 4 +- .github/workflows/cryptography.yml | 3 ++ .github/workflows/custom.yml | 3 ++ .github/workflows/msgpack.yml | 7 +-- .github/workflows/ninja.yml | 7 +-- .github/workflows/pillow.yml | 4 +- .github/workflows/scipy-openblas32.yml | 70 ++++++++++++++++++++++++++ pip.conf | 3 ++ 9 files changed, 96 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/scipy-openblas32.yml create mode 100644 pip.conf diff --git a/.github/workflows/cffi.yml b/.github/workflows/cffi.yml index c5b8570..6ad0c47 100644 --- a/.github/workflows/cffi.yml +++ b/.github/workflows/cffi.yml @@ -46,6 +46,8 @@ jobs: run: | sudo mkdir -p /home/runner/data/cache/.cache /home/runner/data/cache/dnf sudo chown -R root:docker /home/runner/data/cache + sudo mkdir -p /tmp/pip + sudo wget -O /tmp/pip/pip.conf https://github.com/loong64/buildwheel/raw/refs/heads/master/pip.conf - name: Setup QEMU run: docker run --rm --privileged ghcr.io/loong64/qemu-user-static --reset -p yes @@ -58,10 +60,10 @@ jobs: CIBW_BUILD: ${{ github.event.inputs.build_manylinux }} CIBW_TEST_SKIP: "*" CIBW_BEFORE_ALL_LINUX: > + mv /host/tmp/pip /root/.pip && ln -sf /host/home/runner/data/cache/.cache /root/.cache && ln -sf /host/home/runner/data/cache/dnf /var/cache/dnf && yum install -y ${{ github.event.inputs.build_requires }} - CIBW_ENVIRONMENT_LINUX: "PATH=$HOME/.cargo/bin:$PATH" - name: Upload wheels run: | diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 68f2dbb..333117e 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -46,6 +46,8 @@ jobs: run: | sudo mkdir -p /home/runner/data/cache/.cache /home/runner/data/cache/dnf sudo chown -R root:docker /home/runner/data/cache + sudo mkdir -p /tmp/pip + sudo wget -O /tmp/pip/pip.conf https://github.com/loong64/buildwheel/raw/refs/heads/master/pip.conf - name: Setup QEMU run: docker run --rm --privileged ghcr.io/loong64/qemu-user-static --reset -p yes @@ -58,10 +60,10 @@ jobs: CIBW_BUILD: ${{ github.event.inputs.build_manylinux }} CIBW_TEST_SKIP: "*" CIBW_BEFORE_ALL_LINUX: > + mv /host/tmp/pip /root/.pip && ln -sf /host/home/runner/data/cache/.cache /root/.cache && ln -sf /host/home/runner/data/cache/dnf /var/cache/dnf && yum install -y ${{ github.event.inputs.build_requires }} - CIBW_ENVIRONMENT_LINUX: "PATH=$HOME/.cargo/bin:$PATH" - name: Upload wheels run: | diff --git a/.github/workflows/cryptography.yml b/.github/workflows/cryptography.yml index e2ae458..7587f9d 100644 --- a/.github/workflows/cryptography.yml +++ b/.github/workflows/cryptography.yml @@ -46,6 +46,8 @@ jobs: run: | sudo mkdir -p /home/runner/data/cache/.cache /home/runner/data/cache/dnf sudo chown -R root:docker /home/runner/data/cache + sudo mkdir -p /tmp/pip + sudo wget -O /tmp/pip/pip.conf https://github.com/loong64/buildwheel/raw/refs/heads/master/pip.conf - name: Setup QEMU run: docker run --rm --privileged ghcr.io/loong64/qemu-user-static --reset -p yes @@ -58,6 +60,7 @@ jobs: CIBW_BUILD: ${{ github.event.inputs.build_manylinux }} CIBW_TEST_SKIP: "*" CIBW_BEFORE_ALL_LINUX: > + mv /host/tmp/pip /root/.pip && ln -sf /host/home/runner/data/cache/.cache /root/.cache && ln -sf /host/home/runner/data/cache/dnf /var/cache/dnf && curl -sSf https://sh.rustup.rs | sh -s -- -y && diff --git a/.github/workflows/custom.yml b/.github/workflows/custom.yml index 0848a2f..b225e3d 100644 --- a/.github/workflows/custom.yml +++ b/.github/workflows/custom.yml @@ -46,6 +46,8 @@ jobs: run: | sudo mkdir -p /home/runner/data/cache/.cache /home/runner/data/cache/dnf sudo chown -R root:docker /home/runner/data/cache + sudo mkdir -p /tmp/pip + sudo wget -O /tmp/pip/pip.conf https://github.com/loong64/buildwheel/raw/refs/heads/master/pip.conf - name: Setup QEMU run: docker run --rm --privileged ghcr.io/loong64/qemu-user-static --reset -p yes @@ -58,6 +60,7 @@ jobs: CIBW_BUILD: ${{ github.event.inputs.build_manylinux }} CIBW_TEST_SKIP: "*" CIBW_BEFORE_ALL_LINUX: > + mv /host/tmp/pip /root/.pip && ln -sf /host/home/runner/data/cache/.cache /root/.cache && ln -sf /host/home/runner/data/cache/dnf /var/cache/dnf && curl -sSf https://sh.rustup.rs | sh -s -- -y && diff --git a/.github/workflows/msgpack.yml b/.github/workflows/msgpack.yml index f32da3a..0758b77 100644 --- a/.github/workflows/msgpack.yml +++ b/.github/workflows/msgpack.yml @@ -42,6 +42,8 @@ jobs: run: | sudo mkdir -p /home/runner/data/cache/.cache /home/runner/data/cache/dnf sudo chown -R root:docker /home/runner/data/cache + sudo mkdir -p /tmp/pip + sudo wget -O /tmp/pip/pip.conf https://github.com/loong64/buildwheel/raw/refs/heads/master/pip.conf - name: Setup QEMU run: docker run --rm --privileged ghcr.io/loong64/qemu-user-static --reset -p yes @@ -54,9 +56,8 @@ jobs: CIBW_BUILD: ${{ github.event.inputs.build_manylinux }} CIBW_TEST_SKIP: "*" CIBW_BEFORE_ALL_LINUX: > - ln -sf /host/home/runner/data/cache/.cache /root/.cache && - ln -sf /host/home/runner/data/cache/dnf /var/cache/dnf - CIBW_ENVIRONMENT_LINUX: "PATH=$HOME/.cargo/bin:$PATH" + mv /host/tmp/pip /root/.pip && + ln -sf /host/home/runner/data/cache/.cache /root/.cache - name: Upload wheels run: | diff --git a/.github/workflows/ninja.yml b/.github/workflows/ninja.yml index e314883..7c69fd6 100644 --- a/.github/workflows/ninja.yml +++ b/.github/workflows/ninja.yml @@ -42,6 +42,8 @@ jobs: run: | sudo mkdir -p /home/runner/data/cache/.cache /home/runner/data/cache/dnf sudo chown -R root:docker /home/runner/data/cache + sudo mkdir -p /tmp/pip + sudo wget -O /tmp/pip/pip.conf https://github.com/loong64/buildwheel/raw/refs/heads/master/pip.conf - name: Setup QEMU run: docker run --rm --privileged ghcr.io/loong64/qemu-user-static --reset -p yes @@ -54,9 +56,8 @@ jobs: CIBW_BUILD: ${{ github.event.inputs.build_manylinux }} CIBW_TEST_SKIP: "*" CIBW_BEFORE_ALL_LINUX: > - ln -sf /host/home/runner/data/cache/.cache /root/.cache && - ln -sf /host/home/runner/data/cache/dnf /var/cache/dnf - CIBW_ENVIRONMENT_LINUX: "PATH=$HOME/.cargo/bin:$PATH" + mv /host/tmp/pip /root/.pip && + ln -sf /host/home/runner/data/cache/.cache /root/.cache - name: Upload wheels run: | diff --git a/.github/workflows/pillow.yml b/.github/workflows/pillow.yml index d59a40b..f9e4654 100644 --- a/.github/workflows/pillow.yml +++ b/.github/workflows/pillow.yml @@ -46,6 +46,8 @@ jobs: run: | sudo mkdir -p /home/runner/data/cache/.cache /home/runner/data/cache/dnf sudo chown -R root:docker /home/runner/data/cache + sudo mkdir -p /tmp/pip + sudo wget -O /tmp/pip/pip.conf https://github.com/loong64/buildwheel/raw/refs/heads/master/pip.conf - name: Setup QEMU run: docker run --rm --privileged ghcr.io/loong64/qemu-user-static --reset -p yes @@ -58,10 +60,10 @@ jobs: CIBW_BUILD: ${{ github.event.inputs.build_manylinux }} CIBW_TEST_SKIP: "*" CIBW_BEFORE_ALL_LINUX: > + mv /host/tmp/pip /root/.pip && ln -sf /host/home/runner/data/cache/.cache /root/.cache && ln -sf /host/home/runner/data/cache/dnf /var/cache/dnf && yum install -y ${{ github.event.inputs.build_requires }} - CIBW_ENVIRONMENT_LINUX: "PATH=$HOME/.cargo/bin:$PATH" - name: Upload wheels run: | diff --git a/.github/workflows/scipy-openblas32.yml b/.github/workflows/scipy-openblas32.yml new file mode 100644 index 0000000..4d500d5 --- /dev/null +++ b/.github/workflows/scipy-openblas32.yml @@ -0,0 +1,70 @@ +name: scipy-openblas32 + +on: + workflow_dispatch: + inputs: + app_name: + description: 'Build package' + required: true + default: 'MacPython/openblas-libs' + app_version: + description: 'Build version' + required: true + default: 'latest' + build_manylinux: + description: 'Build manylinux' + required: true + default: 'cp39-manylinux_*' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v4 + with: + repository: ${{ github.event.inputs.app_name }} + ref: ${{ github.event.inputs.app_version }} + + - name: Cache build + uses: actions/cache@v4 + with: + path: | + /home/runner/data/cache + key: ${{ runner.os }}-scipy-openblas32 + restore-keys: | + ${{ runner.os }}-scipy-openblas32 + + - name: Setup Cache + run: | + sudo mkdir -p /home/runner/data/cache/.cache /home/runner/data/cache/dnf + sudo chown -R root:docker /home/runner/data/cache + sudo mkdir -p /tmp/pip + sudo wget -O /tmp/pip/pip.conf https://github.com/loong64/buildwheel/raw/refs/heads/master/pip.conf + + - name: Setup QEMU + run: docker run --rm --privileged ghcr.io/loong64/qemu-user-static --reset -p yes + + - name: Build wheels + uses: loong64/cibuildwheel@main + env: + CIBW_MANYLINUX_LOONGARCH64_IMAGE: manylinux_2_38 + CIBW_ARCHS: loongarch64 + CIBW_BUILD: ${{ github.event.inputs.build_manylinux }} + CIBW_TEST_SKIP: "*" + CIBW_BEFORE_ALL_LINUX: > + mv /host/tmp/pip /root/.pip && + ln -sf /host/home/runner/data/cache/.cache /root/.cache && + ln -sf /host/home/runner/data/cache/dnf /var/cache/dnf && + + - name: Upload wheels + run: | + pip install twine + twine upload --repository-url https://gitlab.com/api/v4/projects/65746188/packages/pypi wheelhouse/*.whl + env: + TWINE_USERNAME: ${{ github.repository_owner }} + TWINE_PASSWORD: ${{ secrets.GL_TOKEN }} + + - name: Cache permissions + run: | + sudo chown -R runner:docker /home/runner/data/cache \ No newline at end of file diff --git a/pip.conf b/pip.conf new file mode 100644 index 0000000..43384d8 --- /dev/null +++ b/pip.conf @@ -0,0 +1,3 @@ +[global] +index-url = https://gitlab.com/api/v4/projects/65746188/packages/pypi/simple +trusted-host = gitlab.com \ No newline at end of file