]> khamidou — GitHub mirrors - safetensors.git/commitdiff
win64 (#343)
authorNicolas Patry <patry.nicolas@protonmail.com>
Thu, 24 Aug 2023 08:16:18 +0000 (10:16 +0200)
committerGitHub <noreply@github.com>
Thu, 24 Aug 2023 08:16:18 +0000 (10:16 +0200)
.github/workflows/python-release.yml

index e36203a529072d994feecc4b889de04eb2621195..31fd80149a472f0d0c55e22f0bb083c84f666176 100644 (file)
@@ -36,6 +36,50 @@ jobs:
         working-directory: ./bindings/python
         run: sh build-wheels.sh
 
+  create_wheels_windows:
+    name: Windows 
+    runs-on: windows-latest
+    needs: [lock_exists]
+    strategy:
+      matrix:
+        python: ["3.7", "3.8", "3.9", "3.10", "3.11"]
+        bits: ["32", "64"]
+    steps:
+      - name: Checkout repository
+        uses: actions/checkout@v2
+
+      - name: Install Rust
+        uses: actions-rs/toolchain@v1
+        with:
+          toolchain: ${{ matrix.bits == '32' && 'stable-i686-pc-windows-msvc' || 'stable-x86_64-pc-windows-msvc' }}
+          override: true
+
+      - name: Override toolchain
+        shell: bash
+        working-directory: ./bindings/python
+        run: echo ${{ matrix.bits == '32' && 'stable-i686-pc-windows-msvc' || 'stable-x86_64-pc-windows-msvc' }} > rust-toolchain
+
+      - name: Install Python
+        uses: actions/setup-python@v4
+        with:
+          python-version: ${{ matrix.python }}
+          architecture: ${{ matrix.bits == '32' && 'x86' || '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 --ignore-installed --force-reinstall
+
+      - name: Build wheel
+        working-directory: ./bindings/python
+        run: python setup.py bdist_wheel
+
+      - 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_windows:
     name: Windows 
     runs-on: windows-latest