]> khamidou — GitHub mirrors - safetensors.git/commitdiff
Fixing release workflow. (#513)
authorNicolas Patry <patry.nicolas@protonmail.com>
Mon, 5 Aug 2024 10:28:27 +0000 (12:28 +0200)
committerGitHub <noreply@github.com>
Mon, 5 Aug 2024 10:28:27 +0000 (12:28 +0200)
.github/workflows/python-release.yml

index ba11dc74e402ec054bba50800bb2ec7ea2ac69c1..87ba613356293362fa9f8da9cb36d10f95371ce3 100644 (file)
@@ -25,7 +25,10 @@ jobs:
     name: build on ${{ matrix.platform || matrix.os }} (${{ matrix.target }} - ${{ matrix.manylinux || 'auto' }})
     # only run on push to main and on release
     needs: [lock_exists]
+
     if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main' || contains(github.event.pull_request.labels.*.name, 'Full Build')
+    outputs:
+      artifact: ${{ steps.artifact-upload-step.outputs.artifact-id }} 
     strategy:
       fail-fast: false
       matrix:
@@ -124,17 +127,17 @@ jobs:
       - run: twine check --strict dist/*
         working-directory: ./bindings/python
 
-      - name: Upload wheels
-        shell: bash
-        run: |
-          pip install awscli
-          aws s3 sync --exact-timestamps ./bindings/python/dist "s3://safetensors-releases/python/$DIST_DIR"
-
-          # - uses: actions/upload-artifact@v3
-          #   working-directory: ./bindings/python/
-          #   with:
-          #     name: pypi_files
-          #     path: dist
+          # - name: Upload wheels
+          #   shell: bash
+          #   run: |
+          #     pip install awscli
+          #     aws s3 sync --exact-timestamps ./bindings/python/dist "s3://safetensors-releases/python/$DIST_DIR"
+
+      - uses: actions/upload-artifact@v4
+        id: artifact-upload-step
+        with:
+          name: pypi_files-${{ matrix.os }}-${{ matrix.target }}-${{ matrix.manylinux }}
+          path: bindings/python/dist
   build-sdist:
     name: build sdist
     needs: [lock_exists]
@@ -147,11 +150,15 @@ jobs:
           command: sdist
           args: --out dist
           rust-toolchain: stable
-      - name: Upload wheels
-        shell: bash
-        run: |
-          pip install awscli
-          aws s3 sync --exact-timestamps ./bindings/python/dist "s3://safetensors-releases/python/$DIST_DIR"
+            # - name: Upload wheels
+            #   shell: bash
+            #   run: |
+            #     pip install awscli
+            #     aws s3 sync --exact-timestamps ./bindings/python/dist "s3://safetensors-releases/python/$DIST_DIR"
+      - uses: actions/upload-artifact@v4
+        with:
+          name: pypi_files-src
+          path: ./bindings/python/dist
 
 
   upload_package:
@@ -168,11 +175,15 @@ jobs:
           python-version: "3.12"
           architecture: x64
 
-      - name: Retrieve all wheels
-        shell: bash
-        run: |
-          pip install awscli
-          aws s3 sync "s3://safetensors-releases/python/$DIST_DIR" ./bindings/python/dist
+            # - name: Retrieve all wheels
+            #   shell: bash
+            #   run: |
+            #     pip install awscli
+            #     aws s3 sync "s3://safetensors-releases/python/$DIST_DIR" ./bindings/python/dist
+      - uses: actions/download-artifact@v4
+        with:
+          path: ./bindings/python/dist
+          merge-multiple: true
 
       - name: Upload to PyPi
         working-directory: ./bindings/python