-
-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
44 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,9 @@ jobs: | |
os: [macos-latest, ubuntu-latest, windows-latest] | ||
node-version: ['18.20.5', '20.11.1', '22.11.0'] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: pnpm/[email protected] | ||
|
||
|
@@ -35,6 +37,10 @@ jobs: | |
- name: Build packages | ||
run: pnpm --filter './packages/**' run build | ||
|
||
- name: Publish previews | ||
if: matrix.node-version == '22.11.0' && matrix.os == 'ubuntu-latest' | ||
run: ./scripts/publish-previews.sh ${{ github.event.pull_request.base.ref }} | ||
|
||
- name: Build examples | ||
if: matrix.node-version == '22.11.0' && matrix.os == 'ubuntu-latest' | ||
run: pnpm --filter './examples/**' run build | ||
|
@@ -51,6 +57,6 @@ jobs: | |
- name: Run e2e tests | ||
run: pnpm test:e2e | ||
|
||
- name: Publish previews | ||
if: matrix.node-version == '22.11.0' && matrix.os == 'ubuntu-latest' | ||
run: pnpx pkg-pr-new publish --pnpm './packages/*' | ||
# - name: Publish previews | ||
# if: matrix.node-version == '22.11.0' && matrix.os == 'ubuntu-latest' | ||
# run: ../../scripts/publish-previews.sh ${{ github.event.pull_request.base.ref }} |
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 |
---|---|---|
|
@@ -19,7 +19,7 @@ jobs: | |
name: Upload | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/checkout@v4.2.2 | ||
|
||
- uses: pnpm/[email protected] | ||
|
||
|
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 |
---|---|---|
|
@@ -19,7 +19,7 @@ jobs: | |
name: Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/checkout@v4.2.2 | ||
|
||
- uses: pnpm/[email protected] | ||
|
||
|
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
if [ -z "$1" ]; then | ||
echo "Error: Base branch not specified. Usage: publish-previews.sh <base-branch>" | ||
exit 1 | ||
fi | ||
|
||
BASE_BRANCH=$1 | ||
|
||
# ensure we have the latest changes from the remote | ||
git fetch origin | ||
|
||
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 | ||
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 | sed "s/^/packages\//g") | ||
|
||
echo "Publishing changed packages: $PACKAGE_PATHS" | ||
# pnpx pkg-pr-new publish --pnpm $PACKAGE_PATHS | ||
|
||
# pnpx pkg-pr-new publish --pnpm './packages/*' |