From 2b594b9c81fea02598e0f6b6dff7972677f2c150 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Sun, 6 Dec 2020 15:22:20 -0500 Subject: Use vX.Y.Z-dev+{git-describe} for development versions --- scripts/update_version_stamp.lua | 9 ++++----- src/nvim/CMakeLists.txt | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/scripts/update_version_stamp.lua b/scripts/update_version_stamp.lua index 11b521fab6..0342e08f31 100755 --- a/scripts/update_version_stamp.lua +++ b/scripts/update_version_stamp.lua @@ -35,11 +35,10 @@ if not described then end -- `git describe` annotates the most recent tagged release; for pre-release --- builds we must replace that with the unreleased version. -local with_prefix = described:gsub("^v%d+%.%d+%.%d+", prefix) -if described == with_prefix then - -- Prepend the prefix always, e.g. with "nightly-12208-g4041b62b9". - with_prefix = prefix .. "-" .. described +-- builds we append that to the dev version +local with_prefix = prefix +if prefix:match('-dev$') ~= nil then + with_prefix = prefix .. '+' .. described:gsub('^v%d+%.%d+%.%d+-', '') end -- Read existing include file. diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt index 8ec087c626..db77931c16 100644 --- a/src/nvim/CMakeLists.txt +++ b/src/nvim/CMakeLists.txt @@ -242,7 +242,7 @@ if(use_git_version) add_custom_target(update_version_stamp ALL COMMAND ${LUA_PRG} scripts/update_version_stamp.lua ${relbuild}/config/auto/versiondef_git.h - "v${NVIM_VERSION_MAJOR}.${NVIM_VERSION_MINOR}.${NVIM_VERSION_PATCH}" + "v${NVIM_VERSION_MAJOR}.${NVIM_VERSION_MINOR}.${NVIM_VERSION_PATCH}${NVIM_VERSION_PRERELEASE}" WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} BYPRODUCTS ${CMAKE_BINARY_DIR}/config/auto/versiondef_git.h) else() -- cgit From b32124fce260f1132dcda7699905613bea2e888f Mon Sep 17 00:00:00 2001 From: James McCoy Date: Sun, 6 Dec 2020 17:00:27 -0500 Subject: GHA: Perform a full checkout for release workflow This is needed to get a tag-based version from `git describe` rather than just the commit. --- .github/workflows/release.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 610d62211a..2acd615da1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,6 +20,8 @@ jobs: release: ${{ steps.build.outputs.release }} steps: - uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: Install dependencies run: | sudo apt-get update @@ -44,6 +46,8 @@ jobs: runs-on: ubuntu-16.04 steps: - uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: Install dependencies run: | sudo apt-get update @@ -67,6 +71,8 @@ jobs: runs-on: macos-10.15 steps: - uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: Install brew packages run: | brew update >/dev/null -- cgit