From 65ed8c63499d1801617a1b15479c5cf707e0db14 Mon Sep 17 00:00:00 2001 From: Nicolas Patry Date: Wed, 9 Aug 2023 09:15:33 +0200 Subject: [PATCH] Fixing macos 13 release script (by prebuilding). (#315) * Fixing macos 13 release script (by prebuilding). * Yaml indent... --- .github/workflows/python-release.yml | 47 ++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-release.yml b/.github/workflows/python-release.yml index 56b225e..a1a1456 100644 --- a/.github/workflows/python-release.yml +++ b/.github/workflows/python-release.yml @@ -71,7 +71,7 @@ jobs: create_wheels_others_64bit: - name: Create wheels for other OSes + name: Other OSes env: MACOSX_DEPLOYMENT_TARGET: 10.11 runs-on: ${{ matrix.os }} @@ -115,6 +115,49 @@ jobs: pip install awscli aws s3 sync --exact-timestamps ./bindings/python/dist "s3://safetensors-releases/python/$DIST_DIR" + create_wheels_macos_13: + name: MacOS 13 + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [macos-13] + python: ["3.7", "3.8", "3.9", "3.10", "3.11"] + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + + - name: Install Python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python }} + architecture: x64 + + - name: Install dependencies + run: | + # On old versions of python there is an old version of setuptools already installed + pip install setuptools wheel setuptools-rust==0.11.3 --ignore-installed --force-reinstall + + - name: Build wheel + working-directory: ./bindings/python + run: python setup.py bdist_wheel + + - name: Rename wheels + shell: bash + working-directory: ./bindings/python/dist + run: for file in *.whl ; do mv $file ${file//macosx_10_1[0-9]/macosx_10_11} || true; done + + - name: Upload wheels + shell: bash + run: | + pip install awscli + aws s3 sync --exact-timestamps ./bindings/python/dist "s3://safetensors-releases/python/$DIST_DIR" + create_wheels_macos_arm64: name: Create wheels for MacOS M1 runs-on: macos-arm64 @@ -151,7 +194,7 @@ jobs: Upload_package: name: Upload package to PyPi runs-on: ubuntu-latest - needs: [create_wheels_manylinux, create_wheels_windows_32bit, create_wheels_others_64bit, create_wheels_macos_arm64] + needs: [create_wheels_manylinux, create_wheels_windows_32bit, create_wheels_others_64bit, create_wheels_macos_arm64, create_wheels_macos_13] steps: - uses: actions/checkout@v3 -- 2.43.0