Skip to content

Commit 72ea6c0

Browse files
committed
build(ci): 🚀 add release workflow and GitVersion configuration
1 parent 23c9eb1 commit 72ea6c0

4 files changed

Lines changed: 114 additions & 2 deletions

File tree

.github/release.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
changelog:
2+
exclude:
3+
labels:
4+
- ignore-release
5+
categories:
6+
- title: Breaking Changes
7+
labels:
8+
- breaking
9+
- title: Features
10+
labels:
11+
- feature
12+
- enhancement
13+
- title: Bug Fixes
14+
labels:
15+
- bug
16+
- fix
17+
- title: Maintenance
18+
labels:
19+
- chore
20+
- dependencies
21+
- docs
22+
- title: Other Changes
23+
labels:
24+
- '*'

.github/workflows/ci.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ jobs:
2222
steps:
2323
- name: Checkout
2424
uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0
2527

2628
- name: Verify Steam credentials
2729
shell: bash
@@ -42,6 +44,11 @@ jobs:
4244
steam-user: ${{ secrets.STEAMUSER }}
4345
steam-password: ${{ secrets.STEAMPASS }}
4446

47+
- name: Setup .NET SDK
48+
uses: actions/setup-dotnet@v4
49+
with:
50+
dotnet-version: 9.0.x
51+
4552
- name: Cache NuGet packages
4653
uses: actions/cache@v4
4754
with:
@@ -73,3 +80,46 @@ jobs:
7380
run: |
7481
dotnet test ReferenceReplacement.sln --configuration Release --no-build \
7582
-p:ResoniteAssembliesDir="${{ steps.resonite.outputs.resonite-path }}"
83+
84+
- name: Prepare release assets
85+
if: startsWith(github.ref, 'refs/tags/v')
86+
shell: bash
87+
run: |
88+
set -euo pipefail
89+
artifacts_dir=release-artifacts
90+
mkdir -p "$artifacts_dir"
91+
cp src/ReferenceReplacement/bin/Release/net9.0/ReferenceReplacement.dll "$artifacts_dir/ReferenceReplacement.dll"
92+
if [ -f src/ReferenceReplacement/bin/Release/net9.0/ReferenceReplacement.pdb ]; then
93+
cp src/ReferenceReplacement/bin/Release/net9.0/ReferenceReplacement.pdb "$artifacts_dir/ReferenceReplacement.pdb"
94+
fi
95+
96+
- name: Upload release artifacts
97+
if: startsWith(github.ref, 'refs/tags/v')
98+
uses: actions/upload-artifact@v4
99+
with:
100+
name: reference-replacement
101+
path: release-artifacts
102+
if-no-files-found: error
103+
104+
release:
105+
runs-on: ubuntu-latest
106+
needs: build
107+
if: startsWith(github.ref, 'refs/tags/v')
108+
permissions:
109+
contents: write
110+
steps:
111+
- name: Download build artifacts
112+
uses: actions/download-artifact@v4
113+
with:
114+
name: reference-replacement
115+
path: release-artifacts
116+
117+
- name: Publish GitHub release
118+
uses: softprops/action-gh-release@v2
119+
with:
120+
tag_name: ${{ github.ref_name }}
121+
name: Reference Replacement ${{ github.ref_name }}
122+
generate_release_notes: true
123+
files: |
124+
release-artifacts/ReferenceReplacement.dll
125+
release-artifacts/ReferenceReplacement.pdb

GitVersion.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
mode: Mainline
2+
branches:
3+
master:
4+
regex: ^master$
5+
tag: ''
6+
increment: patch
7+
prevent-increment-of-merged-branch-version: true
8+
feature:
9+
regex: ^(feature|feat|bugfix)/
10+
increment: patch
11+
pull-request:
12+
regex: ^(pull|pr)/
13+
tag: pr
14+
increment: patch
15+
hotfix:
16+
regex: ^hotfix/
17+
increment: patch
18+
release:
19+
regex: ^release/
20+
increment: minor
21+
develop:
22+
regex: ^develop$
23+
increment: minor
24+
ignore:
25+
sha: []
26+
tag-prefix: v
27+
continuous-delivery-fallback-tag: ci
28+
legacy-semver-padding: 3
29+
build-metadata-padding: 5
30+
commits-since-version-source-padding: 4
31+
assembly-versioning-scheme: MajorMinorPatch
32+
assembly-file-versioning-format: '{Major}.{Minor}.{Patch}.0'
33+
assembly-informational-format: '{FullSemVer}+{ShortSha}'
34+
major-version-bump-message: '\+semver:\s?(breaking|major)'
35+
minor-version-bump-message: '\+semver:\s?(feature|minor)'
36+
patch-version-bump-message: '\+semver:\s?(fix|patch)'

src/ReferenceReplacement/ReferenceReplacement.csproj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
<LangVersion>12.0</LangVersion>
88
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
99
<CopyToMods Condition="'$(CopyToMods)'==''">false</CopyToMods>
10-
<AssemblyVersion>0.1.0.0</AssemblyVersion>
11-
<FileVersion>0.1.0.0</FileVersion>
1210
</PropertyGroup>
1311

1412
<PropertyGroup>
@@ -52,6 +50,10 @@
5250
</AssemblyAttribute>
5351
</ItemGroup>
5452

53+
<ItemGroup>
54+
<PackageReference Include="GitVersion.MsBuild" Version="5.12.0" PrivateAssets="all" />
55+
</ItemGroup>
56+
5557
<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(CopyToMods)'=='true'">
5658
<PropertyGroup>
5759
<_ResoniteModsDir>$(ResolvedResoniteAssembliesDir)/rml_mods</_ResoniteModsDir>

0 commit comments

Comments
 (0)