Skip to content

Commit 32e5ecf

Browse files
committed
Just build everything
1 parent e80ff61 commit 32e5ecf

File tree

1 file changed

+2
-57
lines changed

1 file changed

+2
-57
lines changed

.github/workflows/BuildPackages.yml

Lines changed: 2 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -9,62 +9,9 @@ on:
99
- packages/**
1010

1111
jobs:
12-
discover:
13-
name: Discover packages to build
14-
runs-on: ubuntu-latest
15-
outputs:
16-
packages: ${{ steps.export.outputs.packages }}
17-
steps:
18-
- name: Checking-out code
19-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
20-
with:
21-
fetch-depth: 0
22-
23-
- name: Find Publishable Packages
24-
run: |
25-
packages=$(
26-
(for package in $(find ./packages -type f -name package.json -depth 2); do
27-
if [[ $(jq '.private != true' "$package") == "true" ]]; then
28-
printf '"%s"\n' $(sed -E 's|^./packages/(.*)/package.json$|\1|' <<< "$package")
29-
fi
30-
done) | jq -c --slurp '.'
31-
)
32-
printf "::debug::All packages: %s" $packages
33-
34-
- name: Find Changed Packages
35-
run: |
36-
changed=$(
37-
git diff --name-only ${{ github.base_ref }}..HEAD \
38-
| grep "packages/.*" \
39-
| sed -E 's|^packages/([^/]*).*$|"\1"|g' \
40-
| jq -c --slurp '. | unique'
41-
)
42-
printf "::debug::Changed packages: %s" $changed
43-
44-
- name: List Packages to Build
45-
id: export
46-
run: |
47-
lock_changed = $(git diff --name-only ${{ github.base_ref }}..HEAD | grep "pnpm-lock.yaml")
48-
49-
if [[ -n "$lock_changed" ]]; then
50-
echo "Build all packages"
51-
echo "packages=$packages" >> "$GITHUB_OUTPUT"
52-
exit 0
53-
fi
54-
55-
to_build=$(jq -n -c --argjson packages "$packages" --argjson changed "$changed" '$packages - ($packages - $changed)')
56-
printf "::debug::Packages to build: %s" "$to_build"
57-
echo "packages=$to_build" >> "$GITHUB_OUTPUT"
58-
5912
build:
6013
name: Build NPM packages
6114
runs-on: ubuntu-latest
62-
needs: discover
63-
if: ${{ needs.discover.outputs.packages != '[]' }}
64-
strategy:
65-
fail-fast: false
66-
matrix:
67-
package: ${{ fromJSON(needs.discover.outputs.packages) }}
6815
steps:
6916
- name: Check-out code
7017
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
@@ -81,10 +28,8 @@ jobs:
8128
cache: 'pnpm'
8229

8330
- name: Install dependencies
84-
working-directory: ./packages/${{ matrix.package }}
8531
run: pnpm install
8632

87-
- name: Pack package
88-
working-directory: ./packages/${{ matrix.package }}
89-
run: pnpm pack
33+
- name: Pack packages
34+
run: pnpm -r pack
9035

0 commit comments

Comments
 (0)