From d311fb17c46ad2ab9064c7aba1954d3500ef0e54 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Mon, 17 Jun 2024 18:31:30 +0200 Subject: [PATCH] fix: Treat pre-release and docs versions correctly for new release workflow Since we changed our release workflow, we have adjusted: - the docs to use postgrest.org/en/v12/ -style URLs, i.e. only using the major component. - the pre-release / devel versions to contain only two instead of four version parts, i.e. currently 12.3. --- src/PostgREST/Version.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/PostgREST/Version.hs b/src/PostgREST/Version.hs index d736c77b8..4e99b788d 100644 --- a/src/PostgREST/Version.hs +++ b/src/PostgREST/Version.hs @@ -15,7 +15,7 @@ import Protolude -- | User friendly version number such as '1.1.1'. --- Pre-release versions are tagged as such, e.g., '1.1.1.1 (pre-release)'. +-- Pre-release versions are tagged as such, e.g., '1.1 (pre-release)'. -- If a git hash is available, it's added to the version, e.g., '1.1.1 (abcdef0)'. prettyVersion :: ByteString prettyVersion = @@ -31,14 +31,14 @@ prettyVersion = -- | Version number used in docs. -- Pre-release versions link to the latest docs --- Uses only the two first components of the version. Example: 'v1.1' +-- Uses only the first component of the version. Example: 'v1' docsVersion :: Text docsVersion | isPreRelease = "latest" - | otherwise = "v" <> (T.intercalate "." . map show . take 2 $ versionBranch version) + | otherwise = "v" <> (T.intercalate "." . map show . take 1 $ versionBranch version) --- | Versions with four components (e.g., '1.1.1.1') are treated as pre-releases. +-- | Versions with two components (e.g., '1.1') are treated as pre-releases. isPreRelease :: Bool isPreRelease = - length (versionBranch version) == 4 + length (versionBranch version) == 2