I am currently working on a .NET Core library that I am going to use as a NuGet package in another project.
I have been able to successfully package the project using the "dotnet pack" command in the project directory, and upload that package to MyGet.
I would prefer to automate this process of pushing the NuGet package by using the "nuget push" command.
My issue is that the "scripts" property defined in the project.json file does not seem to be executed on pack or build. I expected that these scripts would be executed when the corresponding event occurs, but they seem to have no effect as I do not see anything output to console when I build, with or without he verbose tag.
I understand that MyGet is able to update a package feed based on a Git repository, but I would like to understand if there is some issue with executing a script currently using a project.json. Ideally I want to use the nuget push command after pack successfully executes.
Here is my project.json file :
{
"version": "0.0.1",
"scripts": {
"postbuild": [ "echo build" ],
"prebuild": "echo build",
"postpack": "echo build",
"postpublish": "echo build",
"postrestore": "echo build",
"prepack": "echo build",
"prepare": "echo build",
"prepublish": "echo build",
"prerestore": "echo build"
},
"dependencies": {
"NETStandard.Library": "1.5.0-rc2-24027"
},
"frameworks": {
"netstandard1.5": {
}
},
"buildOptions": {
"allowUnsafe": false,
"debugType": "portable",
"emitEntryPoint": false,
"xmlDoc": false
},
"commands": { },
"packOptions": {
"files": {
"include": "%project:Directory%/bin/release/*.nupkg"
}
},
"configurations": {
"Debug": {
"buildOptions": {
"define": [ "DEBUG", "TRACE" ]
}
},
"Release": {
"buildOptions": {
"define": [ ]
}
}
}
}