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

Added GitVersion to the CI. #237

Merged
merged 8 commits into from
Feb 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .actrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-P ubuntu-latest=nektos/act-environments-ubuntu:18.04
-P ubuntu-20.04=nektos/act-environments-ubuntu:18.04
63 changes: 44 additions & 19 deletions .github/workflows/dotnet-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,48 @@ on:

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04

steps:
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.101
- name: Build
run: dotnet build --configuration Release
- name: Test, Generate Code Coverage
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: ${{ secrets.TEST_REPORTER_ID }}
with:
coverageCommand: dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=lcov
coverageLocations: |
${{github.workspace}}/Freshli.Test/coverage.info:lcov
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0 # Required for GitVersion
submodules: 'recursive'

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.101

- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.6.6'

- name: Show GitVersion Config
uses: gittools/actions/gitversion/[email protected]
with:
useConfigFile: true
additionalArguments: '/showConfig'

- name: Determine Version and Update csproj Files
uses: gittools/actions/gitversion/[email protected]
with:
useConfigFile: true
additionalArguments: '/updateprojectfiles'

- name: Display updated csproj File
run: cat Freshli/Freshli.csproj

- name: Build
run: dotnet build --configuration Release

- name: Test, Generate Code Coverage
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: ${{ secrets.TEST_REPORTER_ID }}
with:
coverageCommand: dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=lcov
coverageLocations: |
${{github.workspace}}/Freshli.Test/coverage.info:lcov
2 changes: 1 addition & 1 deletion .github/workflows/eclint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
eclint:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -441,3 +441,8 @@ Freshli.sln.DotSettings.user
results/

Freshli.Test/coverage.info

# Ignore Act files
# https://github.com/nektos/act
act.exe
act/
15 changes: 15 additions & 0 deletions GitVersion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
branches:
main:
mode: ContinuousDeployment
tag: alpha
increment: Minor
prevent-increment-of-merged-branch-version: false
track-merge-target: true
release:
tag: beta
increment: Patch
prevent-increment-of-merged-branch-version: true
track-merge-target: false
ignore:
sha: []
merge-message-formats: {}
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,3 +246,9 @@ with the [act](https://github.com/nektos/act) tool.
```
act -s secret_key=secret_value
```

## Branching and Versioning

This project uses cactus branching which means development is done in feature branches merged to the `main` branch and releases are done in `release-X.Y` branches off of main. Any fixes found testing a release are merged back to the release branch and then merged back to main. Another name for this branching strategy is Trunk Based [Development](https://trunkbaseddevelopment.com/).

The next version is automatically calculated using [GitVersion](https://github.com/GitTools/GitVersion). Commits to the main branch have the alpha suffix in their version number (e.g. v1.0.0-alpha0001). All commits to the release branches have the rc suffix (e.g. v1.0.0-beta). When a production release is done a tag without any suffix is used (e.g. v1.0.0). This tag is then used by GitVersion to calculate future versions. The configuration for GitVersion can be found [GitVersion.yml].