Explorar o código

ci: fix release job

LongYinan %!s(int64=5) %!d(string=hai) anos
pai
achega
2d338c0440
Modificáronse 1 ficheiros con 9 adicións e 9 borrados
  1. 9 9
      .github/workflows/CI.yml

+ 9 - 9
.github/workflows/CI.yml

@@ -138,7 +138,6 @@ jobs:
 
   publish:
     name: Publish
-    if: "startsWith(github.event.head_commit.message, 'chore(release): publish')"
     runs-on: ubuntu-latest
     needs: test_binding
 
@@ -169,15 +168,16 @@ jobs:
         run: ls -R .
         shell: bash
 
-      - name: Upload artifacts to Github release
+      - name: Publish
         run: |
-          node ./upload-to-release.js
+          if git log -1 --pretty=%B | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+$";
+          then
+            node ./upload-to-release.js
+            echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
+            npm publish
+          else
+            echo "Not a release, skipping publish"
+          fi
         env:
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-
-      - name: Lerna publish
-        run: |
-          echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
-          npm publish
-        env:
           NPM_TOKEN: ${{ secrets.NPM_TOKEN }}