RevenantX / LiteNetLib

Lite reliable UDP library for Mono and .NET
https://revenantx.github.io/LiteNetLib/index.html
MIT License
3.05k stars 495 forks source link

Suggestion: Distribute via open upm & unity package manager #445

Closed kkjamie closed 7 months ago

kkjamie commented 3 years ago

Have you considered distributing unity releases via https://openupm.com?

This way it's much easier to maintain inside unity projects via the package manager. It's minimal effort I believe, I think they have a CI for automated releases from github, so once it's setup it should be able to detect new releases automatically I think the directory structure may need to be tweaked though. I realise it's not just a unity library of course.

JerryLiew commented 2 years ago

i think its a good idea.but as the README.md shown, "Always use library sources instead of precompiled DLL files ( because there are platform specific #ifdefs and workarounds for unity bugs )" ,it may cause some problems.(Of course, i dont know about the details,maybe it can works well)

aaronchapin-tocaboca commented 2 years ago

It's also possible to distribute via the UPM with git now. I've opened a PR to enable that.

RevenantX commented 1 year ago

you can now add to manifset.json "com.revenantx.litenetlib": "https://github.com/RevenantX/LiteNetLib.git?path=/LiteNetLib#upm"

robinnorth commented 1 year ago

FYI I have added the package available on the UPM branch to OpenUPM: https://openupm.com/packages/com.revenantx.litenetlib/

The only issue is that there is a discrepancy between the UPM package version (shown as v1.0.1-1) and the library version (v.1.1.0), as the version number in package.json was not bumped until after the v1.1.0 tag which OpenUPM uses to build the UPM package version. To avoid this going forward, package.json simply needs to have its version number updated in line with the library so that when future release Git tags are created, the UPM and library versions are in sync.

Cheers!

robinnorth commented 1 year ago

Actually, as it turns out, OpenUPM support isn't quite so straightforward. As the Unity .meta files only exist in the UPM branch, they don't get included in the package build OpenUPM produces, as the Git tags it uses to detect versions to build are on master.

A solution would be to tag releases on the UPM branch with a special prefix, e.g. upm-v1.1.0 to enable OpenUPM to be configured to only build releases from those tags : image

RevenantX commented 7 months ago

https://openupm.com/packages/com.revenantx.litenetlib/?subPage=readme