Skip to content

Commit

Permalink
appveyor / nuget package script
Browse files Browse the repository at this point in the history
  • Loading branch information
genemars committed Jun 23, 2020
1 parent f1aa6d5 commit 2467242
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 59 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
[Bb]in/
[Oo]bj/
.idea/
.vs/

*.nupkg
*.userprefs
*.suo
*.pidb
Expand Down
25 changes: 25 additions & 0 deletions IntelUpnpDlna.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>IntelUpnpLib</id>
<version>1.0.0</version>
<title>IntelUpnpLib</title>
<authors>Generoso Martello</authors>
<owners>G-Labs</owners>
<licenseUrl>https://github.com/genielabs/intel-upnp-dlna/blob/master/LICENSE</licenseUrl>
<projectUrl>https://github.com/genielabs/intel-upnp-dlna/</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>UPnP /DLNA library for .Net / Mono</description>
<summary>UPnP /DLNA libray for .Net / Mono</summary>
<releaseNotes></releaseNotes>
<copyright>G-Labs</copyright>
<tags>upnp dlna ssdp</tags>
<dependencies>
<group targetFramework="netstandard2.1">
</group>
</dependencies>
</metadata>
<files>
<file src="UPnP\bin\Debug\netstandard2.1\**" target="lib\netstandard2.1" />
</files>
</package>
58 changes: 0 additions & 58 deletions UPnP/AssemblyInfo.cs

This file was deleted.

11 changes: 10 additions & 1 deletion UPnP/UPnP.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<AssemblyVersion>1.0.0</AssemblyVersion>
<FileVersion>1.0.0</FileVersion>
<NetStandardImplicitPackageVersion>2.0.0</NetStandardImplicitPackageVersion>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
</PropertyGroup>
</Project>
</Project>
34 changes: 34 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
version: 1.0.{build}
image: Visual Studio 2017
configuration: Debug
before_build:
- nuget restore
build:
project: .\UPnP\UPnP.sln
verbosity: minimal
test:
assemblies:
only:
- UPnP/bin/Debug/netstandard2.1/UPnP.dll
after_test:
- ps: .\nuget_pack.ps1
artifacts:
- path: '*.nupkg'
name: UPnP nupkg
type: NuGetPackage
deploy:
- provider: GitHub
auth_token:
secure: 1aMBEFi1qBAoV4H+LYx7hoVLgXJfndGoQ8I8qjLsoxXNA1zS+zgQHi2zVlRrmw1v
draft: false
prerelease: false
on:
appveyor_repo_tag: true
- provider: NuGet
api_key:
secure: ER771ujBnbfc/o+8QyM3XZInr0JyFfv3GIdDyQZfZtNUuCCkDn4cFEc1ZJGCYkpt
skip_symbols: false
artifact: /.*\.nupkg/
on:
appveyor_repo_tag: true

19 changes: 19 additions & 0 deletions nuget_pack.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
$project = "SerialPortLib"
$root = (split-path -parent $MyInvocation.MyCommand.Definition) + '\..'
#$version = [System.Reflection.Assembly]::LoadFile("$root\$project\bin\Debug\$project.dll").GetName().Version

$versionStr = "{0}" -f ($env:APPVEYOR_REPO_TAG_NAME)

if (-not ([string]::IsNullOrEmpty($versionStr))) {
Write-Host "Setting $project .nuspec version tag to $versionStr"

$content = (Get-Content $root\$project\$project.nuspec)
$content = $content -replace '\$version\$',$versionStr

$content | Out-File $root\$project\$project.compiled.nuspec

& nuget pack $root\$project\$project.compiled.nuspec
}
else {
Write-Host "Version string is empty, possibly dry run or APPVEYOR_REPO_TAG_NAME environment variable is not set"
}

0 comments on commit 2467242

Please sign in to comment.