Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolves: Consolidate current pipelines into a single pipeline with additional features #78

Closed
wants to merge 31 commits into from

Conversation

szlatkow
Copy link
Contributor

The pipeline runs:

  1. CI
  • projects build
  • unit tests
  1. CD
  • publishing to NuGet

With this contribution, we consolidate the current pipelines into a single pipeline, so please let us know if anything could be done better and/or if any other automation is required by the project! We would be happy to improve it to satisfactory completion 🙂

In addition, the following features might be of value to the project and if you agree, we will be happy to add them to the pipeline:

  • automated Semantic versioning
  • publishing pipeline artifacts
  • automated GitHub Release publish

Resolves #77

szlatkow and others added 2 commits April 21, 2021 10:41
* add .vscode folder to .gitignore

* add build and test pipeline

* add steps for publishing to NuGet

* fix the ids for the publishing steps

* test pipeline without nuget keys in Create and publish steps

* check generated files in pipeline

* check generated files in pipeline with pwsh

* add a step that watches for file changes

* restrict cd job execution to "push to default branch"

* Update ci-cd.yml

Co-authored-by: aleks-ivanov <aleksandar.ivanov@singlet.dev>
Co-authored-by: Aleksandar Ivanov <74899441+aleks-ivanov@users.noreply.github.com>
@ardalis
Copy link
Owner

ardalis commented Apr 21, 2021

I'm interested in how automatic semantic versioning would work and in GitHub Release publishing. What would that involve / look like?
Related question: how do I configure the version as part of this proposed process? Do I just need to be sure to update it in the csproj file(s)?
Last question: what if I make a commit that shouldn't be deployed, like an update to a comment or README file? How is that handled/controlled?

@szlatkow
Copy link
Contributor Author

Hi @ardalis,
The automatic Semantic Versioning step checks if there is a certain prefix semver label (fix, feat or perf) in the message of the push commit that triggered the workflow, it takes the last GitHub tag, creates a new tag depending on the prefix label in the commit message and pushes it to the repo's GitHub tags. (this step is independent of the .csproj files)

Example(fix/PATCH):
git commit -a -m "fix: this is a PATCH release triggering commit"
git push origin master

Result: v1.2.3 -> v1.2.4

If there is no prefix label in the commit message the tag generator does not create a new tag.

Do I just need to be sure to update it in the csproj file(s)?

The new version created by the automatic Semantic Versioning step can be applied to the .csproj file during the execution of the pipeline, to be used in the package creation.

Last question: what if I make a commit that shouldn't be deployed, like an update to a comment or README file? How is that handled/controlled?

Currently, in the CD job (which is executed on every push commit) there is a step called "Filter changes" that looks at the two project folders, detects changes and determines which one or both projects should be packaged and deployed to NuGet.
In case there is automated Semantic Versioning, the execution of any deployment (which would be in the CD job) is handled by the automatic Semantic Versioning step. If a commit is pushed without a semver label in the message (e.g. a push commit that doesn't include changes to project itself and therefor a versioning change is not necessary), the CD job where the NuGet packages and GitHub release publishing are, is not executed.

For an example of automatic versioning, checkout this short video presentation about our contribution to the Notepads project.

@ardalis
Copy link
Owner

ardalis commented Jan 14, 2022

You mentioned docs - where are the docs on this?

The automatic Semantic Versioning step checks if there is a certain prefix semver label (fix, feat or perf) in the message of the push commit that triggered the workflow, it takes the last GitHub tag, creates a new tag depending on the prefix label in the commit message and pushes it to the repo's GitHub tags. (this step is independent of the .csproj files)

Example(fix/PATCH):
git commit -a -m "fix: this is a PATCH release triggering commit"
git push origin master

Result: v1.2.3 -> v1.2.4

If there is no prefix label in the commit message the tag generator does not create a new tag.

@ardalis ardalis closed this Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consolidate current pipelines into a single pipeline with additional features
3 participants