-
-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1691 from hey-api/fix/publish-packages-turbo
refactor: use Turbo to detect changed packages
- Loading branch information
Showing
8 changed files
with
13 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# @hey-api/docs | ||
# @docs/openapi-ts | ||
|
||
## 0.10.0 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,9 @@ | ||
#!/bin/bash | ||
|
||
if [ -z "$1" ]; then | ||
echo "Error: Base branch not specified. Usage: publish-previews.sh <base-branch>" | ||
exit 1 | ||
fi | ||
|
||
BASE_BRANCH=$1 | ||
result=$(pnpx turbo run build --affected --dry-run=json) | ||
|
||
# ensure we have the latest changes from the remote | ||
git fetch origin | ||
packages=$(echo "$result" | jq -r '.tasks[].directory' | grep '^packages/' | sed 's|^|./|') | ||
|
||
if ! git show-ref --verify --quiet refs/remotes/origin/"$BASE_BRANCH"; then | ||
echo "Error: Base branch '$BASE_BRANCH' not found in the remote repository." | ||
exit 1 | ||
if [ -n "$packages" ]; then | ||
pnpx pkg-pr-new publish --pnpm $packages | ||
fi | ||
|
||
echo "Detecting changed packages compared to $BASE_BRANCH..." | ||
CHANGED_PACKAGES=$(git diff --name-only origin/"$BASE_BRANCH"...HEAD | grep '^packages/' | cut -d '/' -f 2 | sort -u) | ||
|
||
if [ -z "$CHANGED_PACKAGES" ]; then | ||
echo "No changed packages detected." | ||
exit 0 | ||
fi | ||
|
||
PACKAGE_PATHS=$(echo "$CHANGED_PACKAGES" | awk '{printf "./packages/%s ", $1}' | sed 's/ $//') | ||
|
||
echo "Publishing changed packages: $PACKAGE_PATHS" | ||
pnpx pkg-pr-new publish --pnpm $PACKAGE_PATHS |