Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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') }}
Expand Down
15 changes: 6 additions & 9 deletions src/Plugins/MinIO/MinIoStorageService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,10 @@ public async Task<Stream> 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;
}

Expand Down Expand Up @@ -219,12 +218,10 @@ public async Task<Stream> 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;
}

Expand Down