Skip to content

Commit 2cf2052

Browse files
authored
Update build workflows (#7)
* Update build workflow to publish to Nuget and Azure Update project metadata Update version * Update feed URLs
1 parent e534ecf commit 2cf2052

File tree

4 files changed

+88
-19
lines changed

4 files changed

+88
-19
lines changed

.github/workflows/build.yml

Lines changed: 75 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
name: Build
22

3-
on:
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
skip-duplicates:
7+
description: 'Whether to fail or skip duplicates when uploading to a package repository'
8+
required: false
9+
default: 'true'
410
push:
511
branches:
612
- 'master'
@@ -27,10 +33,15 @@ jobs:
2733
with:
2834
fetch-depth: 0
2935

36+
- name: Install .NET
37+
uses: actions/setup-dotnet@v2
38+
with:
39+
dotnet-version: '6.0.x'
40+
3041
- name: Restore
3142
run: dotnet restore $Env:SolutionFile
3243

33-
- name: Prepare Nuspec and Build
44+
- name: Prepare Nuspec
3445
run: |
3546
[xml]$build_props = Get-Content $Env:BuildProps
3647
$PACKAGE_VERSION = $build_props.Project.PropertyGroup.AssemblyVersion
@@ -52,16 +63,74 @@ jobs:
5263
$xml.package.metadata.repository.branch = $Env:GITHUB_REF
5364
$xml.package.metadata.repository.commit = $Env:GITHUB_SHA
5465
66+
Write-Output "Packge version to be used: $NEW_PACKAGE_VERSION"
67+
echo "NUGET_PACKAGE_VERSION=$NEW_PACKAGE_VERSION" >> $env:GITHUB_ENV
68+
5569
$xml.Save($Env:NuspecFile)
5670
57-
dotnet msbuild $Env:SolutionFile -p:Configuration=$Env:Configuration /t:Clean,Build
71+
- name: Build
72+
run: dotnet msbuild $Env:SolutionFile -p:Configuration=$Env:Configuration /t:Clean,Build
5873

5974
- name: Package
6075
run: dotnet pack $Env:SolutionFile --output $Env:PackageFolder /p:NuspecFile=..\..\$Env:NuspecFile
6176

77+
- name: Sign
78+
if: github.base_ref == ''
79+
env:
80+
TIMESTAMPER_URL: ${{ secrets.CODE_SIGN_CERTIFICATE_TIMESTAMPER_URL }}
81+
PFX_BASE64: ${{ secrets.CODE_SIGN_CERTIFICATE_BASE64 }}
82+
PFX_PASS: ${{ secrets.CODE_SIGN_CERTIFICATE_PASSWORD }}
83+
run: |
84+
$codesign_pfx = "code_sign_cert.pfx"
85+
$bytes = [Convert]::FromBase64String($Env:PFX_BASE64)
86+
[IO.File]::WriteAllBytes($codesign_pfx, $bytes)
87+
88+
Get-ChildItem ".\*.nupkg" -Recurse | ForEach-Object {
89+
dotnet nuget sign $_.FullName --certificate-path $codesign_pfx --certificate-password $Env:PFX_PASS --timestamper $Env:TIMESTAMPER_URL
90+
}
91+
92+
- name: Configure Azure Artifacts feed
93+
if: github.base_ref == ''
94+
env:
95+
AzureArtifactsPrereleaseFeedURL: https://pkgs.dev.azure.com/genexuslabs/13fb82d9-57a8-49ef-95bb-0ec8324e470c/_packaging/dotnet-prereleases/nuget/v3/index.json
96+
AzureArtifactsReleaseFeedURL: https://pkgs.dev.azure.com/genexuslabs/13fb82d9-57a8-49ef-95bb-0ec8324e470c/_packaging/dotnet-releases/nuget/v3/index.json
97+
run: |
98+
$IsPrerelease = "${{ github.ref }}".StartsWith("refs/heads/")
99+
$AZURE_ARTIFACTS_URL = @("$Env:AzureArtifactsReleaseFeedURL", "$Env:AzureArtifactsPrereleaseFeedURL")[$IsPrerelease]
100+
101+
dotnet nuget add source $AZURE_ARTIFACTS_URL --name AzureArtifacts --username genexuslabs --password ${{ secrets.AZURE_ARTIFACTS_TOKEN }}
102+
103+
echo "AZURE_ARTIFACTS_URL=$AZURE_ARTIFACTS_URL" >> $env:GITHUB_ENV
104+
62105
- name: Publish
63-
if: github.repository_owner == 'GeneXusLabs' && github.base_ref == ''
106+
if: github.base_ref == ''
64107
env:
65-
GPRUrl: https://nuget.pkg.github.com/genexuslabs/index.json
66-
run: dotnet nuget push build\packages\GXOData.Client.*.nupkg --source $Env:GPRUrl --api-key ${{ secrets.SECURE_TOKEN }}
108+
GPRFeedURL: https://nuget.pkg.github.com/genexuslabs/index.json
109+
NuGetFeedURL: https://api.nuget.org/v3/index.json
110+
run: |
111+
$IsPrerelease = "${{ github.ref }}".StartsWith("refs/heads/")
112+
113+
Get-ChildItem ".\*.nupkg" -Recurse | ForEach-Object {
114+
$PushToGitHubArgs = @("nuget", "push", $_.FullName, "--source", $Env:GPRFeedURL, "--api-key", "${{ secrets.SECURE_TOKEN }}")
115+
$PushToNugetArgs = @("nuget", "push", $_.FullName, "--source", $Env:NuGetFeedURL, "--api-key", "${{ secrets.NUGET_ORG_TOKEN }}")
116+
$PushToAzureArgs = @("nuget", "push", $_.FullName, "--source", $Env:AZURE_ARTIFACTS_URL, "--api-key", "DUMMY-KEY")
67117
118+
if ([string]::IsNullOrEmpty("${{ github.event.inputs.skip-duplicates }}") ) {
119+
$skipDuplicates = $true
120+
} else {
121+
$skipDuplicates = [System.Convert]::ToBoolean("${{ github.event.inputs.skip-duplicates }}")
122+
}
123+
124+
if ($skipDuplicates) {
125+
$PushToNugetArgs += "--skip-duplicate"
126+
$PushToGitHubArgs += "--skip-duplicate"
127+
$PushToAzureArgs += "--skip-duplicate"
128+
}
129+
130+
dotnet $PushToAzureArgs
131+
132+
if (! $IsPrerelease) {
133+
dotnet $PushToGitHubArgs
134+
dotnet $PushToNugetArgs
135+
}
136+
}

GXOData.Client.nuspec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?xml version="1.0"?>
22
<package xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
33
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
4-
<id>GXOdata.Client</id>
4+
<id>GeneXus.Odata.Client</id>
55
<authors>Vagif Abilov and GeneXus</authors>
66
<version></version>
7-
<owners>Vagif Abilov</owners>
7+
<owners>GeneXus</owners>
88
<description>
99
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.
1010
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 @@
1515
</summary>
1616
<repository type="git" url="https://github.com/genexuslabs/Simple.OData.Client.git" branch="" commit="" />
1717
<license type="expression">MIT</license>
18-
<copyright>Copyright 2012-2018 Vagif Abilov</copyright>
18+
<copyright>Copyright 2012-2022 GeneXus</copyright>
1919
<language>en-us</language>
2020
<tags>odata data rest client portable pcl netfx net40 net45 netstandard netcore mono adnroid ios</tags>
2121
<dependencies>

Simple.OData.Client.nuspec

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
<?xml version="1.0"?>
22
<package xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
33
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
4-
<id>Simple.OData.Client</id>
5-
<authors>Vagif Abilov</authors>
4+
<id>GeneXus.GXOdata.Client</id>
5+
<authors>GeneXus</authors>
66
<version>0.0.0.0</version>
7-
<owners>Vagif Abilov</owners>
7+
<owners>GeneXus</owners>
88
<description>
9-
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.
10-
The package Simple.OData.Client contains libraries that can work with OData feeds that implement both V1-3 and V4 OData protocol.
9+
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.
10+
The package GeneXus.GXOdata.Client contains libraries that can work with OData feeds that implement both V1-3 and V4 OData protocol.
1111
Packages Simple.OData.V3.Client and Simple.OData.V4.Client have smaller footprints and target V1-3 and V4 respectively.
1212
</description>
1313
<summary>
14-
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.
15-
The package Simple.OData.Client contains libraries that can work with OData feeds that implement both V1-3 and V4 OData protocol.
14+
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.
15+
The package GeneXus.GXOdata.Client contains libraries that can work with OData feeds that implement both V1-3 and V4 OData protocol.
1616
Packages Simple.OData.V3.Client and Simple.OData.V4.Client have smaller footprints and target V1-3 and V4 respectively.
1717
</summary>
18-
<projectUrl>https://github.com/object/Simple.OData.Client</projectUrl>
18+
<projectUrl>https://github.com/genexuslabs/Simple.OData.Client</projectUrl>
1919
<licenseUrl>http://www.opensource.org/licenses/mit-license.php</licenseUrl>
2020
<iconUrl>http://www.odata.org/wp-content/uploads/2014/05/ODataLogo-96.png</iconUrl>
21-
<copyright>Copyright 2012-2018 Vagif Abilov</copyright>
21+
<copyright>Copyright 2012-2022 GeneXus</copyright>
2222
<language>en-us</language>
2323
<tags>odata data rest client portable pcl netfx net40 net45 netstandard netcore mono adnroid ios</tags>
2424
<dependencies>

src/GXOdata.Client.All/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<PropertyGroup>
3-
<AssemblyVersion>5.2.3.5</AssemblyVersion>
3+
<AssemblyVersion>5.2.3.7</AssemblyVersion>
44
<FileVersion>$(AssemblyVersion)</FileVersion>
55
<InformationalVersion>$([System.DateTime]::UtcNow.ToString("yyyyMMddHHmmss")).$(GITHUB_SHA)</InformationalVersion>
66
<Company>GeneXus</Company>

0 commit comments

Comments
 (0)