diff --git a/.github/workflows/check-package-changes.yml b/.github/workflows/check-package-changes.yml new file mode 100644 index 00000000..1c8ef736 --- /dev/null +++ b/.github/workflows/check-package-changes.yml @@ -0,0 +1,37 @@ +name: Check Package Changes + +on: + pull_request: + branches: + - main + paths: + - 'sdk-*/**' + - 'cli/**' + +jobs: + check-package-changes: + runs-on: ubuntu-latest + permissions: + pull-requests: read + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Check for multiple package changes + run: | + CHANGED_SDKS=$(git diff --name-only origin/${{ github.base_ref }} | grep -E '^sdk-[^/]+/' | cut -d'/' -f1 | sort -u) + CHANGED_CLI=$(git diff --name-only origin/${{ github.base_ref }} | grep -E '^cli/' | cut -d'/' -f1 | sort -u) + + COUNT=$(echo "$CHANGED_SDKS $CHANGED_CLI" | grep -v '^$' | wc -l) + + echo "Changed Packages: $CHANGED_SDKS $CHANGED_CLI" + + if [ "$COUNT" -gt 1 ]; then + echo "Error: Changes detected in multiple packages:" + echo "$CHANGED_SDKS" + echo "$CHANGED_CLI" + echo "Please limit changes to one package at a time." + exit 1 + fi diff --git a/.github/workflows/check-sdk-changes.yml b/.github/workflows/check-sdk-changes.yml deleted file mode 100644 index 05795a6a..00000000 --- a/.github/workflows/check-sdk-changes.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Check SDK Changes - -on: - pull_request: - branches: - - main - paths: - - 'sdk-*/**' - -jobs: - check-sdk-changes: - runs-on: ubuntu-latest - permissions: - pull-requests: read - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Check for multiple SDK changes - run: | - CHANGED_SDKS=$(git diff --name-only origin/${{ github.base_ref }} | grep -E '^sdk-[^/]+/' | cut -d'/' -f1 | sort -u) - SDK_COUNT=$(echo "$CHANGED_SDKS" | grep -v '^$' | wc -l) - - if [ "$SDK_COUNT" -gt 1 ]; then - echo "Error: Changes detected in multiple SDK directories:" - echo "$CHANGED_SDKS" - echo "Please limit changes to one SDK at a time." - exit 1 - fi diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ed7f06d7..12ebdc03 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -46,6 +46,7 @@ jobs: publish-cli: needs: check_changes + if: ${{ needs.check_changes.outputs.cli == 'true' }} runs-on: ubuntu-latest permissions: contents: write @@ -84,6 +85,7 @@ jobs: publish-node: needs: check_changes + if: ${{ needs.check_changes.outputs.sdk_node == 'true' }} runs-on: ubuntu-latest permissions: contents: write @@ -122,6 +124,7 @@ jobs: publish-react: needs: check_changes + if: ${{ needs.check_changes.outputs.sdk_react == 'true' }} runs-on: ubuntu-latest permissions: contents: write @@ -160,6 +163,7 @@ jobs: publish-dotnet: needs: check_changes + if: ${{ needs.check_changes.outputs.sdk_dotnet == 'true' }} runs-on: windows-latest permissions: contents: write @@ -226,6 +230,7 @@ jobs: publish-go: needs: check_changes + if: ${{ needs.check_changes.outputs.sdk_go == 'true' }} runs-on: ubuntu-latest permissions: contents: write diff --git a/cli/README.md b/cli/README.md index 3536d21f..641a3300 100644 --- a/cli/README.md +++ b/cli/README.md @@ -1,4 +1,4 @@ -## inferable.ai CLI +## Inferable CLI ## Installation