From b30ec254c8c84576ebbcb6c9fffe3a37e0593cb6 Mon Sep 17 00:00:00 2001 From: Noam Lerner Date: Thu, 10 Mar 2022 21:13:28 +0200 Subject: [PATCH] Replace --i18n-warnings with --printI18nWarnings for new hugo versions in CI --- .github/workflows/ci-test.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-test.yml b/.github/workflows/ci-test.yml index 14e7987..9eb3c16 100644 --- a/.github/workflows/ci-test.yml +++ b/.github/workflows/ci-test.yml @@ -42,6 +42,7 @@ jobs: - '0.76.5' # https://github.com/gohugoio/hugo/issues/7822 # - '0.80.0' # https://github.com/gohugoio/hugo/issues/8340 - '0.86.1' # https://github.com/gohugoio/hugo/issues/9150 + - '0.93.3' # https://github.com/gohugoio/hugo/commit/837fdfdf45014e3d5ef3b00b01548b68a4489c5f - 'latest' fail-fast: true @@ -57,4 +58,9 @@ jobs: - name: Build with Hugo ${{ matrix.hugo }} working-directory: exampleSite - run: HUGO_THEME="Binario" hugo --themesDir ../.. --i18n-warnings -v + run: | + function ver { printf "%03d%03d%03d" $(echo "$1" | tr '.' ' '); } + HUGO_VERSION=$(hugo version | grep -Eo '[0-9]\.[0-9]+\.[0-9]+') + # The option changed in 0.93.0: https://github.com/gohugoio/hugo/releases/tag/v0.93.0 + I18N_OPT=$([ $(ver $HUGO_VERSION) -lt $(ver 0.93.0) ] && echo "--i18n-warnings" || echo "--printI18nWarnings") + HUGO_THEME="Binario" hugo --themesDir ../.. $I18N_OPT -v