Skip to content

Commit 2a2ced0

Browse files
update workflows, add new one for publishing packages.
1 parent 85448dc commit 2a2ced0

File tree

6 files changed

+65
-10
lines changed

6 files changed

+65
-10
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@ on:
88

99
jobs:
1010
build-and-test:
11-
name: 🧪 Build and Run CI Tests
11+
name: Build and Run CI Tests
1212
runs-on: ubuntu-latest
1313

1414
env:
1515
DOTNET_VERSION: '8.0.x'
1616

1717
steps:
1818
- name: Checkout Code
19-
uses: actions/checkout@v3
19+
uses: actions/checkout@v4
2020

2121
- name: Setup .NET
22-
uses: actions/setup-dotnet@v3
22+
uses: actions/setup-dotnet@v4
2323
with:
2424
dotnet-version: ${{ env.DOTNET_VERSION }}
2525

@@ -35,10 +35,19 @@ jobs:
3535
--configuration Release \
3636
--no-build \
3737
--logger "trx;LogFileName=TestResults.trx" \
38-
--filter "TestCategory=CI"
38+
--filter "TestCategory=CI" \
39+
--results-directory ./TestResults
3940
40-
- name: Publish Test Results
41+
- name: Upload Test Results as Artifact
4142
uses: actions/upload-artifact@v4
4243
with:
4344
name: TestResults
44-
path: "**/TestResults/*.trx"
45+
path: ./TestResults/TestResults.trx
46+
47+
- name: Visualize Test Results (dorny/test-reporter)
48+
uses: dorny/test-reporter@v1
49+
if: always() # ensures this runs even if tests fail
50+
with:
51+
name: NUnit CI Test Report
52+
path: ./TestResults/TestResults.trx
53+
reporter: dotnet-trx
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Publish NuGet Package
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*' # Only runs when a version tag is pushed, like v1.1.4
7+
8+
permissions:
9+
contents: read
10+
packages: write
11+
12+
jobs:
13+
publish:
14+
runs-on: ubuntu-latest
15+
16+
environment: production # matches the environment where you set NuGetKey
17+
18+
steps:
19+
- name: Checkout Code
20+
uses: actions/checkout@v4
21+
22+
- name: Setup .NET
23+
uses: actions/setup-dotnet@v4
24+
with:
25+
dotnet-version: '8.x'
26+
27+
- name: Restore Dependencies
28+
run: dotnet restore ./Testimize/Testimize.csproj
29+
30+
- name: Build Solution
31+
run: dotnet build ./Testimize/Testimize.csproj --configuration Release --no-restore
32+
33+
- name: Pack NuGet Package
34+
run: dotnet pack ./Testimize/Testimize.csproj --configuration Release --no-build --output ./nupkg
35+
36+
- name: Publish to NuGet.org
37+
run: dotnet nuget push ./nupkg/*.nupkg --api-key ${{ secrets.NUGETKEY }} --source https://api.nuget.org/v3/index.json

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
[![NuGet](https://img.shields.io/nuget/v/Testimize.svg)](https://www.nuget.org/packages/Testimize)
66
[![GitHub license](https://img.shields.io/github/license/AutomateThePlanet/Testimize?style=flat)](https://github.com/AutomateThePlanet/Testimize/blob/main/LICENSE)
77
[![CI](https://github.com/AutomateThePlanet/Testimize/actions/workflows/ci.yml/badge.svg)](https://github.com/AutomateThePlanet/Testimize/actions/workflows/ci.yml)
8+
[![NuGet](https://img.shields.io/nuget/v/Testimize.svg)](https://www.nuget.org/packages/Testimize/)
9+
810

911
---
1012
<p align="center">

Testimize.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ EndProject
1818
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{02EA681E-C7D8-13C7-8484-4AC65E1B71E8}"
1919
ProjectSection(SolutionItems) = preProject
2020
.github\workflows\ci.yml = .github\workflows\ci.yml
21+
.github\workflows\publish-nuget.yml = .github\workflows\publish-nuget.yml
2122
EndProjectSection
2223
EndProject
2324
Global

Testimize/Testimize.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
</PropertyGroup>
1313

1414
<PropertyGroup>
15-
<Version>1.1.4.0</Version>
15+
<Version>1.1.5.0</Version>
1616
<Authors>Anton Angelov</Authors>
1717
<Company>Automate The Planet Ltd.</Company>
1818
<Product>Testimize – Test and Data Generation Library</Product>
19-
<AssemblyVersion>1.1.4.0</AssemblyVersion>
20-
<FileVersion>1.1.4.0</FileVersion>
19+
<AssemblyVersion>1.1.5.0</AssemblyVersion>
20+
<FileVersion>1.1.5.0</FileVersion>
2121
<NeutralLanguage>en</NeutralLanguage>
2222
<Copyright>Copyright © Automate The Planet Ltd. 2025</Copyright>
2323
<PackageLicenseFile>LICENSE</PackageLicenseFile>

Testimize/publishPackageInfo.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1-
dotnet nuget push "bin\Release\Testimize.1.1.4.nupkg" --api-key %NuGetKey% --source https://api.nuget.org/v3/index.json
1+
dotnet nuget push "bin\Release\Testimize.1.1.4.nupkg" --api-key %NuGetKey% --source https://api.nuget.org/v3/index.json
2+
3+
or via automatic GitHub Actions:
4+
Only runs when a version tag is pushed, like v1.1.4
5+
6+
git tag v1.1.4
7+
git push origin v1.1.4

0 commit comments

Comments
 (0)