Skip to content

Commit 41827f0

Browse files
committed
Update runner to run on version 5
1 parent a71f6db commit 41827f0

3 files changed

Lines changed: 55 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Publish NuGet Package
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*' # e.g., v1.0.0, v1.2.3
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
# 1. Checkout repository
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
# 2. Install .NET 10 SDK
18+
- name: Setup .NET
19+
uses: actions/setup-dotnet@v5
20+
with:
21+
dotnet-version: '10.0.x'
22+
23+
# 3. Extract version number from Git tag
24+
- name: Extract version from tag
25+
id: get_version
26+
run: |
27+
VERSION=${GITHUB_REF#refs/tags/v}
28+
echo "PACKAGE_VERSION=$VERSION" >> $GITHUB_ENV
29+
30+
# 4. Restore dependencies for the library
31+
- name: Restore library dependencies
32+
run: dotnet restore src/CatBox.NET/CatBox.NET.csproj
33+
34+
# 5. Build the library
35+
- name: Build library
36+
run: dotnet build src/CatBox.NET/CatBox.NET.csproj --configuration Release --no-restore
37+
38+
# 6. Run tests (pointing to your test project)
39+
- name: Run tests
40+
run: dotnet test tests/CatBox.Tests/CatBox.Tests.csproj --configuration Release --no-build
41+
42+
# 7. Pack the NuGet package
43+
- name: Pack NuGet package
44+
run: dotnet pack src/CatBox.NET/CatBox.NET.csproj --configuration Release --no-build -o ./artifacts /p:PackageVersion=${{ env.PACKAGE_VERSION }}
45+
46+
# 8. Publish package to nuget.org
47+
- name: Publish NuGet package
48+
run: dotnet nuget push ./artifacts/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json

CatBox.NET.slnx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
</Folder>
55
<Folder Name="/Solution/">
66
<File Path=".editorconfig" />
7+
<File Path=".github/workflows/release.yml" />
78
<File Path=".gitignore" />
89
<File Path="CLAUDE.md" />
910
<File Path="license.txt" />

global.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"sdk": {
3+
"version": "10.0.100",
4+
"rollForward": "latestFeature"
5+
}
6+
}

0 commit comments

Comments
 (0)