Skip to content

Commit

Permalink
Added nuget icon (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
ns8482e authored Oct 19, 2022
1 parent 528bd2f commit d352ec7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
Binary file added .github/workflows/nuget-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions _template.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<description>$description$</description>
<authors>Orchard Core Community and Contributors</authors>
<license type="expression">BSD-3-Clause</license>
<icon>icon.png</icon>
<projectUrl>https://www.orchardcore.net/</projectUrl>
<copyright>Orchard Core Community and Contributors</copyright>
<tags>OrchardCore OrchardCoreCMS Localization Translations</tags>
Expand Down
13 changes: 11 additions & 2 deletions pack.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ $pkgPropsExtension = "props"
$pkgBuildFolderName = "buildTransitive"
$pkgSpecTemplate = "_template.$pkgSpecExtension"
$pkgPropsTemplate = "_template.$pkgPropsExtension"
$pkgIconFile = "icon.png"
$csprojFilePath = "$env:GITHUB_WORKSPACE/.github/workflows/project.csproj"
$iconSrcPath = "$env:GITHUB_WORKSPACE/.github/workflows/nuget-icon.png"

function createNuGetPackage([string]$pkgName, [string]$culture, [string]$cultureDisplayName)
{
Expand Down Expand Up @@ -44,9 +47,12 @@ function createNuGetPackage([string]$pkgName, [string]$culture, [string]$culture

$pkgSpecFileName = "$pkgName.$pkgSpecExtension"
$pkgSpecFilePath = [IO.Path]::Combine($env:GITHUB_WORKSPACE, $pkgFolderPath, $pkgSpecFileName)
$csprojFilePath = "$env:GITHUB_WORKSPACE/.github/workflows/project.csproj"
$pkgDestinationPath = [IO.Path]::Combine($env:GITHUB_WORKSPACE, $pkgFolderPath)

$iconDestinationPath = [IO.Path]::Combine($env:GITHUB_WORKSPACE, $pkgFolderPath, $pkgIconFile)
echo "Copying $iconSrcPath to $iconDestinationPath ..."
Copy-Item -Path $iconSrcPath -Destination $iconDestinationPath

dotnet pack $csprojFilePath -p:NuspecFile=$pkgSpecFilePath -p:PackageOutputPath=$pkgDestinationPath # | Out-Null
}

Expand All @@ -61,12 +67,15 @@ function createNuGetMetaPackage()

$pkgSpecFileName = "$pkgName.$pkgSpecExtension"
$pkgSpecFilePath = [IO.Path]::Combine($env:GITHUB_WORKSPACE, $artifactsFolderName, $pkgSpecFileName)
$csprojFilePath = "$env:GITHUB_WORKSPACE/.github/workflows/project.csproj"
$pkgDestinationPath = [IO.Path]::Combine($env:GITHUB_WORKSPACE, $pkgFolderPath)
$pkgFolderPath = [IO.Path]::Combine($artifactsFolderName, $pkgId)

echo "Project file in '$csprojFilePath'"

$iconDestinationPath = [IO.Path]::Combine($env:GITHUB_WORKSPACE, $artifactsFolderName, $pkgIconFile)
echo "Copying '$iconSrcPath to $iconDestinationPath ..."
Copy-Item -Path $iconSrcPath -Destination $iconDestinationPath

dotnet pack $csprojFilePath -p:NuspecFile=$pkgSpecFilePath -p:PackageOutputPath=$pkgDestinationPath # | Out-Null
}

Expand Down

0 comments on commit d352ec7

Please sign in to comment.