-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Code coverage and workflows to build nng and nupkg
- Loading branch information
Showing
10 changed files
with
113 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: nng | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
nng_tag: | ||
description: 'NNG version' | ||
required: true | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
os: [windows-2019, ubuntu-18.04, macos-10.15] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout nng.NET | ||
uses: actions/checkout@v2 | ||
- name: Checkout NNG | ||
if: matrix.os != 'ubuntu-18.04' | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: nanomsg/nng | ||
ref: ${{ github.event.inputs.nng_tag }} | ||
path: nng | ||
- name: Build | ||
run: | | ||
./scripts/build_nng.ps1 -nng_source ./nng -git_branch nng_update | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: publish | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-2019 | ||
steps: | ||
- name: Checkout nng.NET | ||
uses: actions/checkout@v2 | ||
- name: Package | ||
run: | | ||
./scripts/nupkg.ps1 -Version ${{ github.event.release.tag_name }} -NugetApiKey ${{ secrets.NUGET_API_KEY }} | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
|
||
param([string]$nng_source = "../nng/", | ||
[switch]$clean, | ||
[string]$git_branch, | ||
[string]$runtimes = "$PSScriptRoot/../nng.NETCore/runtimes" | ||
) | ||
|
||
|
@@ -64,7 +65,25 @@ try { | |
Pop-Location | ||
} | ||
} | ||
|
||
} finally { | ||
Set-Location $current_dir | ||
} | ||
|
||
if ($git_branch) { | ||
if (!$(git config user.email) -or !(git config user.name)) { | ||
git config user.email "[email protected]" | ||
git config user.name "jeikabu" | ||
} | ||
|
||
git checkout -b $git_branch | ||
git add $runtimes | ||
git commit -m "Update native NNG libs" | ||
git push --set-upstream origin $git_branch | ||
if (!$?) { | ||
Write-Output "$? ExitCode: $LASTEXITCODE" | ||
git pull origin $git_branch | ||
Write-Output "$? ExitCode: $LASTEXITCODE" | ||
git push --set-upstream origin $git_branch | ||
Write-Output "$? ExitCode: $LASTEXITCODE" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,36 @@ | ||
param( | ||
[string]$Version, | ||
[string]$NugetApiKey, | ||
[string]$Nuget, | ||
[string]$Pfx | ||
[string]$NugetApiKey = "", | ||
[string]$Nuget = "", | ||
[string]$Pfx = "" | ||
) | ||
|
||
$ErrorActionPreference = "Stop" | ||
|
||
if (-not $(Test-Path $Pfx -PathType Leaf)) { | ||
throw "Need pfx" | ||
} | ||
# Strip the leading "v". E.g. "v1.3.2-rc0" => "1.3.2-rc0" | ||
$Version = $Version -replace "^v","" | ||
|
||
if (-not $(Test-Path $Nuget -PathType Leaf) -and -not $(Get-Command nuget -ErrorAction Ignore)) { | ||
throw "Nuget executable not found" | ||
} | ||
$nupkgs = "./bin/Release/*.nupkg" | ||
Remove-Item $nupkgs -Force -ErrorAction Ignore | ||
|
||
dotnet pack -c Release | ||
dotnet pack --configuration Release -p:Version=$Version | ||
|
||
$packages = "./bin/Release/Subor.nng.NETCore.$Version.nupkg", "./bin/Release/Subor.nng.NETCore.Shared.$Version.nupkg" | ||
$packages = Get-ChildItem $nupkgs | ||
|
||
foreach ($pkg in $packages) { | ||
& $Nuget sign $pkg -Timestamper http://sha256timestamp.ws.symantec.com/sha256/timestamp -CertificatePath $Pfx | ||
if ($Pfx) { | ||
if (-not $(Test-Path $Pfx -PathType Leaf)) { | ||
throw "Need pfx" | ||
} | ||
if (-not $(Test-Path $Nuget -PathType Leaf) -and -not $(Get-Command nuget -ErrorAction Ignore)) { | ||
throw "Nuget executable not found" | ||
} | ||
foreach ($pkg in $packages) { | ||
& $Nuget sign $pkg -Timestamper http://sha256timestamp.ws.symantec.com/sha256/timestamp -CertificatePath $Pfx | ||
} | ||
} | ||
|
||
foreach ($pkg in $packages) { | ||
dotnet nuget push $pkg -k $NugetApiKey -s https://api.nuget.org/v3/index.json | ||
if ($NugetApiKey) { | ||
foreach ($pkg in $packages) { | ||
dotnet nuget push $pkg -k $NugetApiKey -s https://api.nuget.org/v3/index.json | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters