]> khamidou — GitHub mirrors - safetensors.git/commitdiff
Fixing macos 13 release script (by prebuilding). (#315)
authorNicolas Patry <patry.nicolas@protonmail.com>
Wed, 9 Aug 2023 07:15:33 +0000 (09:15 +0200)
committerGitHub <noreply@github.com>
Wed, 9 Aug 2023 07:15:33 +0000 (09:15 +0200)
* Fixing macos 13 release script (by prebuilding).

* Yaml indent...

.github/workflows/python-release.yml

index 56b225e8fa23eac8445019972507789175bdada5..a1a1456b6632ef47f7cfe8e578c8126aa4f17439 100644 (file)
@@ -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