Skip to content

Commit

Permalink
[CI]: Handle git.exe describe for windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarod42 committed Mar 18, 2024
1 parent fc9fb50 commit 1150e2d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/release-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
uses: actions/checkout@v4
with:
submodules: recursive
fetch-tags: true

- name: checkout premake5
uses: actions/checkout@v4
Expand Down
9 changes: 5 additions & 4 deletions premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,15 @@ print("vorbis header path: ", vorbis_headerPath)
print("ogg header path: ", ogg_headerPath)

local function autoversion_h()
local git_tag, errorCode = os.outputof("git describe --tag")
local git_tag, errorCode = os.outputof("git describe --tag --always")
if errorCode == 0 then
print("git description: ", git_tag)
local content = io.readfile("src/autoversion.h.in")
content = content:gsub("${GIT_DESC}", git_tag)


os.mkdir(locationDir)
local f, err = os.writefile_ifnotequal(content, path.join(locationDir, "autoversion.h"))

if (f == 0) then
-- file not modified
elseif (f < 0) then
Expand All @@ -58,7 +59,7 @@ local function autoversion_h()

return true
else
print("`git describe --tag` failed with error code", errorCode)
print("`git describe --tag` failed with error code", errorCode, git_tag)
return false
end
end
Expand Down

0 comments on commit 1150e2d

Please sign in to comment.