Skip to content

Commit 046fa5b

Browse files
committed
ci: fix release flow in case of more than one package modified
1 parent d434489 commit 046fa5b

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

.github/workflows/build.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,18 @@ jobs:
5050
&& (
5151
github.ref == 'refs/heads/main'
5252
)
53-
run: npx nx affected --base=origin/main~1 --head=origin/main -t publish:package
53+
run: |
54+
set -e
55+
PROJECTS=$(npx nx print-affected --base=origin/main~1 --head=origin/main --target=publish:package --select=projects)
56+
PROJECTS=$(echo "$PROJECTS" | tr -d ' ' | tr ',' '\n')
57+
if [ -z "$PROJECTS" ]; then
58+
echo "No affected packages to publish"
59+
exit 0
60+
fi
61+
for PROJECT in $PROJECTS; do
62+
echo "=== Releasing $PROJECT ==="
63+
npx nx run "$PROJECT:publish:package"
64+
done
5465
env:
5566
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
5667
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }}

0 commit comments

Comments
 (0)