Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Re-introduce conditional publishing #161

Merged
merged 1 commit into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/check-package-changes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
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 "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