Skip to content

Commit c8c732c

Browse files
authored
Merge pull request #23 from teesofttech/feature/8-nuget-package-metadata
Prepare NuGet package metadata and release workflow
2 parents 8a3f824 + f4e779b commit c8c732c

8 files changed

Lines changed: 144 additions & 7 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,6 @@ jobs:
5252
uses: actions/upload-artifact@v4
5353
with:
5454
name: nuget-package
55-
path: artifacts/packages/*.nupkg
55+
path: |
56+
artifacts/packages/*.nupkg
57+
artifacts/packages/*.snupkg

.github/workflows/release.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
workflow_dispatch:
8+
inputs:
9+
publish:
10+
description: Publish to NuGet when NUGET_API_KEY is configured.
11+
required: true
12+
default: false
13+
type: boolean
14+
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
package:
20+
name: Build, test, pack, and publish
21+
runs-on: ubuntu-latest
22+
env:
23+
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
24+
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0
30+
31+
- name: Setup .NET
32+
uses: actions/setup-dotnet@v4
33+
with:
34+
dotnet-version: 8.0.x
35+
36+
- name: Restore
37+
run: dotnet restore Termii.SDK.sln
38+
39+
- name: Build
40+
run: dotnet build Termii.SDK.sln --configuration Release --no-restore
41+
42+
- name: Unit tests
43+
run: dotnet test tests/Termii.Tests/Termii.Tests.csproj --configuration Release --no-build --logger "trx;LogFileName=unit-tests.trx"
44+
45+
- name: Integration tests
46+
run: dotnet test tests/Termii.IntegrationTests/Termii.IntegrationTests.csproj --configuration Release --no-build --logger "trx;LogFileName=integration-tests.trx"
47+
48+
- name: Pack
49+
run: dotnet pack src/Termii/Termii.csproj --configuration Release --no-build --output artifacts/packages
50+
51+
- name: Upload package artifact
52+
uses: actions/upload-artifact@v4
53+
with:
54+
name: nuget-package
55+
path: |
56+
artifacts/packages/*.nupkg
57+
artifacts/packages/*.snupkg
58+
59+
- name: Publish to NuGet
60+
if: ${{ (github.event_name == 'push' || inputs.publish) && env.NUGET_API_KEY != '' }}
61+
run: dotnet nuget push "artifacts/packages/*.nupkg" --source https://api.nuget.org/v3/index.json --api-key "$NUGET_API_KEY" --skip-duplicate

Directory.Build.props

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@
88
<RepositoryType>git</RepositoryType>
99
<PackageProjectUrl>https://github.com/teesofttech/Termii.SDK</PackageProjectUrl>
1010
<PackageLicenseExpression>MIT</PackageLicenseExpression>
11+
<PackageReadmeFile>README.md</PackageReadmeFile>
12+
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
13+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
14+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
15+
<IncludeSymbols>true</IncludeSymbols>
16+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
17+
<ContinuousIntegrationBuild Condition="'$(GITHUB_ACTIONS)' == 'true'">true</ContinuousIntegrationBuild>
1118
<Authors>Teesoft Tech</Authors>
1219
<Company>Teesoft Tech</Company>
1320
</PropertyGroup>

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Teesoft Tech
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Termii .NET SDK
22

3+
[![CI](https://github.com/teesofttech/Termii.SDK/actions/workflows/ci.yml/badge.svg)](https://github.com/teesofttech/Termii.SDK/actions/workflows/ci.yml)
4+
35
A .NET SDK for the Termii messaging, token, and insights APIs.
46

57
> This SDK is in early development. The first milestones establish the client, tests, examples, API coverage matrix, and package structure before endpoint support is added feature by feature.
@@ -15,6 +17,12 @@ The initial repository setup includes:
1517

1618
## Usage
1719

20+
Install the package:
21+
22+
```bash
23+
dotnet add package Termii.SDK
24+
```
25+
1826
```csharp
1927
using Termii;
2028

@@ -88,3 +96,7 @@ Development is tracked through GitHub issues:
8896
- CI, documentation, NuGet packaging, and GitHub Releases.
8997

9098
Official Termii documentation: https://developer.termii.com/
99+
100+
## License
101+
102+
This project is licensed under the MIT License.

docs/API_COVERAGE.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ The Termii docs describe a REST/JSON API and state that each account has its own
3232
| Error handling and request validation | Implemented | #6, PR #19 |
3333
| Reusable fake HTTP test helpers and opt-in live test conventions | Implemented | #10, PR #20 |
3434
| README endpoint examples | Planned | #12 |
35-
| CI build/test/package validation | In progress | #11 |
36-
| NuGet package metadata and publishing workflow | Planned | #8 |
35+
| CI build/test/package validation | Implemented | #11, PR #22 |
36+
| NuGet package metadata and publishing workflow | In progress | #8 |
3737
| First GitHub Release and NuGet publish | Planned | #13 |
3838

3939
## Endpoint Coverage
@@ -42,9 +42,9 @@ The Termii docs describe a REST/JSON API and state that each account has its own
4242
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
4343
| Messaging | Fetch sender IDs | GET | `/api/sender-id` | Query | `TermiiClient.SenderIds` | Planned | #3 | Planned unit + optional integration |
4444
| Messaging | Request sender ID | POST | `/api/sender-id/request` | JSON body | `TermiiClient.SenderIds` | Planned | #3 | Planned unit + optional integration |
45-
| Messaging | Send SMS/channel message | POST | `/api/sms/send` | JSON body | `TermiiClient.Messaging` | In progress | #7 | Unit tests added |
46-
| Messaging | Send WhatsApp conversational message | POST | `/api/sms/send` | JSON body | `TermiiClient.Messaging` | In progress | #7 | Unit tests added |
47-
| Messaging | Send bulk message | POST | `/api/sms/send/bulk` | JSON body | `TermiiClient.Messaging` | In progress | #7 | Unit tests added |
45+
| Messaging | Send SMS/channel message | POST | `/api/sms/send` | JSON body | `TermiiClient.Messaging` | Implemented | #7, PR #21 | Unit tests added |
46+
| Messaging | Send WhatsApp conversational message | POST | `/api/sms/send` | JSON body | `TermiiClient.Messaging` | Implemented | #7, PR #21 | Unit tests added |
47+
| Messaging | Send bulk message | POST | `/api/sms/send/bulk` | JSON body | `TermiiClient.Messaging` | Implemented | #7, PR #21 | Unit tests added |
4848
| Messaging | Send via Number API | POST | `/api/sms/number/send` | Query or JSON body, docs/examples vary | `TermiiClient.Messaging` or `TermiiClient.Numbers` | Planned | #5 | Planned unit + optional integration |
4949
| Token | Send OTP token | POST | `/api/sms/otp/send` | JSON body | `TermiiClient.Token` | Planned | #4 | Planned unit + optional integration |
5050
| Token | Verify OTP token | POST | `/api/sms/otp/verify` | JSON body | `TermiiClient.Token` | Planned | #4 | Planned unit + optional integration |

docs/RELEASING.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Releasing
2+
3+
This project publishes the SDK as a NuGet package from version tags.
4+
5+
## Versioning
6+
7+
- Use semantic versioning.
8+
- Keep `VersionPrefix` in `src/Termii/Termii.csproj` aligned with the release tag.
9+
- Use preview suffixes for pre-release packages, for example `0.1.0-preview.1`.
10+
11+
## Release Checklist
12+
13+
1. Confirm all intended issues for the release are merged.
14+
2. Confirm CI is green on `main`.
15+
3. Update package metadata and README examples if needed.
16+
4. Update `VersionPrefix` in `src/Termii/Termii.csproj`.
17+
5. Create and push a tag like `v0.1.0`.
18+
6. Confirm the release workflow creates the package artifact.
19+
7. Confirm NuGet publishing succeeds when the `NUGET_API_KEY` secret is configured.
20+
21+
## Required Secrets
22+
23+
| Secret | Purpose |
24+
| --- | --- |
25+
| `NUGET_API_KEY` | API key used by the release workflow to publish to NuGet.org. |
26+
27+
The release workflow skips the publish step when `NUGET_API_KEY` is not set, but still builds, tests, packs, and uploads the package artifact.

src/Termii/Termii.csproj

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,22 @@
33
<TargetFrameworks>netstandard2.0;net8.0</TargetFrameworks>
44
<AssemblyName>Termii</AssemblyName>
55
<RootNamespace>Termii</RootNamespace>
6-
<PackageId>Termii</PackageId>
6+
<PackageId>Termii.SDK</PackageId>
7+
<VersionPrefix>0.1.0</VersionPrefix>
78
<Description>A .NET SDK for the Termii messaging, token, and insights APIs.</Description>
9+
<PackageReleaseNotes>Initial SDK package metadata and release workflow preparation.</PackageReleaseNotes>
810
<PackageTags>termii;sms;otp;messaging;dotnet;sdk</PackageTags>
911
<GenerateDocumentationFile>true</GenerateDocumentationFile>
1012
<NoWarn>$(NoWarn);1591</NoWarn>
1113
</PropertyGroup>
1214

1315
<ItemGroup>
1416
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.1" />
17+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
1518
<PackageReference Include="System.Text.Json" Version="8.0.5" />
1619
</ItemGroup>
20+
21+
<ItemGroup>
22+
<None Include="../../README.md" Pack="true" PackagePath="/" />
23+
</ItemGroup>
1724
</Project>

0 commit comments

Comments
 (0)