diff --git a/.github/workflows/publish_to_master.yml b/.github/workflows/publish_to_master.yml index d03265d057..3e04435352 100644 --- a/.github/workflows/publish_to_master.yml +++ b/.github/workflows/publish_to_master.yml @@ -13,58 +13,22 @@ jobs: - name: Checkout Repository uses: actions/checkout@v4 - - name: Discover theme bases - id: discover - run: | - # Find directories matching packages/modules/*_themes/* that contain a source/ subdir - mapfile -d $'\0' found < <(find packages/modules -type d -path 'packages/modules/*_themes/*' -print0) - theme_bases=() - for d in "${found[@]}"; do - # trim trailing NUL if any - d="${d%$'\0'}" - if [ -d "$d/source" ]; then - theme_bases+=("$d") - fi - done - - # Prepare newline-separated THEME_BASES output - echo "theme_bases<> $GITHUB_OUTPUT - for b in "${theme_bases[@]}"; do - printf "%s\n" "$b" - done >> $GITHUB_OUTPUT - echo "EOF" >> $GITHUB_OUTPUT - - # Prepare newline-separated cache paths (package-lock.json) - cache_paths="" - for b in "${theme_bases[@]}"; do - cache_paths="${cache_paths}${b}/source/package-lock.json\n" - done - cache_paths=${cache_paths%\\n} - echo "cache_paths<> $GITHUB_OUTPUT - printf "%b" "$cache_paths" >> $GITHUB_OUTPUT - echo "EOF" >> $GITHUB_OUTPUT - - name: Setup Node.js v24 uses: actions/setup-node@v4 with: node-version: 24 cache: npm - cache-dependency-path: ${{ steps.discover.outputs.cache_paths }} + cache-dependency-path: 'packages/modules/*_themes/*/source/package-lock.json' - name: Install dependencies and build all themes run: | - theme_bases_str="${{ steps.discover.outputs.theme_bases }}" - # read into array splitting on newline - IFS=$'\n' read -r -d '' -a THEME_BASES <<< "$theme_bases_str"$'\0' || true - for base in "${THEME_BASES[@]}"; do - echo "Install and build Theme: $base" - if [ -d "$base/source" ]; then - cd "$base/source" + for theme_dir in packages/modules/*_themes/*/; do + if [ -d "$theme_dir/source" ]; then + echo "Building theme: $theme_dir" + cd "$theme_dir/source" npm install npm run build --if-present - cd - - else - echo "Skipping $base - no source directory" + cd - > /dev/null fi done @@ -72,13 +36,10 @@ jobs: run: | git config user.name "GitHub Actions" git config user.email "actions@github.com" - theme_bases_str="${{ steps.discover.outputs.theme_bases }}" - IFS=$'\n' read -r -d '' -a THEME_BASES <<< "$theme_bases_str"$'\0' || true - for base in "${THEME_BASES[@]}"; do - if [ -d "$base/web" ]; then - git add "$base/web" - fi - done + + # Add all built theme files + git add packages/modules/*_themes/*/web/ + if ! git diff --cached --quiet; then git commit -m "Build Themes" git push