Skip to content

Commit a4af5ca

Browse files
committed
빌드 자동화 및 버전/메타데이터 관리 개선
GitHub Actions 워크플로에 버전 검증 단계 추가 및 주요 브랜치/태그 조건 강화. Directory.Build.props에서 버전 및 메타데이터를 통합 관리하도록 변경하고, 각 csproj의 중복 정보 제거. 앱 매니페스트 버전 자동화 및 빌드 시 실제 버전으로 치환되도록 개선. 이로써 릴리즈 태그와 코드 버전 불일치 방지, 프로젝트 정보 일관성, 배포 품질 향상.
1 parent 0148fa7 commit a4af5ca

File tree

7 files changed

+71
-14
lines changed

7 files changed

+71
-14
lines changed

.github/workflows/build.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ name: TableCloth Build Pipeline
22

33
on:
44
push:
5+
branches:
6+
- main
7+
- develop
8+
tags:
9+
- 'v*'
510
paths:
611
- '.github/workflows/build.yml'
712
- 'docs/**'
@@ -15,7 +20,36 @@ on:
1520
- 'tools/**'
1621

1722
jobs:
23+
validate-version:
24+
if: startsWith(github.ref, 'refs/tags/v')
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
30+
- name: Validate version matches tag
31+
run: |
32+
# Extract version from tag (remove 'v' prefix)
33+
TAG_VERSION="${GITHUB_REF#refs/tags/v}"
34+
35+
# Extract version from Directory.Build.props
36+
PROPS_VERSION=$(grep -oP '(?<=<TableClothSemVer>)[^<]+' src/Directory.Build.props)
37+
38+
echo "Tag version: $TAG_VERSION"
39+
echo "Props version: $PROPS_VERSION"
40+
41+
if [ "$TAG_VERSION" != "$PROPS_VERSION" ]; then
42+
echo "::error::Version mismatch! Tag: v$TAG_VERSION does not match Directory.Build.props: $PROPS_VERSION"
43+
echo "::error::Please update Directory.Build.props to match the tag version before releasing."
44+
exit 1
45+
fi
46+
47+
echo "? Version validated: $TAG_VERSION"
48+
shell: bash
49+
1850
build:
51+
needs: [validate-version]
52+
if: always() && (needs.validate-version.result == 'success' || needs.validate-version.result == 'skipped')
1953
strategy:
2054
matrix:
2155
configuration: [Debug, Release]

src/Directory.Build.Props

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,22 @@
1616
<!-- Computed versions -->
1717
<TableClothVersion>$(TableClothVersionMajor).$(TableClothVersionMinor).$(TableClothVersionPatch).$(TableClothVersionRevision)</TableClothVersion>
1818
<TableClothSemVer>$(TableClothVersionMajor).$(TableClothVersionMinor).$(TableClothVersionPatch)</TableClothSemVer>
19+
20+
<!-- Standard .NET SDK version properties -->
21+
<Version>$(TableClothSemVer)</Version>
22+
<AssemblyVersion>$(TableClothVersion)</AssemblyVersion>
23+
<FileVersion>$(TableClothVersion)</FileVersion>
24+
</PropertyGroup>
25+
26+
<!-- Common Metadata -->
27+
<PropertyGroup>
28+
<Authors>TableCloth Contributors</Authors>
29+
<Company>rkttu.com</Company>
30+
<Product>TableCloth</Product>
31+
<Copyright>(c) rkttu.com, 2021</Copyright>
32+
<RepositoryUrl>https://github.com/yourtablecloth/TableCloth</RepositoryUrl>
33+
<RepositoryType>git</RepositoryType>
34+
<PackageProjectUrl>https://yourtablecloth.github.io</PackageProjectUrl>
1935
</PropertyGroup>
2036

2137
<!-- Workaround for https://github.com/dotnet/wpf/issues/11246 -->

src/Spork/Spork.csproj

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@
2121
<!-- Assembly Info -->
2222
<Title>TableCloth Spork</Title>
2323
<Description>This program is a tool that installs the requested installers at once in the sandbox.</Description>
24-
<Company>rkttu.com</Company>
25-
<Product>TableCloth</Product>
26-
<Copyright>(c) rkttu.com, 2021</Copyright>
27-
<AssemblyVersion>1.14.0.0</AssemblyVersion>
28-
<FileVersion>1.14.0.0</FileVersion>
2924

