fslaborg / flips

Fsharp LInear Programming System
https://flipslibrary.com/#/
MIT License
253 stars 32 forks source link

Packaging of new projects of dev branch as 2.9999-alpha-1 #125

Closed smoothdeveloper closed 2 years ago

smoothdeveloper commented 3 years ago

Consider having the continuous integration on dev branch to publish nuget with alpha packages.

This would allow anyone to play with the API without requiring to build the assemblies / nuget, instead, just referencing the published nuget as an artifact of the continuous integration pipeline.

I'm not familiar with azure actions and nuget publishing but maybe it can be done?

TysonMN commented 3 years ago

Definitely can be done. Material Design in XAML is an example where this is happening.

matthewcrews commented 3 years ago

I am hoping to get this addressed this weekend. My goal is to have new packages release each time we merge to dev with an alpha release number. I'm reading up on how to set this up.

@TysonMN, where in the Material Design in XAML repo can I see the build/release workflow?

TysonMN commented 3 years ago

IIRC, they use Azure DevOps. From a completed PR, find a link to a CI build.

I can take a look later today.

matthewcrews commented 3 years ago

I'm not blocked at the moment. I found an example of how to set this up using GitHub actions.

matthewcrews commented 3 years ago

I made progress but now I'm running into a new issue. You can see the workflow here: https://github.com/fslaborg/flips/runs/1631300995?check_suite_focus=true

I run the build command on my machine and it works. I'm working on Windows 10 64-bit though and the CI/CD is running on Ubuntu.

Script reported an error:
-> BuildFailedException: Target 'NuGet' failed.
-> One or more errors occurred. (Start of process 'paket' failed.)
-> Start of process 'paket' failed.
-> Win32Exception: No such file or directory
smoothdeveloper commented 3 years ago

@matthewcrews I've faced similar issues with fake surfacing paket error messages like that which was extremely confusing, it is due to how the build script has its own support for loading dependencies.

https://github.com/fsharp/FAKE/blob/0b6b25f7e186bfbc6d650f4e2f18bd8c11cac4f6/src/app/Fake.DotNet.Paket/Paket.fs#L36-L41

it looks for .paket/paket.exe but it isn't there.

if you can replace ToolPath with the moral equivalent of "~/.nuget/packages/paket/{version we use}/tool/paket.exe", I think it will work.

matthewcrews commented 3 years ago

@smoothdeveloper Is ToolPath something in the build.fsx file. I searched for it but didn't find it.

Never mind, I see what it is now based on that link.

matthewcrews commented 3 years ago

I'm trying to figure something out that will work on Windows and Linux. Not having a ton of luck yet.

smoothdeveloper commented 3 years ago

the easiest is to store the paket.exe in the meantime, and try to bring the issues upstream.

smoothdeveloper commented 3 years ago

if you want to try something adhoc, there is pretty much self contained logic there:

https://github.com/fsprojects/Paket/blob/f7b3986b5fc29ae1e79f895fb530877173dd9503/src/FSharp.DependencyManager.Paket/ReferenceLoading.PaketHandler.fs#L60-L81