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