Przeglądaj źródła

Updaet main.yml

Alex Gheorghita 3 lat temu
rodzic
commit
7ac9dce59f
1 zmienionych plików z 2 dodań i 3 usunięć
  1. 2 3
      .github/workflows/main.yml

+ 2 - 3
.github/workflows/main.yml

@@ -1,14 +1,14 @@
 name: Publish to PyPI
 name: Publish to PyPI
 
 
 on:
 on:
-    push:
-        branches: [master]
+    create:
 
 
     # Allows you to run this workflow manually from the Actions tab
     # Allows you to run this workflow manually from the Actions tab
     workflow_dispatch:
     workflow_dispatch:
 
 
 jobs:
 jobs:
     build:
     build:
+        if: ${{ startsWith(github.ref, 'refs/tags') }}
         runs-on: ubuntu-latest
         runs-on: ubuntu-latest
         steps:
         steps:
             - name: Prepare repo
             - name: Prepare repo
@@ -40,7 +40,6 @@ jobs:
             #           repository_url: https://test.pypi.org/legacy/
             #           repository_url: https://test.pypi.org/legacy/
 
 
             - name: Publish distribution 📦 to PyPI
             - name: Publish distribution 📦 to PyPI
-              if: ${{ startsWith(github.ref, 'refs/tags') }}
               uses: pypa/gh-action-pypi-publish@master
               uses: pypa/gh-action-pypi-publish@master
               with:
               with:
                   password: ${{ secrets.PIP_API_TOKEN }}
                   password: ${{ secrets.PIP_API_TOKEN }}