Bladeren bron

Merge pull request #1232 from dimbleby/publish-sdist-from-github

publish sdist from github
Jelmer Vernooij 1 jaar geleden
bovenliggende
commit
1e94afdccf
1 gewijzigde bestanden met toevoegingen van 26 en 12 verwijderingen
  1. 26 12
      .github/workflows/python-distributions.yml

+ 26 - 12
.github/workflows/pythonwheels.yml → .github/workflows/python-distributions.yml

@@ -1,4 +1,4 @@
-name: Build Python Wheels
+name: Build Python distributions
 
 on:
   push:
@@ -6,7 +6,7 @@ on:
     - cron: "0 6 * * *" # Daily 6AM UTC build
 
 jobs:
-  build:
+  build-wheels:
     runs-on: ${{ matrix.os }}
     strategy:
       matrix:
@@ -45,22 +45,36 @@ jobs:
         with:
           path: ./wheelhouse/*.whl
 
-  publish:
+  build-sdist:
     runs-on: ubuntu-latest
-
-    needs: build
-    if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/dulwich-')
     steps:
+      - uses: actions/checkout@v3
       - uses: actions/setup-python@v3
-
-      - name: Install twine
+      - name: Install dependencies
         run: |
           python -m pip install --upgrade pip
-          pip install twine
-      - name: Download wheels
+          pip install build
+      - name: Build sdist
+        run: python -m build --sdist
+      - name: Upload sdist
+        uses: actions/upload-artifact@v3
+        with:
+          path: ./dist/*.tar.gz
+
+  publish:
+    runs-on: ubuntu-latest
+    needs:
+      - build-wheels
+      - build-sdist
+    if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/dulwich-')
+    steps:
+      - name: Download distributions
         uses: actions/download-artifact@v2
-      - name: Publish wheels
+        with:
+          name: artifact
+          path: dist
+      - name: Publish distributions
         env:
           TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
           TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
-        run: twine upload artifact/*.whl
+        run: twine upload dist/*