From 8fb71860682f82374a1ac1b1da97933b284e5e76 Mon Sep 17 00:00:00 2001 From: George Cushen Date: Sat, 2 May 2026 02:59:21 +0100 Subject: [PATCH] fix(templates): make shipped build.yml compatible with Hugo v0.161 The shipped per-template GitHub Actions build workflow still pinned Node 20 and fell back to Hugo 0.154.5 on missing config - both incompatible with Hugo v0.161's css.TailwindCSS Node permission sandbox (Node >= 22, npm @tailwindcss/cli required). Sites upgraded via `hugoblox upgrade` (which only touches go.mod) hit this immediately. - Bump NODE_VERSION 20 -> 22 in all 9 templates' .github/workflows/build.yml - Bump fallback DEFAULT_VERSION 0.154.5 -> 0.161.0 to match the framework's new module.hugoVersion.min - Add a "Verify Tailwind CSS dependency" step that fails fast with an actionable ::error message if @tailwindcss/cli is not resolvable, replacing Hugo's cryptic "binary tailwindcss is not a Node.js script" --- templates/academic-cv/.github/workflows/build.yml | 14 ++++++++++++-- .../data-science-blog/.github/workflows/build.yml | 14 ++++++++++++-- .../dev-portfolio/.github/workflows/build.yml | 14 ++++++++++++-- .../documentation/.github/workflows/build.yml | 14 ++++++++++++-- templates/link-in-bio/.github/workflows/build.yml | 14 ++++++++++++-- .../markdown-slides/.github/workflows/build.yml | 14 ++++++++++++-- templates/resume/.github/workflows/build.yml | 14 ++++++++++++-- templates/starter/.github/workflows/build.yml | 14 ++++++++++++-- .../.github/workflows/build.yml | 14 ++++++++++++-- 9 files changed, 108 insertions(+), 18 deletions(-) diff --git a/templates/academic-cv/.github/workflows/build.yml b/templates/academic-cv/.github/workflows/build.yml index 07d4a2a9..bc47e333 100644 --- a/templates/academic-cv/.github/workflows/build.yml +++ b/templates/academic-cv/.github/workflows/build.yml @@ -1,7 +1,7 @@ name: Build env: - NODE_VERSION: '20' + NODE_VERSION: '22' on: # Standalone trigger for PR validation @@ -65,7 +65,7 @@ jobs: VERSION=$(yq '.build.hugo_version // ""' hugoblox.yaml 2>/dev/null | grep -v '^null$' || true) # Fallback to a known stable version if not specified - DEFAULT_VERSION="0.154.5" + DEFAULT_VERSION="0.161.0" VERSION=${VERSION:-$DEFAULT_VERSION} # Validate version format (basic check) @@ -85,6 +85,16 @@ jobs: pnpm install --no-frozen-lockfile || npm install fi + - name: Verify Tailwind CSS dependency + if: hashFiles('package.json') != '' + run: | + if ! node -e "require.resolve('@tailwindcss/cli/package.json')" 2>/dev/null; then + echo "::error title=Missing dependency '@tailwindcss/cli'::Hugo >= 0.161.0 requires the npm @tailwindcss/cli package. Add it to package.json:" + echo "::error:: pnpm add @tailwindcss/cli tailwindcss" + echo "::error::See https://github.com/HugoBlox/kit for upgrade instructions." + exit 1 + fi + - name: Setup Hugo uses: peaceiris/actions-hugo@v3 with: diff --git a/templates/data-science-blog/.github/workflows/build.yml b/templates/data-science-blog/.github/workflows/build.yml index 07d4a2a9..bc47e333 100644 --- a/templates/data-science-blog/.github/workflows/build.yml +++ b/templates/data-science-blog/.github/workflows/build.yml @@ -1,7 +1,7 @@ name: Build env: - NODE_VERSION: '20' + NODE_VERSION: '22' on: # Standalone trigger for PR validation @@ -65,7 +65,7 @@ jobs: VERSION=$(yq '.build.hugo_version // ""' hugoblox.yaml 2>/dev/null | grep -v '^null$' || true) # Fallback to a known stable version if not specified - DEFAULT_VERSION="0.154.5" + DEFAULT_VERSION="0.161.0" VERSION=${VERSION:-$DEFAULT_VERSION} # Validate version format (basic check) @@ -85,6 +85,16 @@ jobs: pnpm install --no-frozen-lockfile || npm install fi + - name: Verify Tailwind CSS dependency + if: hashFiles('package.json') != '' + run: | + if ! node -e "require.resolve('@tailwindcss/cli/package.json')" 2>/dev/null; then + echo "::error title=Missing dependency '@tailwindcss/cli'::Hugo >= 0.161.0 requires the npm @tailwindcss/cli package. Add it to package.json:" + echo "::error:: pnpm add @tailwindcss/cli tailwindcss" + echo "::error::See https://github.com/HugoBlox/kit for upgrade instructions." + exit 1 + fi + - name: Setup Hugo uses: peaceiris/actions-hugo@v3 with: diff --git a/templates/dev-portfolio/.github/workflows/build.yml b/templates/dev-portfolio/.github/workflows/build.yml index 07d4a2a9..bc47e333 100644 --- a/templates/dev-portfolio/.github/workflows/build.yml +++ b/templates/dev-portfolio/.github/workflows/build.yml @@ -1,7 +1,7 @@ name: Build env: - NODE_VERSION: '20' + NODE_VERSION: '22' on: # Standalone trigger for PR validation @@ -65,7 +65,7 @@ jobs: VERSION=$(yq '.build.hugo_version // ""' hugoblox.yaml 2>/dev/null | grep -v '^null$' || true) # Fallback to a known stable version if not specified - DEFAULT_VERSION="0.154.5" + DEFAULT_VERSION="0.161.0" VERSION=${VERSION:-$DEFAULT_VERSION} # Validate version format (basic check) @@ -85,6 +85,16 @@ jobs: pnpm install --no-frozen-lockfile || npm install fi + - name: Verify Tailwind CSS dependency + if: hashFiles('package.json') != '' + run: | + if ! node -e "require.resolve('@tailwindcss/cli/package.json')" 2>/dev/null; then + echo "::error title=Missing dependency '@tailwindcss/cli'::Hugo >= 0.161.0 requires the npm @tailwindcss/cli package. Add it to package.json:" + echo "::error:: pnpm add @tailwindcss/cli tailwindcss" + echo "::error::See https://github.com/HugoBlox/kit for upgrade instructions." + exit 1 + fi + - name: Setup Hugo uses: peaceiris/actions-hugo@v3 with: diff --git a/templates/documentation/.github/workflows/build.yml b/templates/documentation/.github/workflows/build.yml index 07d4a2a9..bc47e333 100644 --- a/templates/documentation/.github/workflows/build.yml +++ b/templates/documentation/.github/workflows/build.yml @@ -1,7 +1,7 @@ name: Build env: - NODE_VERSION: '20' + NODE_VERSION: '22' on: # Standalone trigger for PR validation @@ -65,7 +65,7 @@ jobs: VERSION=$(yq '.build.hugo_version // ""' hugoblox.yaml 2>/dev/null | grep -v '^null$' || true) # Fallback to a known stable version if not specified - DEFAULT_VERSION="0.154.5" + DEFAULT_VERSION="0.161.0" VERSION=${VERSION:-$DEFAULT_VERSION} # Validate version format (basic check) @@ -85,6 +85,16 @@ jobs: pnpm install --no-frozen-lockfile || npm install fi + - name: Verify Tailwind CSS dependency + if: hashFiles('package.json') != '' + run: | + if ! node -e "require.resolve('@tailwindcss/cli/package.json')" 2>/dev/null; then + echo "::error title=Missing dependency '@tailwindcss/cli'::Hugo >= 0.161.0 requires the npm @tailwindcss/cli package. Add it to package.json:" + echo "::error:: pnpm add @tailwindcss/cli tailwindcss" + echo "::error::See https://github.com/HugoBlox/kit for upgrade instructions." + exit 1 + fi + - name: Setup Hugo uses: peaceiris/actions-hugo@v3 with: diff --git a/templates/link-in-bio/.github/workflows/build.yml b/templates/link-in-bio/.github/workflows/build.yml index 07d4a2a9..bc47e333 100644 --- a/templates/link-in-bio/.github/workflows/build.yml +++ b/templates/link-in-bio/.github/workflows/build.yml @@ -1,7 +1,7 @@ name: Build env: - NODE_VERSION: '20' + NODE_VERSION: '22' on: # Standalone trigger for PR validation @@ -65,7 +65,7 @@ jobs: VERSION=$(yq '.build.hugo_version // ""' hugoblox.yaml 2>/dev/null | grep -v '^null$' || true) # Fallback to a known stable version if not specified - DEFAULT_VERSION="0.154.5" + DEFAULT_VERSION="0.161.0" VERSION=${VERSION:-$DEFAULT_VERSION} # Validate version format (basic check) @@ -85,6 +85,16 @@ jobs: pnpm install --no-frozen-lockfile || npm install fi + - name: Verify Tailwind CSS dependency + if: hashFiles('package.json') != '' + run: | + if ! node -e "require.resolve('@tailwindcss/cli/package.json')" 2>/dev/null; then + echo "::error title=Missing dependency '@tailwindcss/cli'::Hugo >= 0.161.0 requires the npm @tailwindcss/cli package. Add it to package.json:" + echo "::error:: pnpm add @tailwindcss/cli tailwindcss" + echo "::error::See https://github.com/HugoBlox/kit for upgrade instructions." + exit 1 + fi + - name: Setup Hugo uses: peaceiris/actions-hugo@v3 with: diff --git a/templates/markdown-slides/.github/workflows/build.yml b/templates/markdown-slides/.github/workflows/build.yml index 07d4a2a9..bc47e333 100644 --- a/templates/markdown-slides/.github/workflows/build.yml +++ b/templates/markdown-slides/.github/workflows/build.yml @@ -1,7 +1,7 @@ name: Build env: - NODE_VERSION: '20' + NODE_VERSION: '22' on: # Standalone trigger for PR validation @@ -65,7 +65,7 @@ jobs: VERSION=$(yq '.build.hugo_version // ""' hugoblox.yaml 2>/dev/null | grep -v '^null$' || true) # Fallback to a known stable version if not specified - DEFAULT_VERSION="0.154.5" + DEFAULT_VERSION="0.161.0" VERSION=${VERSION:-$DEFAULT_VERSION} # Validate version format (basic check) @@ -85,6 +85,16 @@ jobs: pnpm install --no-frozen-lockfile || npm install fi + - name: Verify Tailwind CSS dependency + if: hashFiles('package.json') != '' + run: | + if ! node -e "require.resolve('@tailwindcss/cli/package.json')" 2>/dev/null; then + echo "::error title=Missing dependency '@tailwindcss/cli'::Hugo >= 0.161.0 requires the npm @tailwindcss/cli package. Add it to package.json:" + echo "::error:: pnpm add @tailwindcss/cli tailwindcss" + echo "::error::See https://github.com/HugoBlox/kit for upgrade instructions." + exit 1 + fi + - name: Setup Hugo uses: peaceiris/actions-hugo@v3 with: diff --git a/templates/resume/.github/workflows/build.yml b/templates/resume/.github/workflows/build.yml index 07d4a2a9..bc47e333 100644 --- a/templates/resume/.github/workflows/build.yml +++ b/templates/resume/.github/workflows/build.yml @@ -1,7 +1,7 @@ name: Build env: - NODE_VERSION: '20' + NODE_VERSION: '22' on: # Standalone trigger for PR validation @@ -65,7 +65,7 @@ jobs: VERSION=$(yq '.build.hugo_version // ""' hugoblox.yaml 2>/dev/null | grep -v '^null$' || true) # Fallback to a known stable version if not specified - DEFAULT_VERSION="0.154.5" + DEFAULT_VERSION="0.161.0" VERSION=${VERSION:-$DEFAULT_VERSION} # Validate version format (basic check) @@ -85,6 +85,16 @@ jobs: pnpm install --no-frozen-lockfile || npm install fi + - name: Verify Tailwind CSS dependency + if: hashFiles('package.json') != '' + run: | + if ! node -e "require.resolve('@tailwindcss/cli/package.json')" 2>/dev/null; then + echo "::error title=Missing dependency '@tailwindcss/cli'::Hugo >= 0.161.0 requires the npm @tailwindcss/cli package. Add it to package.json:" + echo "::error:: pnpm add @tailwindcss/cli tailwindcss" + echo "::error::See https://github.com/HugoBlox/kit for upgrade instructions." + exit 1 + fi + - name: Setup Hugo uses: peaceiris/actions-hugo@v3 with: diff --git a/templates/starter/.github/workflows/build.yml b/templates/starter/.github/workflows/build.yml index a14eef8e..9c5a3336 100644 --- a/templates/starter/.github/workflows/build.yml +++ b/templates/starter/.github/workflows/build.yml @@ -1,7 +1,7 @@ name: Build env: - NODE_VERSION: '20' + NODE_VERSION: '22' on: # Standalone trigger for PR validation @@ -65,7 +65,7 @@ jobs: VERSION=$(yq '.build.hugo_version // ""' hugoblox.yaml 2>/dev/null | grep -v '^null$' || true) # Fallback to a known stable version if not specified - DEFAULT_VERSION="0.154.5" + DEFAULT_VERSION="0.161.0" VERSION=${VERSION:-$DEFAULT_VERSION} # Validate version format (basic check) @@ -85,6 +85,16 @@ jobs: pnpm install --no-frozen-lockfile || npm install fi + - name: Verify Tailwind CSS dependency + if: hashFiles('package.json') != '' + run: | + if ! node -e "require.resolve('@tailwindcss/cli/package.json')" 2>/dev/null; then + echo "::error title=Missing dependency '@tailwindcss/cli'::Hugo >= 0.161.0 requires the npm @tailwindcss/cli package. Add it to package.json:" + echo "::error:: pnpm add @tailwindcss/cli tailwindcss" + echo "::error::See https://github.com/HugoBlox/kit for upgrade instructions." + exit 1 + fi + - name: Setup Hugo uses: peaceiris/actions-hugo@v3 with: diff --git a/templates/startup-landing-page/.github/workflows/build.yml b/templates/startup-landing-page/.github/workflows/build.yml index 07d4a2a9..bc47e333 100644 --- a/templates/startup-landing-page/.github/workflows/build.yml +++ b/templates/startup-landing-page/.github/workflows/build.yml @@ -1,7 +1,7 @@ name: Build env: - NODE_VERSION: '20' + NODE_VERSION: '22' on: # Standalone trigger for PR validation @@ -65,7 +65,7 @@ jobs: VERSION=$(yq '.build.hugo_version // ""' hugoblox.yaml 2>/dev/null | grep -v '^null$' || true) # Fallback to a known stable version if not specified - DEFAULT_VERSION="0.154.5" + DEFAULT_VERSION="0.161.0" VERSION=${VERSION:-$DEFAULT_VERSION} # Validate version format (basic check) @@ -85,6 +85,16 @@ jobs: pnpm install --no-frozen-lockfile || npm install fi + - name: Verify Tailwind CSS dependency + if: hashFiles('package.json') != '' + run: | + if ! node -e "require.resolve('@tailwindcss/cli/package.json')" 2>/dev/null; then + echo "::error title=Missing dependency '@tailwindcss/cli'::Hugo >= 0.161.0 requires the npm @tailwindcss/cli package. Add it to package.json:" + echo "::error:: pnpm add @tailwindcss/cli tailwindcss" + echo "::error::See https://github.com/HugoBlox/kit for upgrade instructions." + exit 1 + fi + - name: Setup Hugo uses: peaceiris/actions-hugo@v3 with: