Skip to content
This repository has been archived by the owner on Nov 17, 2021. It is now read-only.

Commit

Permalink
Fix chocolatey build
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaykul committed Apr 25, 2018
1 parent 02cf709 commit 57b9d15
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 13 deletions.
7 changes: 5 additions & 2 deletions Source/tools/chocolateyinstall.ps1
Expand Up @@ -3,8 +3,8 @@ param(
# The path to put our kernel.json folders in
$KernelFolder,

# The path where the kernel executables are (should contain at least the 'netcoreapp2.0' or 'net461' folder)
$InstallPath = $(Split-Path $PSScriptRoot)
# The path where the kernel executables are (should contain at least the 'Windows' folder)
$InstallPath
)
# Use the .NET Core APIs to determine the current platform; if a runtime
# exception is thrown, we are on FullCLR, not .NET Core.
Expand All @@ -27,6 +27,9 @@ try {
}
}

if (!$InstallPath) {
$InstallPath = Split-Path $PSScriptRoot
}

if ($IsWindows) {
if (!$KernelFolder) {
Expand Down
19 changes: 11 additions & 8 deletions build.ps1
@@ -1,5 +1,5 @@
param(
${Prefix} = "-beta-8",
${Prefix},

${Configuration} = "Release",

Expand All @@ -26,22 +26,22 @@ dotnet restore
Pop-Location
if ($Platform -contains "Windows") {
Push-Location ./Source
dotnet publish -f netcoreapp2.0 -c ${Configuration} -r win7-x64 --version-suffix $Prefix
dotnet publish -f netcoreapp2.0 -c ${Configuration} -r win7-x64 #--version-suffix $Prefix
Pop-Location
Move-Item "Source/Output/${Configuration}/netcoreapp2.0/win7-x64/publish" "Output/${Configuration}/Windows"
Get-ChildItem $PSHome -Directory | Copy-Item -Destination "Output/${Configuration}/Windows" -Recurse
}
if ($Platform -contains "Linux") {
Push-Location ./Source
dotnet publish -f netcoreapp2.0 -c ${Configuration} -r linux-x64 --version-suffix $Prefix
dotnet publish -f netcoreapp2.0 -c ${Configuration} -r linux-x64 #--version-suffix $Prefix
Pop-Location
Move-Item "Source/Output/${Configuration}/netcoreapp2.0/linux-x64/publish" "Output/${Configuration}/Linux"
Write-Host $PSHome
Get-ChildItem $PSHome -Directory | Copy-Item -Destination "Output/${Configuration}/Linux" -Recurse
}
if ($Platform -contains "OSx") {
Push-Location ./Source
dotnet publish -f netcoreapp2.0 -c ${Configuration} -r osx.10.12-x64 --version-suffix $Prefix
dotnet publish -f netcoreapp2.0 -c ${Configuration} -r osx.10.12-x64 #--version-suffix $Prefix
Pop-Location
Move-Item "Source/Output/${Configuration}/netcoreapp2.0/osx.10.12-x64/publish" "Output/${Configuration}/Mac"
Get-ChildItem $PSHome -Directory | Copy-Item -Destination "Output/${Configuration}/Mac" -Recurse
Expand All @@ -55,21 +55,24 @@ if ($Platform -contains "OSx") {
Copy-Item "./Source/tools" "./Output/${Configuration}" -Recurse

if($Package) {
if($Prefix) {
$Prefix = "-" + $Prefix
}
# Create a catalog and validation
New-FileCatalog -CatalogFilePath "./Output/${Configuration}/tools/Jupyter-PowerShell.cat" -Path Output/${Configuration}/
if(Get-Module Authenticode -List) {
Authenticode/Set-AuthenticodeSignature "./Output/${Configuration}/tools/Jupyter-PowerShell.cat"
Authenticode\Set-AuthenticodeSignature "./Output/${Configuration}/tools/Jupyter-PowerShell.cat"
}

if(Get-Command choco) {
if(Get-Command choco -ErrorAction SilentlyContinue) {
choco pack --outputdirectory ./Output/${Configuration}

if ($ChocoApiKey) {
choco push ./Output/${Configuration}/jupyter-powershell.1.0.0-$($Prefix).nupkg --api-key $ChocoApiKey
choco push ./Output/${Configuration}/jupyter-powershell.1.0.0$($Prefix).nupkg --api-key $ChocoApiKey
}
} else {
Write-Warning "Could not find choco command.
To package, run: choco pack --outputdirectory $(Resolve-Path Output/${Configuration})
To publish, run: choco push $(Resolve-Path Output/${Configuration}/jupyter-powershell.1.0.0-$($Prefix).nupkg)"
To publish, run: choco push $(Join-Path (Resolve-Path Output/${Configuration}) jupyter-powershell.1.0.0$($Prefix).nupkg)"
}
}
6 changes: 3 additions & 3 deletions jupyter-powershell.nuspec
Expand Up @@ -21,7 +21,7 @@ This is a nuspec. It mostly adheres to https://docs.nuget.org/create/Nuspec-Refe
<!-- version should MATCH as closely as possible with the underlying software -->
<!-- Is the version a prerelease of a version? https://docs.nuget.org/create/versioning#creating-prerelease-packages -->
<!-- Note that unstable versions like 0.0.1 can be considered a released version, but it's possible that one can release a 0.0.1-beta before you release a 0.0.1 version. If the version number is final, that is considered a released version and not a prerelease. -->
<version>1.0.0-beta-8</version>
<version>1.0.0</version>
<packageSourceUrl>https://github.com/Jaykul/Jupyter-PowerShell/releases</packageSourceUrl>
<!-- owners is a poor name for maintainers of the package. It sticks around by this name for compatibility reasons. It basically means you. -->
<owners>Joel "Jaykul" Bennett</owners>
Expand Down Expand Up @@ -50,9 +50,9 @@ This is a nuspec. It mostly adheres to https://docs.nuget.org/create/Nuspec-Refe
<files>
<!-- this section controls what actually gets packaged into the Chocolatey package -->
<file src="output\Release\tools\**" target="tools" />
<!-- TODO: I should probably only pack ... one of these at a time, I don't know... -->
<!-- TODO: As far as I know, chocolatey doesn't really support the others ...
<file src="output\Release\Linux\**" target="Linux" />
<file src="output\Release\Mac\**" target="Mac" />
<file src="output\Release\Mac\**" target="Mac" /> -->
<file src="output\Release\Windows\**" target="Windows" />
<!-- <file src="output\Release\WindowsPowerShell\**" target="WindowsPowerShell" /> -->

Expand Down

0 comments on commit 57b9d15

Please sign in to comment.