inkle / ink

inkle's open source scripting language for writing interactive narrative.
http://www.inklestudios.com/ink
MIT License
4.14k stars 495 forks source link

Package inklecate as a dotnet tool #743

Closed NonlinearFruit closed 2 years ago

NonlinearFruit commented 2 years ago

Publishing inklecate as a dotnet tool would have a lot of benefits:

Testing

Here is how I tested this change:

dotnet pack
dotnet tool install -g inklecate --add-source inklecate/nupkg/
cd {ink script folder}
inklecate {my-script}.ink

This worked great on my machine (Win10). I also pushed the package to a private GitLab package repository and install the package in a linux dotnet container and it worked!

Use Case

In my particular use case, I wanted to setup a pipeline to compile my inks into json whenever I push. The problem is installing inklecate in linux is kinda a pain. I noticed that we were using .Net Core 3 so I wondered how hard it would be to convert this to a dotnet tool. Then I could use a dotnet linux container (mcr.microsoft.com/dotnet/sdk) and:

dotnet tool install -g inklecate --add-source https://nuget.pkg.github.com/inkle/index.json
inklecate *.ink
{process the .ink.jsons}

Next Steps

This is just how I would go about fleshing out the pipeline:

  1. [Optional] Use MinVer to autoversion off tags
    • You can manually version via a csproj 'Version' property like I did here
  2. Update travis to pack and push a nuget on certain events (eg: branch == master, tag events)
    • It would look something like this (I do this in GitLab and Github should be similar):
      dotnet nuget add source https://nuget.pkg.github.com/inkle/index.json  --name github --username inkle --password {github read/write token} --store-password-in-clear-text
      git fetch --tags # if using MinVer
      dotnet pack --configuration Release --output .
      dotnet nuget push *.nupkg --source github

Further reading