diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bf83cca21..fa4f3da4a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,12 @@ name: Build -on: +on: + workflow_dispatch: + inputs: + skip-duplicates: + description: 'Whether to fail or skip duplicates when uploading to a package repository' + required: false + default: 'true' push: branches: - 'master' @@ -27,10 +33,15 @@ jobs: with: fetch-depth: 0 + - name: Install .NET + uses: actions/setup-dotnet@v2 + with: + dotnet-version: '6.0.x' + - name: Restore run: dotnet restore $Env:SolutionFile - - name: Prepare Nuspec and Build + - name: Prepare Nuspec run: | [xml]$build_props = Get-Content $Env:BuildProps $PACKAGE_VERSION = $build_props.Project.PropertyGroup.AssemblyVersion @@ -52,16 +63,74 @@ jobs: $xml.package.metadata.repository.branch = $Env:GITHUB_REF $xml.package.metadata.repository.commit = $Env:GITHUB_SHA + Write-Output "Packge version to be used: $NEW_PACKAGE_VERSION" + echo "NUGET_PACKAGE_VERSION=$NEW_PACKAGE_VERSION" >> $env:GITHUB_ENV + $xml.Save($Env:NuspecFile) - dotnet msbuild $Env:SolutionFile -p:Configuration=$Env:Configuration /t:Clean,Build + - name: Build + run: dotnet msbuild $Env:SolutionFile -p:Configuration=$Env:Configuration /t:Clean,Build - name: Package run: dotnet pack $Env:SolutionFile --output $Env:PackageFolder /p:NuspecFile=..\..\$Env:NuspecFile + - name: Sign + if: github.base_ref == '' + env: + TIMESTAMPER_URL: ${{ secrets.CODE_SIGN_CERTIFICATE_TIMESTAMPER_URL }} + PFX_BASE64: ${{ secrets.CODE_SIGN_CERTIFICATE_BASE64 }} + PFX_PASS: ${{ secrets.CODE_SIGN_CERTIFICATE_PASSWORD }} + run: | + $codesign_pfx = "code_sign_cert.pfx" + $bytes = [Convert]::FromBase64String($Env:PFX_BASE64) + [IO.File]::WriteAllBytes($codesign_pfx, $bytes) + + Get-ChildItem ".\*.nupkg" -Recurse | ForEach-Object { + dotnet nuget sign $_.FullName --certificate-path $codesign_pfx --certificate-password $Env:PFX_PASS --timestamper $Env:TIMESTAMPER_URL + } + + - name: Configure Azure Artifacts feed + if: github.base_ref == '' + env: + AzureArtifactsPrereleaseFeedURL: https://pkgs.dev.azure.com/genexuslabs/13fb82d9-57a8-49ef-95bb-0ec8324e470c/_packaging/dotnet-prereleases/nuget/v3/index.json + AzureArtifactsReleaseFeedURL: https://pkgs.dev.azure.com/genexuslabs/13fb82d9-57a8-49ef-95bb-0ec8324e470c/_packaging/dotnet-releases/nuget/v3/index.json + run: | + $IsPrerelease = "${{ github.ref }}".StartsWith("refs/heads/") + $AZURE_ARTIFACTS_URL = @("$Env:AzureArtifactsReleaseFeedURL", "$Env:AzureArtifactsPrereleaseFeedURL")[$IsPrerelease] + + dotnet nuget add source $AZURE_ARTIFACTS_URL --name AzureArtifacts --username genexuslabs --password ${{ secrets.AZURE_ARTIFACTS_TOKEN }} + + echo "AZURE_ARTIFACTS_URL=$AZURE_ARTIFACTS_URL" >> $env:GITHUB_ENV + - name: Publish - if: github.repository_owner == 'GeneXusLabs' && github.base_ref == '' + if: github.base_ref == '' env: - GPRUrl: https://nuget.pkg.github.com/genexuslabs/index.json - run: dotnet nuget push build\packages\GXOData.Client.*.nupkg --source $Env:GPRUrl --api-key ${{ secrets.SECURE_TOKEN }} + GPRFeedURL: https://nuget.pkg.github.com/genexuslabs/index.json + NuGetFeedURL: https://api.nuget.org/v3/index.json + run: | + $IsPrerelease = "${{ github.ref }}".StartsWith("refs/heads/") + + Get-ChildItem ".\*.nupkg" -Recurse | ForEach-Object { + $PushToGitHubArgs = @("nuget", "push", $_.FullName, "--source", $Env:GPRFeedURL, "--api-key", "${{ secrets.SECURE_TOKEN }}") + $PushToNugetArgs = @("nuget", "push", $_.FullName, "--source", $Env:NuGetFeedURL, "--api-key", "${{ secrets.NUGET_ORG_TOKEN }}") + $PushToAzureArgs = @("nuget", "push", $_.FullName, "--source", $Env:AZURE_ARTIFACTS_URL, "--api-key", "DUMMY-KEY") + if ([string]::IsNullOrEmpty("${{ github.event.inputs.skip-duplicates }}") ) { + $skipDuplicates = $true + } else { + $skipDuplicates = [System.Convert]::ToBoolean("${{ github.event.inputs.skip-duplicates }}") + } + + if ($skipDuplicates) { + $PushToNugetArgs += "--skip-duplicate" + $PushToGitHubArgs += "--skip-duplicate" + $PushToAzureArgs += "--skip-duplicate" + } + + dotnet $PushToAzureArgs + + if (! $IsPrerelease) { + dotnet $PushToGitHubArgs + dotnet $PushToNugetArgs + } + } diff --git a/GXOData.Client.nuspec b/GXOData.Client.nuspec index 990222737..cc8dff397 100644 --- a/GXOData.Client.nuspec +++ b/GXOData.Client.nuspec @@ -1,10 +1,10 @@ - GXOdata.Client + GeneXus.Odata.Client Vagif Abilov and GeneXus - Vagif Abilov + GeneXus GXOdata.Client is a multiplatform OData client library supporting .NET 4.x, .NET Standard, .NET Core, iOS and Android. The adapter provides a great alternative to WCF Data Services client. It does not require generation of context or entity classes and fits RESTful nature of OData services. The package GXOdata.Client contains libraries that can work with OData feeds that implement both V1-3 and V4 OData protocol. @@ -15,7 +15,7 @@ MIT - Copyright 2012-2018 Vagif Abilov + Copyright 2012-2022 GeneXus en-us odata data rest client portable pcl netfx net40 net45 netstandard netcore mono adnroid ios diff --git a/Simple.OData.Client.nuspec b/Simple.OData.Client.nuspec index 1cc1165b5..e2b11a495 100644 --- a/Simple.OData.Client.nuspec +++ b/Simple.OData.Client.nuspec @@ -1,24 +1,24 @@ - Simple.OData.Client - Vagif Abilov + GeneXus.GXOdata.Client + GeneXus 0.0.0.0 - Vagif Abilov + GeneXus - Simple.OData.Client is a multiplatform OData client library supporting .NET 4.x, .NET Standard, .NET Core, iOS and Android. The adapter provides a great alternative to WCF Data Services client. It does not require generation of context or entity classes and fits RESTful nature of OData services. - The package Simple.OData.Client contains libraries that can work with OData feeds that implement both V1-3 and V4 OData protocol. + GeneXus.GXOdata.Client is a multiplatform OData client library supporting .NET 4.x, .NET Standard, .NET Core, iOS and Android. The adapter provides a great alternative to WCF Data Services client. It does not require generation of context or entity classes and fits RESTful nature of OData services. + The package GeneXus.GXOdata.Client contains libraries that can work with OData feeds that implement both V1-3 and V4 OData protocol. Packages Simple.OData.V3.Client and Simple.OData.V4.Client have smaller footprints and target V1-3 and V4 respectively. - Simple.OData.Client is a multiplatform OData client library supporting .NET 4.x, .NET Standard, .NET Core, iOS and Android. The adapter provides a great alternative to WCF Data Services client. It does not require generation of context or entity classes and fits RESTful nature of OData services. - The package Simple.OData.Client contains libraries that can work with OData feeds that implement both V1-3 and V4 OData protocol. + GeneXus.GXOdata.Client is a multiplatform OData client library supporting .NET 4.x, .NET Standard, .NET Core, iOS and Android. The adapter provides a great alternative to WCF Data Services client. It does not require generation of context or entity classes and fits RESTful nature of OData services. + The package GeneXus.GXOdata.Client contains libraries that can work with OData feeds that implement both V1-3 and V4 OData protocol. Packages Simple.OData.V3.Client and Simple.OData.V4.Client have smaller footprints and target V1-3 and V4 respectively. - https://github.com/object/Simple.OData.Client + https://github.com/genexuslabs/Simple.OData.Client http://www.opensource.org/licenses/mit-license.php http://www.odata.org/wp-content/uploads/2014/05/ODataLogo-96.png - Copyright 2012-2018 Vagif Abilov + Copyright 2012-2022 GeneXus en-us odata data rest client portable pcl netfx net40 net45 netstandard netcore mono adnroid ios diff --git a/src/GXOdata.Client.All/Directory.Build.props b/src/GXOdata.Client.All/Directory.Build.props index 7fa9813c7..bded18a08 100644 --- a/src/GXOdata.Client.All/Directory.Build.props +++ b/src/GXOdata.Client.All/Directory.Build.props @@ -1,6 +1,6 @@ - 5.2.3.5 + 5.2.3.7 $(AssemblyVersion) $([System.DateTime]::UtcNow.ToString("yyyyMMddHHmmss")).$(GITHUB_SHA) GeneXus