Giter Club home page Giter Club logo

Comments (5)

mauroservienti avatar mauroservienti commented on August 15, 2024

@micdenny thoughts?

from housekeeping.

mauroservienti avatar mauroservienti commented on August 15, 2024

the following simple PS script should do the trick:

$root = (split-path -parent $MyInvocation.MyCommand.Definition) + '\..'
$version = [System.Reflection.Assembly]::LoadFile("$root\< assembly path >").GetName().Version
$versionStr = "{0}.{1}.{2}" -f ($version.Major, $version.Minor, $version.Build)

Write-Host "Setting .nuspec version tag to $versionStr"

$content = (Get-Content $root\< Nuget spec file >.nuspec) 
$content = $content -replace '\$version\$',$versionStr

$content | Out-File $root\< compiled output >.compiled.nuspec

& $root\NuGet\NuGet.exe pack $root\< compiled output >.compiled.nuspec

As far as I have understood the assembly version is set by the AppVeyor build, thus the following line will always output 1.0.0:

$version = [System.Reflection.Assembly]::LoadFile("$root\< assembly path >").GetName().Version
$versionStr = "{0}.{1}.{2}" -f ($version.Major, $version.Minor, $version.Build)

That is only downside that can be easily overcome manually setting the version at the command line given that this proposal is to reduce the pain in some corner case scenarios.

from housekeeping.

mauroservienti avatar mauroservienti commented on August 15, 2024

The PS script could also use the AppVeyor local config file as the source for the version values, given that the process will be used only when working locally we have no interest at all in setting the correct version values in the AssemblyInfo file, the aim is to create the NuGet package.

Given the aim the script is also not interested at all in debug or release build, it will be debug only.

from housekeeping.

micdenny avatar micdenny commented on August 15, 2024

each time a PR is built the resulting artifacts, thus the NuGet package as well, are stored by AppVeyor on the build server, the developer could manually download them and host them on a local/offline NuGet server

artifacts for PR are already pushed on AppVeyor and they are free to be downloaded by everyone:

image

I think this is the easiest way, to avoid adding to much complex on the build process, and leave an easy way to instantly test a PR, just download the nuget package and use it.

And listen this, appveyor has also got its own nuget feed for this use-cases! 😄

image

for instance Radical project has this appveyor public nuget feed: https://ci.appveyor.com/nuget/radical-beci3al3osa3

and every build package will go there, even the PR that does not create a new build number, but in those cases the last build will overwrite the previous package, but it's just a matter of correctly dump the version on the PR and you're good to go, or of course just manually download the package or binaries.

from housekeeping.

mauroservienti avatar mauroservienti commented on August 15, 2024

I just tested this and everything worked like a charm. Closing.

from housekeeping.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.