casbin / Casbin.NET

An authorization library that supports access control models like ACL, RBAC, ABAC in .NET (C#)
https://casbin.org
Apache License 2.0
1.18k stars 112 forks source link

Use semantic-release to automatically release Casbin.NET versions #37

Closed hsluoyz closed 3 years ago

hsluoyz commented 4 years ago

We already used semantic-release in Go and Nodejs, see Node-Casbin: https://github.com/casbin/node-casbin/pull/153#issuecomment-625775348

image

There's also a student working on Java: https://github.com/casbin/jcasbin/issues/76

I think we should also integrate it into .NET. It will auto-release to GitHub Releases and Nuget. We need to find a plugin to use semantic-release in .NET project. I found these but not tried any one yet, maybe useful for you:

Can anyone work on it?

hsluoyz commented 4 years ago

@xcaptain @huazhikui @nodece @Sagilio can you take the issue?

xcaptain commented 4 years ago

EFCore-Adapter can automatically release when new tag was created. https://github.com/casbin-net/EFCore-Adapter/blob/master/.travis.yml#L40

I think we don't need to release so frequently, manually release is OK.

hsluoyz commented 4 years ago

I think currently only @huazhikui is familiar with the .NET release instructions. @huazhikui can you release a version from master now?

sagilio commented 4 years ago

Azure DevOps has a release pipeline that can automatically release the package. We can use Git Version to complete the version. I have tried about it, The build result is like this :

image

hsluoyz commented 4 years ago

@Sagilio I want GitHub & Nuget releases, is it OK for these?

sagilio commented 4 years ago

@Sagilio I want GitHub & Nuget releases, is it OK for these?

It has Github releases Task and Nuget Command Task which can push package. Almost All the tasks can be used at both the build and release pipeline.

hsluoyz commented 4 years ago

@Sagilio good, go ahead with this way. Let me know if you need any help.

hsluoyz commented 4 years ago

Any update?

sagilio commented 4 years ago

Any update?

I tried to auto-release some version:

1.2.8 : Build result 1.2.9 : Build result 1.3.0-alpha0045 : Build result

Azure pipeline build history Github release list

Should we how to trigger the release pipeline? The way of most used looks to use develop branch and trigger when pull request from that.

hsluoyz commented 4 years ago

@nodece @huazhikui @xcaptain

xcaptain commented 4 years ago

Nice, the buildAndPack works, the next step is to determine when to trigger buildAndPack. But how can the semantic release bot change the version number at https://github.com/casbin/Casbin.NET/blob/master/NetCasbin/NetCasbin.csproj#L11

sagilio commented 4 years ago

Nice, the buildAndPack works, the next step is to determine when to trigger buildAndPack. But how can the semantic release bot change the version number at https://github.com/casbin/Casbin.NET/blob/master/NetCasbin/NetCasbin.csproj#L11

It can be set at the command dotnet build /p:FileVersion=1.3.0.0 and I have released a version (1.3.1)

hsluoyz commented 4 years ago

Fixed by: https://github.com/casbin/Casbin.NET/issues/65

hsluoyz commented 3 years ago

I don't think this issue is actually getting fixed. Just merged a PR: https://github.com/casbin/Casbin.NET/pull/123 but I didn't see a new release coming (like v1.4.0 -> v1.4.1)

@Sagilio need resolving.

sagilio commented 3 years ago

@hsluoyz According to the current release strategy, the new version of the package will be released to multiple places according to its type. Dev release: it will be released to the MyGet source by every commit, the last version is here. Beta release: it will be released to the NuGet source as a prerelease. Stable release: it will be released to the NuGet source as a stable release. This strategy is popular at the .NET library repo.

Do we need to remove the dev release channel and release a new stable version by every commit, it will like the go casbin repo?

hsluoyz commented 3 years ago

@Sagilio good to know the current release workflow! Yeah, I think the current formal release frequency is too low and it would be better if we can use the Go-Casbin similar way: we will even release a new formal release for a bug fix PR merge, but we will embrace semantic-versioning to indicate the nature of the change. For example:

  1. Big breaking change: v1.2.3 --> v2.0.0
  2. New feature: v1.2.3 --> v1.3.0
  3. Bug fix: v1.2.3 --> v1.2.4

It's notable that this will also help our popularization as some social media accounts will announce the new releases for important packages.

sagilio commented 3 years ago

@hsluoyz Ok, I will try to use a similar way of Go-Casbin.

github-actions[bot] commented 3 years ago

:tada: This issue has been resolved in version 1.5.1-develop.1 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket:

github-actions[bot] commented 3 years ago

:tada: This issue has been resolved in version 1.5.1 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: