Skip to content

Commit 5afd5b3

Browse files
committed
Add documentation folder with packaging
1 parent 1c548fb commit 5afd5b3

1 file changed

Lines changed: 168 additions & 0 deletions

File tree

documentation/packaging.md

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
\## Packaging
2+
3+
4+
5+
The GitHub Container Repository (GHCR) will be used to house the NuGet package for client consumption.
6+
7+
8+
9+
1\. Create a GitHub Personal Access Token (PAT)
10+
11+
  1. Login to GitHub
12+
13+
  2. Select User -> Settings -> Developer Settings -> Personal access tokens -> Tokens (classic)
14+
15+
  3. select Generate new token -> Generate new token (classic)
16+
17+
  4. Give an identifiable description name
18+
19+
  5. Copy Token to be used below as GH\_PAT
20+
21+
  6. Add the GHCR reference to the local machine by running:
22+
23+
  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"
24+
25+
26+
27+
2\. Create Package and Push (command line)
28+
29+
  1. Open a Powershell window
30+
31+
  2. Create a new folder in the workspace folder of choice (ex: d:\\workspace\\anddone)
32+
33+
  ```sh
34+
35+
  cd d:\\workspace
36+
37+
  mkdir anddoneclientlibrary
38+
39+
  ```
40+
41+
  4. Change to the new folder
42+
43+
  ```sh
44+
45+
  cd anddoneclientlibrary
46+
47+
  ```
48+
49+
  5. Clone the repository
50+
51+
  ```sh
52+
53+
  git clone https://github.com/AndDone-LLC/AndDone-SecureAPI-ClientLibrary-DotNet-private.git
54+
55+
  ````
56+
57+
  6. Open nuget.config file in the Project root (AndDone-SecureAPI-ClientLibrary-DotNet-private\\src\\AndDoneSecureClientLibrary) and modify {GH\_USER} and {GH\_PAT}
58+
59+
&nbsp; 7. Verify the <RepositoryUrl> in .csproj file is correct
60+
61+
&nbsp; 8. Update the Version in .csproj as needed
62+
63+
&nbsp; 7. Navigate to AndDone-SecureAPI-ClientLibrary-DotNet-private\\src\\AndDoneSecureClientLibrary
64+
65+
&nbsp; ```sh
66+
67+
&nbsp; cd src\\AndDoneSecureClientLibrary
68+
69+
&nbsp; ```
70+
71+
&nbsp; 9. Package the project to create the .nupkg file
72+
73+
&nbsp; ```sh
74+
75+
&nbsp; dotnet pack --configuration Release
76+
77+
&nbsp; ```
78+
79+
&nbsp; 10. Push the package to GHCR
80+
81+
&nbsp; ```sh
82+
83+
&nbsp; dotnet nuget push "bin\\Release\\AndDoneSecureClientLibrary.1.0.0.nupkg" --api-key {GH\_PAT} --source "githubanddone" --skip-duplicate
84+
85+
&nbsp; ```
86+
87+
88+
89+
3\. Create Package and Push (Visual Studio)
90+
91+
&nbsp; 1. Open a Powershell window
92+
93+
&nbsp; 2. Create a new folder in the workspace folder of choice (ex: d:\\workspace\\anddone)
94+
95+
&nbsp; ```sh
96+
97+
&nbsp; cd d:\\workspace
98+
99+
&nbsp; mkdir anddoneclientlibrary
100+
101+
&nbsp; ```
102+
103+
&nbsp; 4. Change to the new folder
104+
105+
&nbsp; ```sh
106+
107+
&nbsp; cd anddoneclientlibrary
108+
109+
&nbsp; ```
110+
111+
&nbsp; 5. Clone the repository
112+
113+
&nbsp; ```sh
114+
115+
&nbsp; git clone https://github.com/AndDone-LLC/AndDone-SecureAPI-ClientLibrary-DotNet-private.git
116+
117+
&nbsp; ````
118+
119+
&nbsp; 6. Open AndDoneSecureClientLibrary.sln
120+
121+
&nbsp; 7. Change the build configuration dropdown to Release
122+
123+
&nbsp; 4. Modify nuget.config file in Project root with {GH\_USER} and {GH\_PAT}
124+
125+
&nbsp; 5. Verify <RepositoryUrl> in the .csproj file is correct
126+
127+
&nbsp; 6. Update Version in the .csproj as needed
128+
129+
&nbsp; 7. Right click on Solution in Solution Explorer and Build Solution
130+
131+
&nbsp; 8. Right click on the Project in Solution Explorer and Pack
132+
133+
&nbsp; 9. In the Powershell window
134+
135+
&nbsp; ```sh
136+
137+
&nbsp; cd AndDone-SecureAPI-ClientLibrary-DotNet-private\\src\\AndDoneSecureClientLibrary
138+
139+
&nbsp; ```
140+
141+
&nbsp; 10. Push the package to GHCR
142+
143+
&nbsp; ```sh
144+
145+
&nbsp; dotnet nuget push "bin\\Release\\AndDoneSecureClientLibrary.1.0.0.nupkg" --api-key {GH\_PAT} --source "githubanddone" --skip-duplicate
146+
147+
&nbsp; ```
148+
149+
150+
151+
4\. Associate Package to Repository
152+
153+
&nbsp; 1. In GitHub -> Select User -> Organizations
154+
155+
&nbsp; 2. Select AndDone-LLC
156+
157+
&nbsp; 3. Click Packages in top menu
158+
159+
&nbsp; 4. Click Package Name
160+
161+
&nbsp; 5. In right side, Click Package Settings
162+
163+
&nbsp; 6. Click Add Repository and select Repository for Package
164+
165+
&nbsp; 7. Verify by going to GitHub code page and the Package will be listed on the right side
166+
167+
168+

0 commit comments

Comments
 (0)