Skip to content

Commit 83b7436

Browse files
authored
Add packaging section to README
Added packaging instructions for the NuGet package using GitHub Container Repository.
1 parent acdb19f commit 83b7436

1 file changed

Lines changed: 87 additions & 1 deletion

File tree

README.md

Lines changed: 87 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ This .NET SDK is an auto-generated client for the AndDone Secure API, built usin
2424
* [Installation](#installation)
2525
* [Configuration](#configuration)
2626
* [Quickstart](#quickstart)
27+
* [Packaging](#packaging)
2728
* [API Endpoints](#api-endpoints)
2829
* [Models](#models)
2930
* [Authorization](#authorization)
@@ -162,6 +163,91 @@ catch (ApiException e)
162163

163164
---
164165

166+
## Packaging
167+
168+
The GitHub Container Repository (GHCR) will be used to house the NuGet package for client consumption.
169+
170+
1. Create a GitHub Personal Access Token (PAT)
171+
1. Login to GitHub
172+
2. Select User -> Settings -> Developer Settings -> Personal access tokens -> Tokens (classic)
173+
3. select Generate new token -> Generate new token (classic)
174+
4. Give an identifiable description name
175+
5. Copy Token to be used below as GH_PAT
176+
6. Add the GHCR reference to the local machine by running:
177+
dotnet nuget add source --username {GH_USER} --password {GH_PAT} --store-password-in-clear-text --name githubanddone "https://nuget.pkg.github.com/AndDone-LLC/index.json"
178+
179+
2. Create Package and Push (command line)
180+
1. Open a Powershell window
181+
2. Create a new folder in the workspace folder of choice (ex: d:\workspace\anddone)
182+
```sh
183+
cd d:\workspace
184+
mkdir anddoneclientlibrary
185+
```
186+
4. Change to the new folder
187+
```sh
188+
cd anddoneclientlibrary
189+
```
190+
5. Clone the repository
191+
```sh
192+
git clone https://github.com/AndDone-LLC/AndDone-SecureAPI-ClientLibrary-DotNet-private.git
193+
````
194+
6. Open nuget.config file in the Project root (AndDone-SecureAPI-ClientLibrary-DotNet-private\src\AndDoneSecureClientLibrary) and modify {GH_USER} and {GH_PAT}
195+
7. Verify the <RepositoryUrl> in .csproj file is correct
196+
8. Update the Version in .csproj as needed
197+
7. Navigate to AndDone-SecureAPI-ClientLibrary-DotNet-private\src\AndDoneSecureClientLibrary
198+
```sh
199+
cd src\AndDoneSecureClientLibrary
200+
```
201+
9. Package the project to create the .nupkg file
202+
```sh
203+
dotnet pack --configuration Release
204+
```
205+
10. Push the package to GHCR
206+
```sh
207+
dotnet nuget push "bin\Release\AndDoneSecureClientLibrary.1.0.0.nupkg" --api-key {GH_PAT} --source "githubanddone" --skip-duplicate
208+
```
209+
210+
3. Create Package and Push (Visual Studio)
211+
1. Open a Powershell window
212+
2. Create a new folder in the workspace folder of choice (ex: d:\workspace\anddone)
213+
```sh
214+
cd d:\workspace
215+
mkdir anddoneclientlibrary
216+
```
217+
4. Change to the new folder
218+
```sh
219+
cd anddoneclientlibrary
220+
```
221+
5. Clone the repository
222+
```sh
223+
git clone https://github.com/AndDone-LLC/AndDone-SecureAPI-ClientLibrary-DotNet-private.git
224+
````
225+
6. Open AndDoneSecureClientLibrary.sln
226+
7. Change the build configuration dropdown to Release
227+
4. Modify nuget.config file in Project root with {GH_USER} and {GH_PAT}
228+
5. Verify <RepositoryUrl> in the .csproj file is correct
229+
6. Update Version in the .csproj as needed
230+
7. Right click on Solution in Solution Explorer and Build Solution
231+
8. Right click on the Project in Solution Explorer and Pack
232+
9. In the Powershell window
233+
```sh
234+
cd AndDone-SecureAPI-ClientLibrary-DotNet-private\src\AndDoneSecureClientLibrary
235+
```
236+
10. Push the package to GHCR
237+
```sh
238+
dotnet nuget push "bin\Release\AndDoneSecureClientLibrary.1.0.0.nupkg" --api-key {GH_PAT} --source "githubanddone" --skip-duplicate
239+
```
240+
241+
4. Associate Package to Repository
242+
1. In GitHub -> Select User -> Organizations
243+
2. Select AndDone-LLC
244+
3. Click Packages in top menu
245+
4. Click Package Name
246+
5. In right side, Click Package Settings
247+
6. Click Add Repository and select Repository for Package
248+
7. Verify by going to GitHub code page and the Package will be listed on the right side
249+
250+
165251
## API Endpoints
166252

167253
All URIs are relative to:
@@ -445,4 +531,4 @@ Authentication is handled via API keys in HTTP headers:
445531
## Support & Versioning
446532

447533
* **API Environments:** Use UAT for testing; switch to Production only after validation.
448-
* **Issues:** Report bugs or request features via the [GitHub Issues](https://github.com/anddone-kit/AndDone-SecureAPI-ClientLibrary-DotNet/issues) page.
534+
* **Issues:** Report bugs or request features via the [GitHub Issues](https://github.com/anddone-kit/AndDone-SecureAPI-ClientLibrary-DotNet/issues) page.

0 commit comments

Comments
 (0)