@@ -99,23 +99,22 @@ jobs:
9999 # Enable vite-node loader using the register() API
100100 export NODE_OPTIONS="--import=${{ github.workspace }}/plugins/vite-node.plugin.loader.mjs"
101101
102- # Build & test (skip for shared-configs)
103- if [ "$PKG_NAME" != "shared-configs" ]; then
104- echo "Building package: $PKG_NAME"
105- pnpm test "$PKG_NAME"
106- pnpm build "$PKG_NAME"
102+
103+ # Only build & test if package is in /packages (skip apps and shared-configs)
104+ if [ -d "packages/$PKG_NAME" ] && [ "$PKG_NAME" != "shared-configs" ]; then
105+ echo "Building package: $PKG_NAME (in /packages)"
106+ pnpm test package "$PKG_NAME"
107+ pnpm build package "$PKG_NAME"
107108 else
108- echo "Skipping build/test for @instructure.ai/ shared-configs."
109+ echo "Skipping build/test for $PKG_NAME (not in /packages or is shared-configs) ."
109110 fi
110111
111- # Publish (use npm CLI to trigger OIDC Trusted Publishing)
112- if [ "$PKG_NAME" != "shared-configs" ]; then
112+
113+ # Publish (only for /packages, skip apps and shared-configs)
114+ if [ -d "packages/$PKG_NAME" ] && [ "$PKG_NAME" != "shared-configs" ]; then
113115 PKG_JSON_PATH="packages/$PKG_NAME/package.json"
114- APP_JSON_PATH="apps/$PKG_NAME/package.json"
115116 if [ -f "$PKG_JSON_PATH" ]; then
116117 JSON_PATH="$PKG_JSON_PATH"
117- elif [ -f "$APP_JSON_PATH" ]; then
118- JSON_PATH="$APP_JSON_PATH"
119118 else
120119 JSON_PATH=""
121120 fi
@@ -141,18 +140,21 @@ jobs:
141140 npm publish "$TARBALL" --provenance
142141 fi
143142 else
144- echo "package.json not found for $PKG_NAME in packages or apps , publishing without access check."
143+ echo "package.json not found for $PKG_NAME in packages, publishing without access check."
145144 npm publish "$TARBALL" --provenance
146145 fi
147146 else
148- echo "Skipping publish for @instructure.ai/ shared-configs."
147+ echo "Skipping publish for $PKG_NAME (not in /packages or is shared-configs) ."
149148 fi
150149
151- # Create GitHub release with or without asset
150+
151+ # Create GitHub release (attach asset only for /packages)
152152 if [ "$PKG_NAME" = "shared-configs" ]; then
153153 gh release create "$TAG" --title "$TAG" --generate-notes
154- else
154+ elif [ -d "packages/$PKG_NAME" ]; then
155155 gh release create "$TAG" ./packages/$PKG_NAME/dist/*.tgz --title "$TAG" --generate-notes
156+ else
157+ gh release create "$TAG" --title "$TAG" --generate-notes
156158 fi
157159 done
158160
0 commit comments