Skip to content

Commit

Permalink
Merge pull request #76 from r-koubou/feature/ci_build_info
Browse files Browse the repository at this point in the history
Feature/ci build info
  • Loading branch information
r-koubou authored Dec 6, 2023
2 parents 59aa8a4 + f6f3e4f commit f269cd5
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 12 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ 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

- name: Artifact CLI
uses: actions/upload-artifact@v3
with:
name: KeySwitchManager.CLI-${{ inputs.build-configuration }}${{ inputs.custom-suffix }}-${{ github.sha }}
name: KeySwitchManager.CLI-${{ inputs.build-configuration }}${{ inputs.custom-suffix }}
path: ${{ github.workspace }}/publish/KeySwitchManager.CLI*/

#--------------------------------------------------------------
Expand All @@ -89,13 +89,13 @@ jobs:
dotnet-version: ${{ env.DOTNET_SDK_VERSION }}

- name: WPF 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: cmd
env:
ProjectFile: KeySwitchManager/Sources/Runtime/Applications/WPF/publish.msbuild

- name: Artifact WPF
uses: actions/upload-artifact@v3
with:
name: KeySwitchManager.WPF-${{ inputs.build-configuration }}${{ inputs.custom-suffix }}-${{ github.sha }}
name: KeySwitchManager.WPF-${{ inputs.build-configuration }}${{ inputs.custom-suffix }}
path: ${{ github.workspace }}/publish/KeySwitchManager.WPF*/
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,18 @@ $(Product)

%(MyAssemblyIdentities.Version)

## Build At
## Build On

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

## Build Configuration

$(Configuration)

## Git

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,18 @@ $(Product)

%(MyAssemblyIdentities.Version)

## Build At
## Build On

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

## Build Configuration

$(Configuration)

## Git

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
<Project>
<!-- Output assenbly version to text file for including on deploy by msbuild script. -->
<Target Name="GenerateVersionText" AfterTargets="Build">
<GetAssemblyIdentity AssemblyFiles="$(TargetPath)">
<Output TaskParameter="Assemblies" ItemName="MyAssemblyIdentities" />
</GetAssemblyIdentity>
<PropertyGroup>
<VersionText>
$(Product)
==============================

## Version
## Assembly Version

$(Version)
%(MyAssemblyIdentities.Version)

## Build At
## Build On

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

## Build Configuration

$(Configuration)
</VersionText>
</PropertyGroup>

Expand Down

0 comments on commit f269cd5

Please sign in to comment.