-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
3 changed files
with
156 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,64 +5,83 @@ name: .NET | |
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
branches: | ||
- master | ||
- dev | ||
- hotfix/* | ||
- release/* | ||
- feature/* | ||
pull_request: | ||
branches: | ||
- master | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build: | ||
|
||
env: | ||
BUILD_CONFIG: 'Release' | ||
SOLUTION: 'Cross.CQRS.sln' | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: 8.0.x | ||
|
||
- name: Setup NuGet | ||
uses: NuGet/[email protected] | ||
|
||
- name: Restore dependencies | ||
run: dotnet restore | ||
|
||
- name: Restore dependencies with NuGet | ||
run: nuget restore $SOLUTION | ||
|
||
- name: Build | ||
run: dotnet build --no-restore | ||
|
||
- name: Build 2 | ||
run: dotnet build $SOLUTION --configuration $BUILD_CONFIG --no-restore | ||
|
||
- name: Test | ||
run: dotnet test --no-build --verbosity normal | ||
|
||
- name: Run tests | ||
run: dotnet test /p:Configuration=$BUILD_CONFIG --no-restore --no-build --verbosity normal | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: 8.0.x | ||
|
||
- name: Setup NuGet | ||
uses: NuGet/[email protected] | ||
|
||
- name: Install GitVersion | ||
uses: gittools/actions/gitversion/[email protected] | ||
with: | ||
versionSpec: 5.12.0 | ||
|
||
- name: Determine Version | ||
uses: gittools/actions/gitversion/[email protected] | ||
with: | ||
useConfigFile: true | ||
|
||
- name: Restore dependencies | ||
run: dotnet restore | ||
|
||
- name: Restore dependencies with NuGet | ||
run: nuget restore $SOLUTION | ||
|
||
- name: Build | ||
run: dotnet build $SOLUTION --configuration $BUILD_CONFIG --no-restore | ||
|
||
- name: Nuget Pack | ||
run: nuget pack _nuget/config.nuspec -Symbols -Version ${{ env.semVer }} | ||
|
||
- name: ref | ||
run: echo "github.head_ref 1 ${{ github.head_ref }} 2 $GITHUB_REF 3 ${{ github.ref }}" | ||
|
||
- name: Create git Tag | ||
if: ${{ contains('refs/heads/hotfix', github.ref) || contains('refs/heads/hotfix', github.ref) || contains('refs/heads/master', github.ref) }} | ||
run: | | ||
git tag v${{ env.semVer }} | ||
- name: Push git Tag | ||
if: ${{ contains(fromJson('["refs/heads/master", "refs/heads/release", "refs/heads/hotfix"]'), github.ref) }} | ||
run: | | ||
git config --global user.name 'Denis Peshkov' | ||
git config --global user.email '[email protected]' | ||
git remote set-url origin https://x-access-token:${{ secrets.TAGTOKEN }}@github.com/${{ github.repository }} | ||
git push origin v${{ env.semVer }} | ||
- name: Nuget Push | ||
if: ${{ !startsWith(github.ref, 'refs/pull') }} | ||
run: nuget push **/Cross.CQRS.${{ env.semVer }}.symbols.nupkg -ApiKey ${{ secrets.NUGET_API_KEY }} -Source "https://api.nuget.org/v3/index.json" -SkipDuplicate | ||
|
||
- name: Test | ||
run: dotnet test --no-build --verbosity normal | ||
|
||
- name: Run tests | ||
run: dotnet test /p:Configuration=$BUILD_CONFIG --no-restore --no-build --verbosity normal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
next-version: 7.0.0 # | ||
branches: | ||
master: | ||
regex: ^master$|^main$ | ||
mode: ContinuousDelivery | ||
tag: '' | ||
increment: Inherit | ||
source-branches: | ||
- feature | ||
- hotfix | ||
- release | ||
prevent-increment-of-merged-branch-version: false | ||
track-merge-target: true | ||
tracks-release-branches: true | ||
is-release-branch: true | ||
pre-release-weight: 0 | ||
release: | ||
regex: ^release(s)?[/-] | ||
mode: ContinuousDelivery | ||
tag: preview | ||
tag-number-pattern: '[/-](?<number>\d+)[-/]' | ||
increment: Minor | ||
source-branches: | ||
- master | ||
- dev | ||
- release | ||
prevent-increment-of-merged-branch-version: false | ||
track-merge-target: true | ||
tracks-release-branches: true | ||
is-release-branch: true | ||
pre-release-weight: 30000 | ||
hotfix: | ||
regex: ^hotfix(es)?[/-] | ||
mode: ContinuousDelivery | ||
tag: preview | ||
tag-number-pattern: '[/-](?<number>\d+)[-/]' | ||
increment: Patch | ||
source-branches: [ master, hotfix ] | ||
prevent-increment-of-merged-branch-version: false | ||
track-merge-target: true | ||
tracks-release-branches: true | ||
is-release-branch: true | ||
pre-release-weight: 30000 | ||
feature: | ||
regex: ^feature(s)?[/-] | ||
mode: ContinuousDelivery | ||
tag: useBranchName | ||
increment: Inherit | ||
prevent-increment-of-merged-branch-version: false | ||
track-merge-target: false | ||
tracks-release-branches: false | ||
is-release-branch: false | ||
pull-request: | ||
regex: ^(pull|pull\-requests|pr|merge)[/-] | ||
mode: ContinuousDelivery | ||
tag: pr | ||
tag-number-pattern: '[/-](?<number>\d+)[-/]' | ||
increment: None | ||
source-branches: | ||
- dev | ||
- master | ||
- release | ||
- feature | ||
- support | ||
- hotfix | ||
prevent-increment-of-merged-branch-version: false | ||
track-merge-target: false | ||
tracks-release-branches: false | ||
is-release-branch: false | ||
dev: | ||
regex: ^dev(elop)?(ment)?$ | ||
mode: ContinuousDeployment | ||
tag: dev | ||
increment: Minor | ||
source-branches: [ master ] | ||
prevent-increment-of-merged-branch-version: false | ||
track-merge-target: true | ||
tracks-release-branches: true | ||
is-release-branch: false | ||
pre-release-weight: 40000 |