diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 26625ee..099300b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -234,6 +234,32 @@ jobs: name: Publish to GitHub Packages runs-on: ubuntu-latest needs: [build, unit-test] + if: ${{ ! ( github.event.inputs.nuget ) }} + steps: + - uses: actions/download-artifact@v2 + 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@v1 + 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-nuget: + name: Official Release to GitHub Packages + runs-on: ubuntu-latest + needs: [build, unit-test] + if: ${{ github.event.inputs.nuget }} steps: - uses: actions/download-artifact@v2 id: download @@ -296,6 +322,8 @@ jobs: repository: ${{ steps.repo.outputs._1 }} milestone: ${{ env.MAJORMINORPATCH }} name: Release v${{ env.MAJORMINORPATCH }} + assets: | + ${{ steps.download.outputs.download-path }}/plug-ins/*.zip - name: Publish release with GitReleaseManager if: ${{ contains(github.ref, 'refs/heads/main') }} diff --git a/src/Plugins/MinIO/MinIoStorageService.cs b/src/Plugins/MinIO/MinIoStorageService.cs index 5aca265..b423b1d 100644 --- a/src/Plugins/MinIO/MinIoStorageService.cs +++ b/src/Plugins/MinIO/MinIoStorageService.cs @@ -67,11 +67,10 @@ public async Task GetObjectAsync(string bucketName, string objectName, C Guard.Against.NullOrWhiteSpace(bucketName, nameof(bucketName)); Guard.Against.NullOrWhiteSpace(objectName, nameof(objectName)); - var stream = new MemoryStream(); - var client = _minioClientFactory.GetClient(); - await GetObjectUsingClient(client, bucketName, objectName, async (s) => await s.CopyToAsync(stream), cancellationToken).ConfigureAwait(false); - + var stream = new MemoryStream(); + await GetObjectUsingClient(client, bucketName, objectName, (s) => s.CopyTo(stream), cancellationToken).ConfigureAwait(false); + stream.Seek(0, SeekOrigin.Begin); return stream; } @@ -219,12 +218,10 @@ public async Task GetObjectWithCredentialsAsync(string bucketName, strin Guard.Against.NullOrWhiteSpace(bucketName, nameof(bucketName)); Guard.Against.NullOrWhiteSpace(objectName, nameof(objectName)); - var stream = new MemoryStream(); - var client = _minioClientFactory.GetClient(credentials, _options.Settings[ConfigurationKeys.Region]); - - await GetObjectUsingClient(client, bucketName, objectName, async (s) => await s.CopyToAsync(stream), cancellationToken).ConfigureAwait(false); - + var stream = new MemoryStream(); + await GetObjectUsingClient(client, bucketName, objectName, (s) => s.CopyTo(stream), cancellationToken).ConfigureAwait(false); + stream.Seek(0, SeekOrigin.Begin); return stream; }