Skip to content

Commit

Permalink
Publish API project to nuget (#473)
Browse files Browse the repository at this point in the history
* 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 <vicchang@nvidia.com>
  • Loading branch information
mocsharp authored Sep 13, 2023
1 parent 664452a commit 1018ca0
Show file tree
Hide file tree
Showing 53 changed files with 843 additions and 1,069 deletions.
61 changes: 60 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021-2022 MONAI Consortium
# Copyright 2021-2023 MONAI Consortium
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -39,6 +39,7 @@ jobs:
semVer: ${{ steps.gitversion.outputs.semVer }}
preReleaseLabel: ${{ steps.gitversion.outputs.preReleaseLabel }}
majorMinorPatch: ${{ steps.gitversion.outputs.majorMinorPatch }}
nuGetVersionV2: ${{ steps.gitversion.outputs.nuGetVersionV2 }}

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -308,6 +309,7 @@ jobs:
runs-on: ${{ matrix.os }}
needs: [calc-version]
env:
NUGETVER: ${{ needs.calc-version.outputs.nuGetVersionV2 }}
SEMVER: ${{ needs.calc-version.outputs.semVer }}
PRERELEASELABEL: ${{ needs.calc-version.outputs.preReleaseLabel }}
MAJORMINORPATCH: ${{ needs.calc-version.outputs.majorMinorPatch }}
Expand Down Expand Up @@ -388,6 +390,22 @@ jobs:
path: ~/release
retention-days: 7

- name: Package API
if: ${{ (matrix.os == 'ubuntu-latest') }}
run: |
mkdir ~/nupkg
dotnet pack --no-build -c ${{ env.BUILD_CONFIG }} -o ~/nupkg -p:PackageVersion=${{ env.NUGETVER }}
ls -lR ~/nupkg
working-directory: ./src/Api

- name: Upload Nuget
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: actions/upload-artifact@v3.1.2
with:
name: nuget
path: ~/nupkg
retention-days: 30

- name: Log in to the Container registry
uses: docker/login-action@v2.2.0
if: ${{ (matrix.os == 'ubuntu-latest') }}
Expand Down Expand Up @@ -501,6 +519,31 @@ jobs:
name: artifacts
path: ~/release
retention-days: 7

publish:
name: Publish to GitHub Packages
runs-on: ubuntu-latest
needs: [build, unit-test, integration-test]
if: ${{ ! ( github.event.inputs.nuget ) && ! ( contains(github.ref, 'refs/heads/main') ) }}
steps:
- uses: actions/download-artifact@v3
id: download

- name: List artifacts
run: ls -ldR ${{steps.download.outputs.download-path}}/**/*

- name: Install grp
run: dotnet tool install gpr -g

- uses: actions/setup-dotnet@v3
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
dotnet-version: "6.0.x"
source-url: https://nuget.pkg.github.com/Project-MONAI/index.json

- name: Publish to GitHub
run: gpr push '${{ steps.download.outputs.download-path }}/nuget/*.nupkg' --repository ${{ github.repository }} -k ${{ secrets.GITHUB_TOKEN }}

release:
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') }}
Expand All @@ -521,6 +564,22 @@ jobs:

- name: List artifacts
run: ls -ldR ${{steps.download.outputs.download-path}}/**/*

- name: Install grp
run: dotnet tool install gpr -g

- uses: actions/setup-dotnet@v3
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
dotnet-version: "6.0.x"
source-url: https://nuget.pkg.github.com/Project-MONAI/index.json

- name: Publish to GitHub
run: gpr push '${{ steps.download.outputs.download-path }}/nuget/*.nupkg' --repository ${{ github.repository }} -k ${{ secrets.GITHUB_TOKEN }}

- name: Publish to NuGet.org
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

- name: Extract owner and repo
uses: jungwinter/split@v2
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/package-cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Copyright 2021-2023 MONAI Consortium
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.



name: Cleanup Pre-release Packages

on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/delete-package-versions@v4
name: Monai.Deploy.InformaticsGateway.Api
with:
package-name: 'Monai.Deploy.InformaticsGateway.Api'
package-type: nuget
min-versions-to-keep: 10
delete-only-pre-release-versions: "true"

- uses: actions/delete-package-versions@v4
name: monai-deploy-informatics-gateway
with:
package-name: 'monai-deploy-informatics-gateway'
package-type: container
min-versions-to-keep: 10
delete-only-pre-release-versions: "true"

51 changes: 21 additions & 30 deletions doc/dependency_decisions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,6 @@
:versions:
- 2021.3.0
:when: 2022-08-16 23:05:35.941494226 Z
- - :approve
- Karambolo.Extensions.Logging.File
- :who: mocsharp
:why: MIT (https://github.com/adams85/filelogger/raw/master/LICENSE)
:versions:
- 3.4.0
:when: 2022-08-16 23:05:36.373717252 Z
- - :approve
- Macross.Json.Extensions
- :who: mocsharp
Expand Down Expand Up @@ -313,71 +306,70 @@
- :who: mocsharp
:why: MIT (https://github.com/microsoft/vstest/raw/main/LICENSE)
:versions:
- 17.4.1
- 17.7.1
- 17.7.2
:when: 2022-08-16 23:05:48.342748414 Z
- - :approve
- Microsoft.Data.Sqlite.Core
- :who: mocsharp
:why: MIT (https://raw.githubusercontent.com/dotnet/efcore/release/6.0/LICENSE.txt)
:versions:
- 6.0.21
- 6.0.22
:when: 2022-08-16 23:05:49.698463427 Z
- - :approve
- Microsoft.EntityFrameworkCore
- :who: mocsharp
:why: MIT (https://raw.githubusercontent.com/dotnet/efcore/release/6.0/LICENSE.txt)
:versions:
- 6.0.21
- 6.0.22
:when: 2022-08-16 23:05:50.137694970 Z
- - :approve
- Microsoft.EntityFrameworkCore.Abstractions
- :who: mocsharp
:why: MIT (https://raw.githubusercontent.com/dotnet/efcore/release/6.0/LICENSE.txt)
:versions:
- 6.0.21
- 6.0.22
:when: 2022-08-16 23:05:51.008105271 Z
- - :approve
- Microsoft.EntityFrameworkCore.Analyzers
- :who: mocsharp
:why: MIT (https://raw.githubusercontent.com/dotnet/efcore/release/6.0/LICENSE.txt)
:versions:
- 6.0.21
- 6.0.22
:when: 2022-08-16 23:05:51.445711308 Z
- - :approve
- Microsoft.EntityFrameworkCore.Design
- :who: mocsharp
:why: MIT (https://raw.githubusercontent.com/dotnet/efcore/release/6.0/LICENSE.txt)
:versions:
- 6.0.21
- 6.0.22
:when: 2022-08-16 23:05:51.922790944 Z
- - :approve
- Microsoft.EntityFrameworkCore.InMemory
- :who: mocsharp
:why: MIT (https://raw.githubusercontent.com/dotnet/efcore/release/6.0/LICENSE.txt)
:versions:
- 6.0.21
- 6.0.22
:when: 2022-08-16 23:05:52.375150938 Z
- - :approve
- Microsoft.EntityFrameworkCore.Relational
- :who: mocsharp
:why: MIT (https://raw.githubusercontent.com/dotnet/efcore/release/6.0/LICENSE.txt)
:versions:
- 6.0.21
- 6.0.22
:when: 2022-08-16 23:05:52.828879230 Z
- - :approve
- Microsoft.EntityFrameworkCore.Sqlite
- :who: mocsharp
:why: MIT (https://raw.githubusercontent.com/dotnet/efcore/release/6.0/LICENSE.txt)
:versions:
- 6.0.21
- 6.0.22
:when: 2022-08-16 23:05:53.270526921 Z
- - :approve
- Microsoft.EntityFrameworkCore.Sqlite.Core
- :who: mocsharp
:why: MIT (https://raw.githubusercontent.com/dotnet/efcore/release/6.0/LICENSE.txt)
:versions:
- 6.0.21
- 6.0.22
:when: 2022-08-16 23:05:53.706997823 Z
- - :approve
- Microsoft.Extensions.ApiDescription.Server
Expand Down Expand Up @@ -519,20 +511,22 @@
:why: MIT (https://github.com/dotnet/aspnetcore/raw/main/LICENSE.txt)
:versions:
- 6.0.21
- 6.0.22
:when: 2022-08-29 18:11:22.090772006 Z
- - :approve
- Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions
- :who: mocsharp
:why: MIT (https://github.com/dotnet/aspnetcore/raw/main/LICENSE.txt)
:versions:
- 6.0.21
- 6.0.22
:when: 2022-08-29 18:11:22.090772006 Z
- - :approve
- Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore
- :who: mocsharp
:why: MIT (https://github.com/dotnet/aspnetcore/raw/main/LICENSE.txt)
:versions:
- 6.0.21
- 6.0.22
:when: 2022-08-29 18:11:22.090772006 Z
- - :approve
- Microsoft.Extensions.FileProviders.Abstractions
Expand Down Expand Up @@ -681,8 +675,7 @@
- :who: mocsharp
:why: MIT (https://raw.githubusercontent.com/microsoft/vstest/main/LICENSE)
:versions:
- 17.4.1
- 17.7.1
- 17.7.2
:when: 2022-09-01 23:06:13.008314524 Z
- - :approve
- Microsoft.NETCore.Platforms
Expand Down Expand Up @@ -732,16 +725,14 @@
- :who: mocsharp
:why: MIT (https://github.com/microsoft/vstest/raw/v17.4.0/LICENSE)
:versions:
- 17.4.1
- 17.7.1
- 17.7.2
:when: 2022-08-16 23:06:16.175705981 Z
- - :approve
- Microsoft.TestPlatform.TestHost
- :who: mocsharp
:why: MIT (https://github.com/microsoft/vstest/raw/v17.4.0/LICENSE)
:versions:
- 17.4.1
- 17.7.1
- 17.7.2
:when: 2022-08-16 23:06:17.671459450 Z
- - :approve
- Microsoft.Toolkit.HighPerformance
Expand Down Expand Up @@ -783,14 +774,14 @@
- :who: neilsouth
:why: Apache-2.0 (https://github.com/Project-MONAI/monai-deploy-messaging/raw/main/LICENSE)
:versions:
- 1.0.0
- 1.0.1
:when: 2022-08-16 23:06:21.051573547 Z
- - :approve
- Monai.Deploy.Messaging.RabbitMQ
- :who: neilsouth
:why: Apache-2.0 (https://github.com/Project-MONAI/monai-deploy-messaging/raw/main/LICENSE)
:versions:
- 1.0.0
- 1.0.1
:when: 2022-08-16 23:06:21.511789690 Z
- - :approve
- Monai.Deploy.Storage
Expand Down Expand Up @@ -2270,21 +2261,21 @@
- :who: mocsharp
:why: BSD 3-Clause License (https://github.com/NLog/NLog/raw/dev/LICENSE.txt)
:versions:
- 5.2.3
- 5.2.4
:when: 2022-10-12 03:14:06.538744982 Z
- - :approve
- NLog.Extensions.Logging
- :who: mocsharp
:why: BSD 2-Clause Simplified License (https://github.com/NLog/NLog.Extensions.Logging/raw/master/LICENSE)
:versions:
- 5.3.3
- 5.3.4
:when: 2022-10-12 03:14:06.964203977 Z
- - :approve
- NLog.Web.AspNetCore
- :who: mocsharp
:why: BSD 3-Clause License (https://github.com/NLog/NLog.Web/raw/master/LICENSE)
:versions:
- 5.3.3
- 5.3.4
:when: 2022-10-12 03:14:07.396706995 Z
- - :approve
- fo-dicom.NLog
Expand Down
Loading

0 comments on commit 1018ca0

Please sign in to comment.