Skip to content

Commit

Permalink
WIP - CLI のCIビルドにブランチ、SHA情報を入れた
Browse files Browse the repository at this point in the history
  • Loading branch information
r-koubou committed Dec 6, 2023
1 parent 59aa8a4 commit 88341b9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
dotnet-version: ${{ env.DOTNET_SDK_VERSION }}

- name: CLI Build
run: dotnet msbuild /nologo /t:Archive /p:Configuration=${{ inputs.build-configuration }} /p:PublishDir=${{ github.workspace }}/publish $ProjectFile
run: dotnet msbuild /nologo /t:Archive /p:Configuration=${{ inputs.build-configuration }} /p:PublishDir=${{ github.workspace }}/publish /p:GitBranch=${{ github.ref }} /p:GitCommitHash=${{ github.sha }} $ProjectFile
shell: bash
env:
ProjectFile: KeySwitchManager/Sources/Runtime/Applications/CLI/publish.msbuild
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<!-- Set value from CI command -->
<PropertyGroup>
<GitBranch>N/A</GitBranch>
<GitCommitHash>N/A</GitCommitHash>
</PropertyGroup>

<PropertyGroup>
<!-- Assembly / Common -->
<OutputType>Exe</OutputType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ $(Product)
## Build At

$([System.DateTime]::Now.ToString("yyyy-MM-dd HH:mm:ss %K"))

## Git

- Brabch: $(GitBranch)
- Hash: $(GitCommitHash)
</VersionText>
</PropertyGroup>

Expand All @@ -25,4 +30,5 @@ $([System.DateTime]::Now.ToString("yyyy-MM-dd HH:mm:ss %K"))
Lines="$(VersionText)" />
</Target>


</Project>

0 comments on commit 88341b9

Please sign in to comment.