Skip to content

[2.0] Fix the experimental feed #356

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Nov 26, 2020
Merged
10 changes: 6 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ jobs:
dotnet-version: 5.0.100
- name: Setup NUKE
run: dotnet tool install Nuke.GlobalTool --global
- name: Pack
# TODO build native mixins such as BuildLibSilkDroid
run: nuke Pack --configuration Release --msbuild-properties VersionSuffix=build$GITHUB_RUN_NUMBER.0 ContinuousIntegrationBuild=true --feature-sets Android iOS
- name: Test
# skip Clean, Restore, and Compile as this will build the affect the whole solution.
# dotnet test will compile the necessary projects for testing only.
run: nuke Test --skip Clean Restore Compile
- name: Pack
# TODO build native mixins such as BuildLibSilkDroid
run: nuke Pack --configuration Release --msbuild-properties VersionSuffix=build${{ github.run_number }}.0 ContinuousIntegrationBuild=true --feature-sets Android iOS
- name: Push to NuGet
if: ${{ github.repository == 'Ultz/Silk.NET' && github.event_name != 'pull_request' }}
run: nuke PushToNuGet --skip Clean Restore Pack --nuget-feed https://pkgs.dev.azure.com/UltzOS/Silk.NET/_packaging/Experimental/nuget/v3/index.json --nuget-username ${{ secrets.AZDO_ARTIFACTS_USERNAME }} --nuget-password ${{ secrets.AZDO_ARTIFACTS_TOKEN }} --nuget-api-key az
run: nuke PushToNuGet --skip Clean Restore Compile Pack --nuget-feed https://pkgs.dev.azure.com/UltzOS/Silk.NET/_packaging/Experimental/nuget/v3/index.json --nuget-username ${{ secrets.AZDO_ARTIFACTS_USERNAME }} --nuget-password ${{ secrets.AZDO_ARTIFACTS_TOKEN }} --nuget-api-key az
18 changes: 11 additions & 7 deletions build/nuke/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -373,15 +373,18 @@ async Task PushPackages()
{
const int rateLimit = 300;
var allFiles = Directory.GetFiles(RootDirectory / "build" / "output_packages", "*.nupkg")
.Where(x => x.StartsWith("Silk.NET"))
.Where(x => Path.GetFileName(x).StartsWith("Silk.NET"))
.Select((x, i) => new {Index = i, Value = x})
.GroupBy(x => x.Index / rateLimit)
.Select(x => x.Select(v => v.Value).ToList())
.ToList();
var first = true;
var pushed = 0;
var feed = NuGetInterface.OpenNuGetFeed(NugetFeed, NugetUsername, NugetPassword);
var uploadResource = await NuGetInterface.GetUploadResourceAsync(feed);
var symbolsResource = await NuGetInterface.GetSymbolsUploadResourceAsync(feed);
var exceptions = new List<Exception>();
Logger.Info($"Searching for packages in \"{RootDirectory / "build" / "output_packages"}\"...");
foreach (var files in allFiles)
{
if (first)
Expand All @@ -393,24 +396,25 @@ async Task PushPackages()
await Task.Delay(TimeSpan.FromHours(1));
}

var exceptions = new List<Exception>();

foreach (var file in files)
{
try
{
await NuGetInterface.UploadPackageAsync(uploadResource, NugetNoServiceEndpoint, file, NugetApiKey, symbolsResource);
pushed++;
}
catch (Exception ex)
{
exceptions.Add(new Exception($"Failed to push package \"{file}\"", ex));
}
}
}

if (exceptions.Count > 0)
{
throw new AggregateException(exceptions);
}
Logger.Success($"Successfully pushed {pushed} packages.");

if (exceptions.Count > 0)
{
throw new AggregateException(exceptions);
}
}
}
4 changes: 2 additions & 2 deletions src/OpenGL/Silk.NET.OpenGL/GL.cs
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ public string GetActiveAttrib(uint program, uint index, out int size, out Attrib
length = (uint) lengthTmp;

GetActiveAttrib
(program, index, (uint) (length == 0 ? 1 : length * 2), out length, out size, out type, out var str);
(program, index, (uint) (length == 0 ? 1 : length * 2), out length, out size, out type, out string str);

return str.Substring(0, (int) length);
}
Expand Down Expand Up @@ -408,7 +408,7 @@ public string GetActiveUniform(uint program, uint uniformIndex, out int size, ou
length = (uint) lengthTmp;

GetActiveUniform
(program, uniformIndex, length == 0 ? 1 : length, out length, out size, out type, out var str);
(program, uniformIndex, length == 0 ? 1 : length, out length, out size, out type, out string str);

return str.Substring(0, (int) length);
}
Expand Down