Skip to content

Commit

Permalink
ci: Re-introduce conditional publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
johnjcsmith committed Nov 28, 2024
1 parent 8064df1 commit 6505c2d
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 32 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/check-package-changes.yml
Original file line number Diff line number Diff line change
@@ -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
31 changes: 0 additions & 31 deletions .github/workflows/check-sdk-changes.yml

This file was deleted.

5 changes: 5 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ jobs:
publish-cli:
needs: check_changes
if: ${{ needs.check_changes.outputs.cli == 'true' }}
runs-on: ubuntu-latest
permissions:
contents: write
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cli/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## inferable.ai CLI
## Inferable CLI

## Installation

Expand Down

0 comments on commit 6505c2d

Please sign in to comment.