From 7d30bccad86634518045e52c62dab2d512524770 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Mon, 11 Oct 2021 20:11:41 +0200 Subject: [PATCH 1/2] generate-version: handle git repo not having any tags --- .woodpecker.yml | 5 ----- generate-version.sh | 9 ++++++++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index dd0ef7da..50c5b14d 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -1,8 +1,3 @@ -clone: - git: - image: plugins/git - tags: true - pipeline: codespell: when: { branch: master } diff --git a/generate-version.sh b/generate-version.sh index 3ea55ba9..369f36ed 100755 --- a/generate-version.sh +++ b/generate-version.sh @@ -13,7 +13,14 @@ out_file=${3} if [ -d "${src_dir}/.git" ] && command -v git > /dev/null; then workdir=$(pwd) cd "${src_dir}" - git_version=$(git describe --always --tags) + + if git describe --tags > /dev/null 2>&1; then + git_version=$(git describe --always --tags) + else + # No tags available, happens in e.g. CI builds + git_version="${default_version}" + fi + git_branch=$(git rev-parse --abbrev-ref HEAD) cd "${workdir}" From 1c1b2bd101129aa575cb239f22975953a9c244d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Mon, 11 Oct 2021 20:16:25 +0200 Subject: [PATCH 2/2] =?UTF-8?q?ci:=20run=20=E2=80=9Cfoot=20--version?= =?UTF-8?q?=E2=80=9D=20and=20=E2=80=9Cfootclient=20--version=E2=80=9D=20af?= =?UTF-8?q?ter=20each=20build?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .woodpecker.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.woodpecker.yml b/.woodpecker.yml index 50c5b14d..20d74eaf 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -37,6 +37,8 @@ pipeline: - meson --buildtype=debug -Dgrapheme-clustering=enabled -Dfcft:text-shaping=enabled -Dfcft:test-text-shaping=true ../.. - ninja -v -k0 - ninja -v test + - ./foot --version + - ./footclient --version - cd ../.. # Release @@ -45,6 +47,8 @@ pipeline: - meson --buildtype=release -Dgrapheme-clustering=enabled -Dfcft:text-shaping=enabled -Dfcft:test-text-shaping=true ../.. - ninja -v -k0 - ninja -v test + - ./foot --version + - ./footclient --version - cd ../.. # no grapheme clustering @@ -54,6 +58,8 @@ pipeline: - meson --buildtype=debug -Dgrapheme-clustering=disabled -Dfcft:text-shaping=disabled -Dfcft:test-text-shaping=false ../.. - ninja -v -k0 - ninja -v test + - ./foot --version + - ./footclient --version - cd ../.. x86: @@ -75,6 +81,8 @@ pipeline: - meson --buildtype=debug -Dgrapheme-clustering=enabled -Dfcft:text-shaping=enabled -Dfcft:test-text-shaping=true ../.. - ninja -v -k0 - ninja -v test + - ./foot --version + - ./footclient --version - cd ../.. # Release @@ -83,4 +91,6 @@ pipeline: - meson --buildtype=release -Dgrapheme-clustering=enabled -Dfcft:text-shaping=enabled -Dfcft:test-text-shaping=true ../.. - ninja -v -k0 - ninja -v test + - ./foot --version + - ./footclient --version - cd ../..