FlashOWare / FlashOWare.Generators

The open source of truth for general-purpose C# source code generators.
MIT License
5 stars 1 forks source link

Initial CI/CD #2

Open Flash0ver opened 11 months ago

Flash0ver commented 11 months ago

I imagine the CI and CD workflows to be a combination of previous projects, but all in GitHub Actions (no Azure DevOps):

Workflows

Additional Workflows / Jobs

Gh0stWalk3r commented 10 months ago

Do you need some help to setup CI/CD?

Flash0ver commented 10 months ago

@Gh0stWalk3r I could use some help indeed ... as I'm currently focusing on getting "Benchmarking" and "Testing" for Roslyn Source Generators going, that I then also intend to dog-feed this project with.

I updated the description with what I had in mind so far. But different suggestions are welcome! I know it's a lot ... feel free to build a smaller subset: e.g. skip Mutation Testing for now ... I'll open follow-up issues for the parts not included for now.

Thank you for your interest in contributing to FlashOWare.Generators. I appreciate it!

Gh0stWalk3r commented 10 months ago

Looks very well thought out 👍🏼

Another possibility to publish new packages is to manually create a releases in GitHub or applying a tag, which will run the publish (CD) workflow. This way you are applying version tags to e.g. the master branch and do not need a publish branch. Releases could also contain a generated summary of the changes/commits. When working with releases, do you also want to attach the published NuGet package to the release as artifact/asset?

In the meantime I will start working on the CI workflow.

Flash0ver commented 10 months ago

I love the idea of publishing a package triggered by creating a Release. My publish-branch-"flow" I used so far was only due to my lack of knowledge that new (Pre-)Releases can also be a trigger (I'm quite bad with GitHub Actions, I really appreciate the help here!). I guess we can get rid of the publish branch altogether. Will that also trigger when editing a release? E.g. adding/editing description, or only on initial creation with a tag?

I don't necessarily require the NuGet package to be part of the artifacts / assets ... but if you think that's a good idea, please feel free to add it. I mean, as part of a Release, the package will be on NuGet.org anyway. But, from a workflow perspective: perhaps not on every push to a PR, but only on merging a PR to main ... so that we at least also dotnet pack and get potential NuGet Warnings as Errors to fail the build. And maybe not adding the package to the artifacts of a main build, but publishing it to GitHub Packages instead, so that this feed could be used as a "latest canary" feed for testing and experimentation. Would be cool to use the "current" version + the main's commit SHA as SemVer-Style "Build Metadata" for the GitHub Packages version. But I'm a bit unsure how to auto-increment the version number correctly here. Perhaps we do need something like Nerdbank.GitVersioning and can no longer have a Fetch-Depth of 1. What do you think about that?

(I have the feeling I'm becoming victim of feature creeping ... let's develop a bit of a "plan" here, and then open incremental issues for the CI/CD scope)

Gh0stWalk3r commented 10 months ago

I intend to post the reports in the pull requests as markdown. @Flash0ver can you please check if the read/write permission for actions/workflows is enabled? They can be found in Settings > Actions > General > Workflow Info taken from the plugin creator: https://github.com/marocchino/sticky-pull-request-comment/tree/v2/?tab=readme-ov-file#error-resource-not-accessible-by-integration

Flash0ver commented 9 months ago

✔️ done (workflow permissions)