Skip to content

Commit 1018ca0

Browse files
authored
Publish API project to nuget (#473)
* Update NLog console formatter & Messaging lib * Publish API project to nuget * Update license decisions * Update copyright header * Use seconds for duration and log connection duration Signed-off-by: Victor Chang <[email protected]>
1 parent 664452a commit 1018ca0

File tree

53 files changed

+843
-1069
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+843
-1069
lines changed

.github/workflows/ci.yml

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2021-2022 MONAI Consortium
1+
# Copyright 2021-2023 MONAI Consortium
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -39,6 +39,7 @@ jobs:
3939
semVer: ${{ steps.gitversion.outputs.semVer }}
4040
preReleaseLabel: ${{ steps.gitversion.outputs.preReleaseLabel }}
4141
majorMinorPatch: ${{ steps.gitversion.outputs.majorMinorPatch }}
42+
nuGetVersionV2: ${{ steps.gitversion.outputs.nuGetVersionV2 }}
4243

4344
steps:
4445
- uses: actions/checkout@v3
@@ -308,6 +309,7 @@ jobs:
308309
runs-on: ${{ matrix.os }}
309310
needs: [calc-version]
310311
env:
312+
NUGETVER: ${{ needs.calc-version.outputs.nuGetVersionV2 }}
311313
SEMVER: ${{ needs.calc-version.outputs.semVer }}
312314
PRERELEASELABEL: ${{ needs.calc-version.outputs.preReleaseLabel }}
313315
MAJORMINORPATCH: ${{ needs.calc-version.outputs.majorMinorPatch }}
@@ -388,6 +390,22 @@ jobs:
388390
path: ~/release
389391
retention-days: 7
390392

393+
- name: Package API
394+
if: ${{ (matrix.os == 'ubuntu-latest') }}
395+
run: |
396+
mkdir ~/nupkg
397+
dotnet pack --no-build -c ${{ env.BUILD_CONFIG }} -o ~/nupkg -p:PackageVersion=${{ env.NUGETVER }}
398+
ls -lR ~/nupkg
399+
working-directory: ./src/Api
400+
401+
- name: Upload Nuget
402+
if: ${{ matrix.os == 'ubuntu-latest' }}
403+
uses: actions/[email protected]
404+
with:
405+
name: nuget
406+
path: ~/nupkg
407+
retention-days: 30
408+
391409
- name: Log in to the Container registry
392410
uses: docker/[email protected]
393411
if: ${{ (matrix.os == 'ubuntu-latest') }}
@@ -501,6 +519,31 @@ jobs:
501519
name: artifacts
502520
path: ~/release
503521
retention-days: 7
522+
523+
publish:
524+
name: Publish to GitHub Packages
525+
runs-on: ubuntu-latest
526+
needs: [build, unit-test, integration-test]
527+
if: ${{ ! ( github.event.inputs.nuget ) && ! ( contains(github.ref, 'refs/heads/main') ) }}
528+
steps:
529+
- uses: actions/download-artifact@v3
530+
id: download
531+
532+
- name: List artifacts
533+
run: ls -ldR ${{steps.download.outputs.download-path}}/**/*
534+
535+
- name: Install grp
536+
run: dotnet tool install gpr -g
537+
538+
- uses: actions/setup-dotnet@v3
539+
env:
540+
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
541+
with:
542+
dotnet-version: "6.0.x"
543+
source-url: https://nuget.pkg.github.com/Project-MONAI/index.json
544+
545+
- name: Publish to GitHub
546+
run: gpr push '${{ steps.download.outputs.download-path }}/nuget/*.nupkg' --repository ${{ github.repository }} -k ${{ secrets.GITHUB_TOKEN }}
504547

505548
release:
506549
if: ${{ contains(github.ref, 'refs/heads/main') || contains(github.ref, 'refs/heads/develop') ||contains(github.head_ref, 'release/') || contains(github.head_ref, 'feature/') || contains(github.head_ref, 'develop') }}
@@ -521,6 +564,22 @@ jobs:
521564

522565
- name: List artifacts
523566
run: ls -ldR ${{steps.download.outputs.download-path}}/**/*
567+
568+
- name: Install grp
569+
run: dotnet tool install gpr -g
570+
571+
- uses: actions/setup-dotnet@v3
572+
env:
573+
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
574+
with:
575+
dotnet-version: "6.0.x"
576+
source-url: https://nuget.pkg.github.com/Project-MONAI/index.json
577+
578+
- name: Publish to GitHub
579+
run: gpr push '${{ steps.download.outputs.download-path }}/nuget/*.nupkg' --repository ${{ github.repository }} -k ${{ secrets.GITHUB_TOKEN }}
580+
581+
- name: Publish to NuGet.org
582+
run: dotnet nuget push ${{ steps.download.outputs.download-path }}/nuget/*.nupkg -s https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET }} --skip-duplicate
524583

525584
- name: Extract owner and repo
526585
uses: jungwinter/split@v2

.github/workflows/package-cleanup.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Copyright 2021-2023 MONAI Consortium
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
16+
17+
name: Cleanup Pre-release Packages
18+
19+
on:
20+
schedule:
21+
- cron: "0 0 * * *"
22+
workflow_dispatch:
23+
24+
jobs:
25+
build:
26+
27+
runs-on: ubuntu-latest
28+
29+
steps:
30+
- uses: actions/delete-package-versions@v4
31+
name: Monai.Deploy.InformaticsGateway.Api
32+
with:
33+
package-name: 'Monai.Deploy.InformaticsGateway.Api'
34+
package-type: nuget
35+
min-versions-to-keep: 10
36+
delete-only-pre-release-versions: "true"
37+
38+
- uses: actions/delete-package-versions@v4
39+
name: monai-deploy-informatics-gateway
40+
with:
41+
package-name: 'monai-deploy-informatics-gateway'
42+
package-type: container
43+
min-versions-to-keep: 10
44+
delete-only-pre-release-versions: "true"
45+

doc/dependency_decisions.yml

Lines changed: 21 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,6 @@
125125
:versions:
126126
- 2021.3.0
127127
:when: 2022-08-16 23:05:35.941494226 Z
128-
- - :approve
129-
- Karambolo.Extensions.Logging.File
130-
- :who: mocsharp
131-
:why: MIT (https://github.com/adams85/filelogger/raw/master/LICENSE)
132-
:versions:
133-
- 3.4.0
134-
:when: 2022-08-16 23:05:36.373717252 Z
135128
- - :approve
136129
- Macross.Json.Extensions
137130
- :who: mocsharp
@@ -313,71 +306,70 @@
313306
- :who: mocsharp
314307
:why: MIT (https://github.com/microsoft/vstest/raw/main/LICENSE)
315308
:versions:
316-
- 17.4.1
317-
- 17.7.1
309+
- 17.7.2
318310
:when: 2022-08-16 23:05:48.342748414 Z
319311
- - :approve
320312
- Microsoft.Data.Sqlite.Core
321313
- :who: mocsharp
322314
:why: MIT (https://raw.githubusercontent.com/dotnet/efcore/release/6.0/LICENSE.txt)
323315
:versions:
324-
- 6.0.21
316+
- 6.0.22
325317
:when: 2022-08-16 23:05:49.698463427 Z
326318
- - :approve
327319
- Microsoft.EntityFrameworkCore
328320
- :who: mocsharp
329321
:why: MIT (https://raw.githubusercontent.com/dotnet/efcore/release/6.0/LICENSE.txt)
330322
:versions:
331-
- 6.0.21
323+
- 6.0.22
332324
:when: 2022-08-16 23:05:50.137694970 Z
333325
- - :approve
334326
- Microsoft.EntityFrameworkCore.Abstractions
335327
- :who: mocsharp
336328
:why: MIT (https://raw.githubusercontent.com/dotnet/efcore/release/6.0/LICENSE.txt)
337329
:versions:
338-
- 6.0.21
330+
- 6.0.22
339331
:when: 2022-08-16 23:05:51.008105271 Z
340332
- - :approve
341333
- Microsoft.EntityFrameworkCore.Analyzers
342334
- :who: mocsharp
343335
:why: MIT (https://raw.githubusercontent.com/dotnet/efcore/release/6.0/LICENSE.txt)
344336
:versions:
345-
- 6.0.21
337+
- 6.0.22
346338
:when: 2022-08-16 23:05:51.445711308 Z
347339
- - :approve
348340
- Microsoft.EntityFrameworkCore.Design
349341
- :who: mocsharp
350342
:why: MIT (https://raw.githubusercontent.com/dotnet/efcore/release/6.0/LICENSE.txt)
351343
:versions:
352-
- 6.0.21
344+
- 6.0.22
353345
:when: 2022-08-16 23:05:51.922790944 Z
354346
- - :approve
355347
- Microsoft.EntityFrameworkCore.InMemory
356348
- :who: mocsharp
357349
:why: MIT (https://raw.githubusercontent.com/dotnet/efcore/release/6.0/LICENSE.txt)
358350
:versions:
359-
- 6.0.21
351+
- 6.0.22
360352
:when: 2022-08-16 23:05:52.375150938 Z
361353
- - :approve
362354
- Microsoft.EntityFrameworkCore.Relational
363355
- :who: mocsharp
364356
:why: MIT (https://raw.githubusercontent.com/dotnet/efcore/release/6.0/LICENSE.txt)
365357
:versions:
366-
- 6.0.21
358+
- 6.0.22
367359
:when: 2022-08-16 23:05:52.828879230 Z
368360
- - :approve
369361
- Microsoft.EntityFrameworkCore.Sqlite
370362
- :who: mocsharp
371363
:why: MIT (https://raw.githubusercontent.com/dotnet/efcore/release/6.0/LICENSE.txt)
372364
:versions:
373-
- 6.0.21
365+
- 6.0.22
374366
:when: 2022-08-16 23:05:53.270526921 Z
375367
- - :approve
376368
- Microsoft.EntityFrameworkCore.Sqlite.Core
377369
- :who: mocsharp
378370
:why: MIT (https://raw.githubusercontent.com/dotnet/efcore/release/6.0/LICENSE.txt)
379371
:versions:
380-
- 6.0.21
372+
- 6.0.22
381373
:when: 2022-08-16 23:05:53.706997823 Z
382374
- - :approve
383375
- Microsoft.Extensions.ApiDescription.Server
@@ -519,20 +511,22 @@
519511
:why: MIT (https://github.com/dotnet/aspnetcore/raw/main/LICENSE.txt)
520512
:versions:
521513
- 6.0.21
514+
- 6.0.22
522515
:when: 2022-08-29 18:11:22.090772006 Z
523516
- - :approve
524517
- Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions
525518
- :who: mocsharp
526519
:why: MIT (https://github.com/dotnet/aspnetcore/raw/main/LICENSE.txt)
527520
:versions:
528521
- 6.0.21
522+
- 6.0.22
529523
:when: 2022-08-29 18:11:22.090772006 Z
530524
- - :approve
531525
- Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore
532526
- :who: mocsharp
533527
:why: MIT (https://github.com/dotnet/aspnetcore/raw/main/LICENSE.txt)
534528
:versions:
535-
- 6.0.21
529+
- 6.0.22
536530
:when: 2022-08-29 18:11:22.090772006 Z
537531
- - :approve
538532
- Microsoft.Extensions.FileProviders.Abstractions
@@ -681,8 +675,7 @@
681675
- :who: mocsharp
682676
:why: MIT (https://raw.githubusercontent.com/microsoft/vstest/main/LICENSE)
683677
:versions:
684-
- 17.4.1
685-
- 17.7.1
678+
- 17.7.2
686679
:when: 2022-09-01 23:06:13.008314524 Z
687680
- - :approve
688681
- Microsoft.NETCore.Platforms
@@ -732,16 +725,14 @@
732725
- :who: mocsharp
733726
:why: MIT (https://github.com/microsoft/vstest/raw/v17.4.0/LICENSE)
734727
:versions:
735-
- 17.4.1
736-
- 17.7.1
728+
- 17.7.2
737729
:when: 2022-08-16 23:06:16.175705981 Z
738730
- - :approve
739731
- Microsoft.TestPlatform.TestHost
740732
- :who: mocsharp
741733
:why: MIT (https://github.com/microsoft/vstest/raw/v17.4.0/LICENSE)
742734
:versions:
743-
- 17.4.1
744-
- 17.7.1
735+
- 17.7.2
745736
:when: 2022-08-16 23:06:17.671459450 Z
746737
- - :approve
747738
- Microsoft.Toolkit.HighPerformance
@@ -783,14 +774,14 @@
783774
- :who: neilsouth
784775
:why: Apache-2.0 (https://github.com/Project-MONAI/monai-deploy-messaging/raw/main/LICENSE)
785776
:versions:
786-
- 1.0.0
777+
- 1.0.1
787778
:when: 2022-08-16 23:06:21.051573547 Z
788779
- - :approve
789780
- Monai.Deploy.Messaging.RabbitMQ
790781
- :who: neilsouth
791782
:why: Apache-2.0 (https://github.com/Project-MONAI/monai-deploy-messaging/raw/main/LICENSE)
792783
:versions:
793-
- 1.0.0
784+
- 1.0.1
794785
:when: 2022-08-16 23:06:21.511789690 Z
795786
- - :approve
796787
- Monai.Deploy.Storage
@@ -2270,21 +2261,21 @@
22702261
- :who: mocsharp
22712262
:why: BSD 3-Clause License (https://github.com/NLog/NLog/raw/dev/LICENSE.txt)
22722263
:versions:
2273-
- 5.2.3
2264+
- 5.2.4
22742265
:when: 2022-10-12 03:14:06.538744982 Z
22752266
- - :approve
22762267
- NLog.Extensions.Logging
22772268
- :who: mocsharp
22782269
:why: BSD 2-Clause Simplified License (https://github.com/NLog/NLog.Extensions.Logging/raw/master/LICENSE)
22792270
:versions:
2280-
- 5.3.3
2271+
- 5.3.4
22812272
:when: 2022-10-12 03:14:06.964203977 Z
22822273
- - :approve
22832274
- NLog.Web.AspNetCore
22842275
- :who: mocsharp
22852276
:why: BSD 3-Clause License (https://github.com/NLog/NLog.Web/raw/master/LICENSE)
22862277
:versions:
2287-
- 5.3.3
2278+
- 5.3.4
22882279
:when: 2022-10-12 03:14:07.396706995 Z
22892280
- - :approve
22902281
- fo-dicom.NLog

0 commit comments

Comments
 (0)