microsoft / tslint-microsoft-contrib

A set of TSLint rules used on some Microsoft projects.
MIT License
702 stars 198 forks source link

automated publishing #863

Closed cyberhck closed 5 years ago

cyberhck commented 5 years ago

following discussion from https://github.com/microsoft/tslint-microsoft-contrib/pull/852#issuecomment-492627470 I was thinking adding some automation will do some good.

I can think of 3 ways,

First, we'd do semantic-release, it'll do everything, commenting on PR after it's released, adding tags, creating a github release, adding change logs, etc. We'd need to commit in a certain format for this to work, we can easily verify that using git hooks and a commit message linting on CI as well.

Second, we release once the tag is pushed, but use release-notes-generator to get the change log and make a proper github release, can be a tiny bit more work, but can work, but we'd still have to commit in a particular format, but if we're doing this anyway, why not just do the first one, and by default merge PRs to release branch, then periodically merge release branch to master, and master can release whatever was in release branch (and release branch can be set in a way that we release beta versions there)

third, release with the tags, without proper commit messages, but there won't be a nice change log generator, this means one would have to manually go and create change logs.

If you want to go for first option, I can setup a PR and see if everything works :)

IllusionMH commented 5 years ago

Thank you for the issue, details for three options to consider, and PR proposal! My message in linked PR wasn't clear enough so will add more details here.

I saw this proposal and I'm leaning towards first approach but with local releases using --no-ci flag (at least initially) However before adding and configuring semantic-release there are few steps that should be taken:

  1. Releases should be done from master branch instead of separate releases branch (something like #825 or other process)
  2. How PRs are merged into master to support correct message format
  3. Revisit approach for beta versions to just rely on npm dist-tags (because AFAIK semantic-release doesn't support x.y.z-beta) May be something more.

At this point I'm working on proposals for points above and they will be ready next week.

cyberhck commented 5 years ago

Not sure about -beta, but there's a pre release feature, a while ago I was curious about this

yes, we can go for --no-ci flag as well, true, the details can be figured out slowly and by considering what everyone thinks, obviously I don't know the whole thing about it, just wanted to push the idea forward :)