diff --git a/.actrc b/.actrc index 85619c8b..73020a22 100644 --- a/.actrc +++ b/.actrc @@ -1 +1 @@ --P ubuntu-latest=nektos/act-environments-ubuntu:18.04 \ No newline at end of file +-P ubuntu-20.04=nektos/act-environments-ubuntu:18.04 \ No newline at end of file diff --git a/.github/workflows/dotnet-core.yml b/.github/workflows/dotnet-core.yml index 8829348b..dc6eb830 100644 --- a/.github/workflows/dotnet-core.yml +++ b/.github/workflows/dotnet-core.yml @@ -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/codeclimate-action@v2.7.5 - 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/setup@v0.9.9 + with: + versionSpec: '5.6.6' + + - name: Show GitVersion Config + uses: gittools/actions/gitversion/execute@v0.9.9 + with: + useConfigFile: true + additionalArguments: '/showConfig' + + - name: Determine Version and Update csproj Files + uses: gittools/actions/gitversion/execute@v0.9.9 + 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/codeclimate-action@v2.7.5 + 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 diff --git a/.github/workflows/eclint.yml b/.github/workflows/eclint.yml index f9073275..bf7f6baf 100644 --- a/.github/workflows/eclint.yml +++ b/.github/workflows/eclint.yml @@ -8,7 +8,7 @@ on: jobs: eclint: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - name: Checkout uses: actions/checkout@v2 diff --git a/.gitignore b/.gitignore index 1dddd5f6..5fef7b83 100644 --- a/.gitignore +++ b/.gitignore @@ -441,3 +441,8 @@ Freshli.sln.DotSettings.user results/ Freshli.Test/coverage.info + +# Ignore Act files +# https://github.com/nektos/act +act.exe +act/ \ No newline at end of file diff --git a/GitVersion.yml b/GitVersion.yml new file mode 100644 index 00000000..6bc11ef1 --- /dev/null +++ b/GitVersion.yml @@ -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: {} diff --git a/README.md b/README.md index 8ef3f51e..d0192c2c 100644 --- a/README.md +++ b/README.md @@ -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].