vapor-ware / synse-sdk

SDK for Synse Plugins in Go
https://synse.readthedocs.io/en/latest/sdk/intro/
GNU General Public License v3.0
3 stars 4 forks source link

fix release tagging to be more compatible with go modules #486

Closed edaniszewski closed 2 years ago

edaniszewski commented 3 years ago

https://roberto.selbach.ca/intro-to-go-modules/

What we are doing now works, but it apparently is not the "right way" to version things for go modules. Namely, right now when we use the SDK as a dependency, we get something like this in the go mod file:

github.com/vapor-ware/synse-sdk v0.1.0-alpha.0.20210119200922-73253fb22fb1

where we can see other repos have the actual version pinned

...
github.com/sirupsen/logrus v1.7.0
github.com/stretchr/testify v1.5.1
...

I think we need to use a v prefix on tags, and in addition, there seems to be some caveat on how go modules expects different things for v0/v1 and v2+, where the module header at the top of the go mod file would need to specify a different package for different versions, e.g.

For v0/v1:

module github.com/vapor-ware/synse-sdk

For v2

module github.com/vapor-ware/synse-sdk/v2

I'll want to test this out on another repo before causing to much churn/noise in this repo. When/if the pattern is verified to be correct, we'll probably also want to apply it to other go project repos.