Skip to content

Commit

Permalink
Merge pull request #129 from kirides/ci/git_version
Browse files Browse the repository at this point in the history
automatically version based on git tags
  • Loading branch information
kirides committed Jan 15, 2023
2 parents cd0d79e + fc79f17 commit ed5b9ea
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ jobs:
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1

- name: Set tag and directory name env
run: |
$shortHash = $Env:GITHUB_SHA.Substring(0, 9)
echo (-join("CL=/DVERSION_NUMBER#",'\"',"-git-${shortHash}",'\"')) >> $Env:GITHUB_ENV
- name: Restore NuGet packages
working-directory: ${{env.GITHUB_WORKSPACE}}
run: nuget restore .
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ jobs:
run: |
$tagName = $Env:GITHUB_REF -replace 'refs/tags/', ''
$dirName = "GD3D11-${tagName}"
$shortHash = $Env:GITHUB_SHA.Substring(0, 9)
echo "Tag: ${tagName}"
echo "Directory: ${dirName}"
echo "RELEASE_VERSION=${tagName}" >> $Env:GITHUB_ENV
echo "RELEASE_DIR=${dirName}" >> $Env:GITHUB_ENV
echo (-join("CL=/DVERSION_NUMBER#",'\"',"${tagName}-${shortHash}",'\"')) >> $Env:GITHUB_ENV
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1
Expand Down
3 changes: 3 additions & 0 deletions D3D11Engine/pch.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ using namespace DirectX;

#define ENABLE_TESSELATION 0

#ifndef VERSION_NUMBER
#define VERSION_NUMBER "17.8-dev9"
#endif

__declspec(selectany) const char* VERSION_NUMBER_STR = VERSION_NUMBER;

extern bool FeatureLevel10Compatibility;
Expand Down

0 comments on commit ed5b9ea

Please sign in to comment.