소스 검색

chore(CI): fix error for workflows

Signed-off-by: zhanghongtong <rory-z@outlook.com>
zhanghongtong 3 년 전
부모
커밋
3c94fc6885

+ 5 - 0
.github/workflows/build_packages.yaml

@@ -1,8 +1,13 @@
 name: Build packages
 
+concurrency:
+  group: build-${{ github.ref }}
+  cancel-in-progress: true
+
 on:
   push:
     tags:
+      - "*"
   pull_request:
   release:
     types:

+ 3 - 3
.github/workflows/check_markdown.yaml

@@ -1,6 +1,6 @@
 name: Check markdown
 
-on: [push, pull_request]
+on: [pull_request]
 
 jobs:
   Markdown_Checker:
@@ -8,7 +8,7 @@ jobs:
     steps:
     - name: Check out code
       uses: actions/checkout@main
-  
+
     - name: Install markdownlint
       run: sudo npm install -g markdownlint-cli
 
@@ -20,6 +20,6 @@ jobs:
     steps:
     - name: Check out code
       uses: actions/checkout@main
-  
+
     - name: Check directory config
       run: python3 .github/workflows/directory_check.py directory.json $(pwd)/docs

+ 0 - 27
.github/workflows/python_sdk.yaml

@@ -1,27 +0,0 @@
-name: Python sdk
-
-on:
-  push:
-    tags:
-  pull_request:
-  release:
-    types:
-      - published
-
-jobs:
-  update:
-    runs-on: ubuntu-latest
-    steps:
-      - uses: actions/checkout@v2
-      - uses: actions/setup-python@v2
-        with:
-          python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
-          architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
-      - run: python3 -m pip install --user --upgrade setuptools wheel twine
-      - working-directory: "sdk/python"
-        run: python3 setup.py sdist bdist_wheel
-      - env:
-          TWINE_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }}
-          TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }}
-        run: python3 -m twine upload --repository-url https://test.pypi.org/legacy/ dist/*
-      - run: python3 -m pip install --index-url https://test.pypi.org/simple/ --no-deps ekuiper

+ 11 - 5
.github/workflows/run_fvt_tests.yaml

@@ -1,11 +1,17 @@
 name: Run fvt tests
 
+concurrency:
+  group: fvt-${{ github.ref }}
+  cancel-in-progress: true
+
 on:
-    push:
-    pull_request:
-    release:
-        types:
-            - published
+  push:
+    tags:
+      - "*"
+  pull_request:
+  release:
+    types:
+      - published
 
 jobs:
     fvt_tests_with_edgex:

+ 11 - 5
.github/workflows/run_test_case.yaml

@@ -1,11 +1,17 @@
 name: Run test cases
 
+concurrency:
+  group: test-${{ github.ref }}
+  cancel-in-progress: true
+
 on:
-    push:
-    pull_request:
-    release:
-        types:
-            - published
+  push:
+    tags:
+      - "*"
+  pull_request:
+  release:
+    types:
+      - published
 
 jobs:
     run_test_case:

+ 44 - 0
.github/workflows/upload_sdk.yaml

@@ -0,0 +1,44 @@
+name: Upload sdk
+
+on:
+  push:
+    tags:
+      - "*"
+  pull_request:
+  release:
+    types:
+      - published
+
+jobs:
+  python:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2
+      - uses: actions/setup-python@v2
+        with:
+          python-version: '3.x'
+          architecture: 'x64'
+      - run: python3 -m pip install --user --upgrade setuptools wheel twine
+      - name: Upload test pypi
+        if: github.event_name != 'release'
+        env:
+          TWINE_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }}
+          TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }}
+        working-directory: "sdk/python"
+        run: |
+          version=$(grep -E ".+version.+" setup.py | sed -r 's [ \t]*version=(.*), \1 g' | sed $'s/\'//g')
+          test_version="${version}-${GITHUB_RUN_ID}"
+          sed -i -r "s|([ \t]*version=).*|\1'$test_version',|1" setup.py
+          python3 setup.py sdist bdist_wheel
+          python3 -m twine upload --skip-existing --repository-url https://test.pypi.org/legacy/ dist/*
+          python3 -m pip install --index-url https://test.pypi.org/simple/ --no-deps ekuiper=="${version}.post${GITHUB_RUN_ID}"
+      - name: Upload test pypi
+        if: github.event_name == 'release'
+        env:
+          TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
+          TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
+        working-directory: "sdk/python"
+        run: |
+          python3 setup.py sdist bdist_wheel
+          python3 -m twine upload --skip-existing dist/*
+          python3 -m pip install --no-deps ekuiper