3025
<!-- COM Interop -->
3126
<ComVisible>true</ComVisible>

src/Spork/app.manifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
3-
<assemblyIdentity version="1.14.0.0" name="Spork.app" />
3+
<assemblyIdentity version="$version$" name="Spork.app" />
44
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
55
<security>
66
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">

src/TableCloth.Core/TableCloth.Core.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
<TargetFramework>netstandard2.0</TargetFramework>
55
<RootNamespace>TableCloth</RootNamespace>
66
<Deterministic>true</Deterministic>
7+
<Description>TableCloth Core Library - 공통 리소스 및 유틸리티</Description>
8+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
79
</PropertyGroup>
810

911
<ItemGroup>

src/TableCloth/TableCloth.csproj

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,7 @@
99
<Platforms>x64;ARM64</Platforms>
1010
<UseWPF>True</UseWPF>
1111
<Description>Keep Your Computer Sound &amp; Safe!</Description>
12-
<Company>rkttu.com</Company>
13-
<Product>TableCloth</Product>
1412
<ProductName>TableCloth</ProductName>
15-
<Copyright>(c) rkttu.com, 2021</Copyright>
16-
<Version>1.14.0.0</Version>
17-
<PackageProjectUrl>https://yourtablecloth.github.io</PackageProjectUrl>
18-
<RepositoryUrl>https://github.com/yourtablecloth/TableCloth</RepositoryUrl>
19-
<RepositoryType>git</RepositoryType>
2013
<PackageTags>TableCloth</PackageTags>
2114
<SignAssembly>False</SignAssembly>
2215
<LangVersion>preview</LangVersion>
@@ -93,6 +86,23 @@
9386
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
9487
</EmbeddedResource>
9588
</ItemGroup>
89+
<Target Name="UpdateManifestVersion" BeforeTargets="PreBuild">
90+
<PropertyGroup>
91+
<ManifestVersion Condition="'$(Version)' != ''">$(Version)</ManifestVersion>
92+
<ManifestVersion Condition="'$(ManifestVersion)' == '' OR !$(ManifestVersion.Contains('.'))">1.0.0.0</ManifestVersion>
93+
<ManifestVersion Condition="!$(ManifestVersion.Contains('.'))">$(ManifestVersion).0.0.0</ManifestVersion>
94+
</PropertyGroup>
95+
<WriteLinesToFile File="$(IntermediateOutputPath)app.manifest"
96+
Lines="$([System.IO.File]::ReadAllText('$(ProjectDir)app.manifest').Replace('$version$', '$(ManifestVersion)'))"
97+
Overwrite="true" />
98+
<ItemGroup>
99+
<None Remove="app.manifest" />
100+
</ItemGroup>
101+
<PropertyGroup>
102+
<ApplicationManifest>$(IntermediateOutputPath)app.manifest</ApplicationManifest>
103+
</PropertyGroup>
104+
</Target>
105+
96106
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
97107
<Exec Command="git.exe rev-parse HEAD &gt; &quot;$(ProjectDir)commit.txt&quot;&#xD;&#xA;&#xD;&#xA;dir &quot;$(SolutionDir)Artifacts\Spork.zip&quot;&#xD;&#xA;copy /y &quot;$(SolutionDir)Artifacts\Spork.zip&quot; &quot;$(ProjectDir)Spork.zip&quot;&#xD;&#xA;dir &quot;$(ProjectDir)Spork.zip&quot;&#xD;&#xA;&#xD;&#xA;curl.exe -L https://yourtablecloth.app/TableClothCatalog/Images.zip -o &quot;$(ProjectDir)Images.zip&quot;&#xD;&#xA;" />
98108
</Target>

src/TableCloth/app.manifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
3-
<assemblyIdentity version="1.14.0.0" name="TableCloth.app" />
3+
<assemblyIdentity version="$version$" name="TableCloth.app" />
44
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
55
<security>
66
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">

0 commit comments

Comments
 (0)