From 79ec2804be16786d4452c37a54ba66476f7d95a5 Mon Sep 17 00:00:00 2001 From: Nico Orschel Date: Wed, 22 Feb 2023 17:00:05 +0100 Subject: [PATCH 01/18] Create dotnet.yml --- .github/workflows/dotnet.yml | 60 ++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .github/workflows/dotnet.yml diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml new file mode 100644 index 0000000..66ffa64 --- /dev/null +++ b/.github/workflows/dotnet.yml @@ -0,0 +1,60 @@ +# This workflow will build a .NET project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net + +name: NugetRevisionDemo + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + workflow_dispatch: + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - run: nuget install GitVersion.Commandline + + - name: GitVersion action + # You may pin to the exact commit or the version. + # uses: nmcc/actions-gitversion@4ab384d333506ede37c82ca3e03f4005b18b7573 + uses: nmcc/actions-gitversion@v1 + with: + # Path to the gitversion executable + path-to-gitversion: packages/GitVersion.CommandLine/tools/GitVersion.exe + + + - name: Version - Modify version number + uses: mingjun97/file-regex-replace@v1 + env: + version-number: ${{ env.majorVersion }}.${{ env.minorVersion }}.${{ github.run_number }}.0 + with: + regex: '[[0-9]+(\.([0-9]+|\*)){1,3}' + replacement: '${{ env.version-number}}' + flags: "gi" # Optional, defaults to "g" + include: '.csproj' # Optional, defaults to ".*" + exclude: '.^' # Optional, defaults to '.^' + encoding: 'utf8' # Optional, defaults to 'utf8' + path: '.' # Optional, defaults to '.' + + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 6.0.x + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build --no-restore + - name: Test + run: dotnet test --no-build --verbosity normal + - name: Upload a Build Artifact + uses: actions/upload-artifact@v3.1.2 + with: + # Artifact name + name: NugetPackage + path: '**/*.nupkg' From 4a49f28d8ebc228c2b01adb28de6db5125eca7b2 Mon Sep 17 00:00:00 2001 From: Nico Orschel Date: Wed, 22 Feb 2023 17:19:02 +0100 Subject: [PATCH 02/18] Update dotnet.yml --- .github/workflows/dotnet.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 66ffa64..610e7e0 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -14,19 +14,21 @@ jobs: build: runs-on: ubuntu-latest + env: + GitVersionVersion: 5.12.0 steps: - uses: actions/checkout@v3 - - run: nuget install GitVersion.Commandline - + - run: nuget install GitVersion.Commandline --Version ${{ env.GitVersionVersion }} + - name: GitVersion action # You may pin to the exact commit or the version. # uses: nmcc/actions-gitversion@4ab384d333506ede37c82ca3e03f4005b18b7573 uses: nmcc/actions-gitversion@v1 with: # Path to the gitversion executable - path-to-gitversion: packages/GitVersion.CommandLine/tools/GitVersion.exe + path-to-gitversion: GitVersion.CommandLine.{{ env.GitVersionVersion }}/tools/GitVersion.exe - name: Version - Modify version number From 65bc3a2907d217aedaa1f0b029452ea74f4a789f Mon Sep 17 00:00:00 2001 From: Nico Orschel Date: Wed, 22 Feb 2023 17:22:52 +0100 Subject: [PATCH 03/18] Update dotnet.yml --- .github/workflows/dotnet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 610e7e0..7e49035 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -20,7 +20,7 @@ jobs: steps: - uses: actions/checkout@v3 - - run: nuget install GitVersion.Commandline --Version ${{ env.GitVersionVersion }} + - run: nuget install GitVersion.Commandline -version ${{ env.GitVersionVersion }} - name: GitVersion action # You may pin to the exact commit or the version. From 87152e6e0e94ffa3020b027b63fb7a0ce3392a6b Mon Sep 17 00:00:00 2001 From: Nico Orschel Date: Wed, 22 Feb 2023 17:25:08 +0100 Subject: [PATCH 04/18] Update dotnet.yml --- .github/workflows/dotnet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 7e49035..0fc27bd 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -28,7 +28,7 @@ jobs: uses: nmcc/actions-gitversion@v1 with: # Path to the gitversion executable - path-to-gitversion: GitVersion.CommandLine.{{ env.GitVersionVersion }}/tools/GitVersion.exe + path-to-gitversion: GitVersion.CommandLine.${{ env.GitVersionVersion }}/tools/GitVersion.exe - name: Version - Modify version number From bc2960f533c6842e163fd44b6045ab997d8dab02 Mon Sep 17 00:00:00 2001 From: Nico Orschel Date: Wed, 22 Feb 2023 17:28:06 +0100 Subject: [PATCH 05/18] Update dotnet.yml --- .github/workflows/dotnet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 0fc27bd..c23ebb5 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -13,7 +13,7 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: windows-latest env: GitVersionVersion: 5.12.0 From 7376a491dfe296f677c08baa8062e543b6f153fd Mon Sep 17 00:00:00 2001 From: Nico Orschel Date: Wed, 22 Feb 2023 17:34:15 +0100 Subject: [PATCH 06/18] Update dotnet.yml --- .github/workflows/dotnet.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index c23ebb5..c7bc5bc 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -21,6 +21,7 @@ jobs: - uses: actions/checkout@v3 - run: nuget install GitVersion.Commandline -version ${{ env.GitVersionVersion }} + - run: get-childitem -recurse - name: GitVersion action # You may pin to the exact commit or the version. From 755944d47e02a147ee41fcb9ccc820d3f86891a3 Mon Sep 17 00:00:00 2001 From: Nico Orschel Date: Wed, 22 Feb 2023 17:35:25 +0100 Subject: [PATCH 07/18] Update dotnet.yml --- .github/workflows/dotnet.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index c7bc5bc..6283fc1 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -22,7 +22,8 @@ jobs: - run: nuget install GitVersion.Commandline -version ${{ env.GitVersionVersion }} - run: get-childitem -recurse - + shell: pwsh + - name: GitVersion action # You may pin to the exact commit or the version. # uses: nmcc/actions-gitversion@4ab384d333506ede37c82ca3e03f4005b18b7573 From e933efd89d2e221d0d0294df47e2a739533969db Mon Sep 17 00:00:00 2001 From: Nico Orschel Date: Wed, 22 Feb 2023 17:40:19 +0100 Subject: [PATCH 08/18] Update dotnet.yml --- .github/workflows/dotnet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 6283fc1..b7ee5c8 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -30,7 +30,7 @@ jobs: uses: nmcc/actions-gitversion@v1 with: # Path to the gitversion executable - path-to-gitversion: GitVersion.CommandLine.${{ env.GitVersionVersion }}/tools/GitVersion.exe + path-to-gitversion: ${{ github.workspace }}/GitVersion.CommandLine.${{ env.GitVersionVersion }}/tools/GitVersion.exe - name: Version - Modify version number From 8bf702b6e181e0f718624c6bc60705b4baab039c Mon Sep 17 00:00:00 2001 From: Nico Orschel Date: Wed, 22 Feb 2023 18:00:57 +0100 Subject: [PATCH 09/18] Update dotnet.yml --- .github/workflows/dotnet.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index b7ee5c8..603f3bd 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -30,9 +30,8 @@ jobs: uses: nmcc/actions-gitversion@v1 with: # Path to the gitversion executable - path-to-gitversion: ${{ github.workspace }}/GitVersion.CommandLine.${{ env.GitVersionVersion }}/tools/GitVersion.exe - - + path-to-gitversion: ${{ github.workspace }}\GitVersion.CommandLine.${{ env.GitVersionVersion }}\tools\GitVersion.exe + - name: Version - Modify version number uses: mingjun97/file-regex-replace@v1 env: From 3316fb4c1595f2c4e5f205c5900c321961e91679 Mon Sep 17 00:00:00 2001 From: Nico Orschel Date: Wed, 22 Feb 2023 18:09:39 +0100 Subject: [PATCH 10/18] Update dotnet.yml --- .github/workflows/dotnet.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 603f3bd..2c16e3a 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -30,8 +30,8 @@ jobs: uses: nmcc/actions-gitversion@v1 with: # Path to the gitversion executable - path-to-gitversion: ${{ github.workspace }}\GitVersion.CommandLine.${{ env.GitVersionVersion }}\tools\GitVersion.exe - + path-to-gitversion: ${{ github.workspace }}\GitVersion.CommandLine.${{ env.GitVersionVersion }}\tools + - name: Version - Modify version number uses: mingjun97/file-regex-replace@v1 env: From e2f84da73d88ab1b7033ab55aeb8c9c6bae47aac Mon Sep 17 00:00:00 2001 From: Nico Orschel Date: Wed, 22 Feb 2023 18:11:52 +0100 Subject: [PATCH 11/18] Update dotnet.yml --- .github/workflows/dotnet.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 2c16e3a..987df7d 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -13,7 +13,7 @@ on: jobs: build: - runs-on: windows-latest + runs-on: ubuntu-latest env: GitVersionVersion: 5.12.0 @@ -30,7 +30,7 @@ jobs: uses: nmcc/actions-gitversion@v1 with: # Path to the gitversion executable - path-to-gitversion: ${{ github.workspace }}\GitVersion.CommandLine.${{ env.GitVersionVersion }}\tools + path-to-gitversion: ${{ github.workspace }}/GitVersion.CommandLine.${{ env.GitVersionVersion }}/tools - name: Version - Modify version number uses: mingjun97/file-regex-replace@v1 From cb69b1b3888a90d54700bd6b2e84355de49ae95a Mon Sep 17 00:00:00 2001 From: Nico Orschel Date: Wed, 22 Feb 2023 18:15:36 +0100 Subject: [PATCH 12/18] Update dotnet.yml --- .github/workflows/dotnet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 987df7d..a5aa4e6 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -30,7 +30,7 @@ jobs: uses: nmcc/actions-gitversion@v1 with: # Path to the gitversion executable - path-to-gitversion: ${{ github.workspace }}/GitVersion.CommandLine.${{ env.GitVersionVersion }}/tools + path-to-gitversion: ${{ github.workspace }}/GitVersion.CommandLine.${{ env.GitVersionVersion }}/tools/gitversion.exe - name: Version - Modify version number uses: mingjun97/file-regex-replace@v1 From 98523adf74906766c7e68b6a2bbc52c02c5a1ae9 Mon Sep 17 00:00:00 2001 From: Nico Orschel Date: Wed, 22 Feb 2023 18:17:16 +0100 Subject: [PATCH 13/18] Update dotnet.yml --- .github/workflows/dotnet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index a5aa4e6..afda91c 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -13,7 +13,7 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: windows-latest env: GitVersionVersion: 5.12.0 From e85d3ddca77966488e1fac4c6a9ca378d81427e3 Mon Sep 17 00:00:00 2001 From: Nico Orschel Date: Wed, 22 Feb 2023 18:23:57 +0100 Subject: [PATCH 14/18] Update dotnet.yml --- .github/workflows/dotnet.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index afda91c..74fdc83 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -19,6 +19,8 @@ jobs: steps: - uses: actions/checkout@v3 + with: + fetch-depth: 0 - run: nuget install GitVersion.Commandline -version ${{ env.GitVersionVersion }} - run: get-childitem -recurse From 5976c33da0a6ef791ee20a543d76704d1f68d61a Mon Sep 17 00:00:00 2001 From: Nico Orschel Date: Wed, 22 Feb 2023 18:32:16 +0100 Subject: [PATCH 15/18] Update dotnet.yml --- .github/workflows/dotnet.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 74fdc83..7ab86dc 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -27,6 +27,7 @@ jobs: shell: pwsh - name: GitVersion action + id: gitversion # You may pin to the exact commit or the version. # uses: nmcc/actions-gitversion@4ab384d333506ede37c82ca3e03f4005b18b7573 uses: nmcc/actions-gitversion@v1 @@ -37,7 +38,7 @@ jobs: - name: Version - Modify version number uses: mingjun97/file-regex-replace@v1 env: - version-number: ${{ env.majorVersion }}.${{ env.minorVersion }}.${{ github.run_number }}.0 + version-number: ${{ steps.gitversion.outputs.SemVer }}.0 with: regex: '[[0-9]+(\.([0-9]+|\*)){1,3}' replacement: '${{ env.version-number}}' From 6a3d2451020ed5b432f71ad7c2fcbd6ee6774a83 Mon Sep 17 00:00:00 2001 From: Nico Orschel Date: Wed, 22 Feb 2023 18:36:37 +0100 Subject: [PATCH 16/18] Update dotnet.yml --- .github/workflows/dotnet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 7ab86dc..10c2ad0 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -38,7 +38,7 @@ jobs: - name: Version - Modify version number uses: mingjun97/file-regex-replace@v1 env: - version-number: ${{ steps.gitversion.outputs.SemVer }}.0 + version-number: ${{ steps.gitversion.outputs.NuGetVersion }}.0 with: regex: '[[0-9]+(\.([0-9]+|\*)){1,3}' replacement: '${{ env.version-number}}' From 915ad6bc711484a34115b148c04c6a361dc0f889 Mon Sep 17 00:00:00 2001 From: Nico Orschel Date: Wed, 22 Feb 2023 18:42:59 +0100 Subject: [PATCH 17/18] Update dotnet.yml --- .github/workflows/dotnet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 10c2ad0..bc2b6c4 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -38,7 +38,7 @@ jobs: - name: Version - Modify version number uses: mingjun97/file-regex-replace@v1 env: - version-number: ${{ steps.gitversion.outputs.NuGetVersion }}.0 + version-number: ${{ steps.gitversion.outputs.AssemblySemVer }}.0 with: regex: '[[0-9]+(\.([0-9]+|\*)){1,3}' replacement: '${{ env.version-number}}' From 26379883b618394474cfb8fcfc0cd55ef6a5f639 Mon Sep 17 00:00:00 2001 From: Nico Orschel Date: Wed, 22 Feb 2023 18:56:01 +0100 Subject: [PATCH 18/18] Update dotnet.yml --- .github/workflows/dotnet.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index bc2b6c4..39d11a0 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -35,10 +35,17 @@ jobs: # Path to the gitversion executable path-to-gitversion: ${{ github.workspace }}/GitVersion.CommandLine.${{ env.GitVersionVersion }}/tools/gitversion.exe + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 6.0.x + - name: Restore dependencies + run: dotnet restore + - name: Version - Modify version number uses: mingjun97/file-regex-replace@v1 env: - version-number: ${{ steps.gitversion.outputs.AssemblySemVer }}.0 + version-number: ${{ steps.gitversion.outputs.AssemblySemVer }} with: regex: '[[0-9]+(\.([0-9]+|\*)){1,3}' replacement: '${{ env.version-number}}' @@ -48,12 +55,6 @@ jobs: encoding: 'utf8' # Optional, defaults to 'utf8' path: '.' # Optional, defaults to '.' - - name: Setup .NET - uses: actions/setup-dotnet@v3 - with: - dotnet-version: 6.0.x - - name: Restore dependencies - run: dotnet restore - name: Build run: dotnet build --no-restore - name: Test