From 03c7c7e86a9f9334777e29ae044a9a997a4c96ec Mon Sep 17 00:00:00 2001 From: Michael Croes Date: Mon, 2 Jun 2025 21:45:38 +0200 Subject: [PATCH 1/9] ci: Constrain versionSpec for GitVersion Action is compatible with <6.1.0 only. --- .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 8116e8b7..62b12563 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -34,7 +34,7 @@ jobs: - name: Install GitVersion uses: gittools/actions/gitversion/setup@v0 with: - versionSpec: '6.x' + versionSpec: '6.0.x' includePrerelease: true preferLatestVersion: true From 2cdeaea04820a5725f6ebaca60d654cbf81515c0 Mon Sep 17 00:00:00 2001 From: Michael Croes Date: Mon, 2 Jun 2025 21:46:27 +0200 Subject: [PATCH 2/9] ci: Install dotnet before installing GitVersion GitVersion relies on dotnet, this permits running on act locally. --- .github/workflows/dotnet.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 62b12563..8504be89 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -31,6 +31,9 @@ jobs: with: fetch-depth: 0 # Get all history to allow automatic versioning + - name: Setup .NET + uses: actions/setup-dotnet@v3 + - name: Install GitVersion uses: gittools/actions/gitversion/setup@v0 with: @@ -42,9 +45,6 @@ jobs: id: gitversion uses: gittools/actions/gitversion/execute@v0 - - name: Setup .NET - uses: actions/setup-dotnet@v3 - - run: > dotnet pack --configuration Release From 8c13bdf9a9e8b7dde0fb595c71fa05c4e60da8ed Mon Sep 17 00:00:00 2001 From: Michael Croes Date: Mon, 2 Jun 2025 22:29:53 +0200 Subject: [PATCH 3/9] ci: Remove shell override --- .github/workflows/dotnet.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 8504be89..79193e96 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -19,10 +19,6 @@ env: DOTNET_NOLOGO: true NuGetDirectory: ${{ github.workspace}}/nuget -defaults: - run: - shell: pwsh - jobs: create_nuget: runs-on: ubuntu-latest From 3bd3aab38b4864619d40648fb8b71c3ce9352016 Mon Sep 17 00:00:00 2001 From: Michael Croes Date: Mon, 2 Jun 2025 22:30:13 +0200 Subject: [PATCH 4/9] ci: Actually specify dotnet versions in create_nuget --- .github/workflows/dotnet.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 79193e96..8a76ac9a 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -29,6 +29,10 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v3 + with: + dotnet-version: | + 6.x + 7.x - name: Install GitVersion uses: gittools/actions/gitversion/setup@v0 From b8ea8ba29559369b1d6338cc6060786166d6b8d9 Mon Sep 17 00:00:00 2001 From: Michael Croes Date: Mon, 2 Jun 2025 23:03:53 +0200 Subject: [PATCH 5/9] ci: Add -y to add-apt-repository --- .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 8a76ac9a..c2dee77d 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -80,7 +80,7 @@ jobs: - name: Install Snap7 Linux if: ${{ matrix.os == 'ubuntu-20.04' }} run: | - sudo add-apt-repository ppa:gijzelaar/snap7 + sudo add-apt-repository ppa:gijzelaar/snap7 -y sudo apt-get update sudo apt-get install libsnap7-1 libsnap7-dev From aeaf1d06183bf0fd1bcc4dcf6be07776283c922c Mon Sep 17 00:00:00 2001 From: Michael Croes Date: Mon, 2 Jun 2025 23:05:27 +0200 Subject: [PATCH 6/9] ci: Skip Nuget cache on act --- .github/workflows/dotnet.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index c2dee77d..7d2215e7 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -97,6 +97,7 @@ jobs: 7.x - name: Nuget Cache + if: ${{ !env.ACT }} uses: actions/cache@v3 with: path: ~/.nuget/packages From b601e80ca68c3ec1cf27c1dee46e01ae66f5a956 Mon Sep 17 00:00:00 2001 From: Michael Croes Date: Mon, 2 Jun 2025 23:05:47 +0200 Subject: [PATCH 7/9] ci: Use ubuntu-latest instead of 20.04 --- .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 7d2215e7..43084161 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -71,14 +71,14 @@ jobs: artifacts: ${{ github.workspace }}/artifacts strategy: matrix: - os: [windows-latest, ubuntu-20.04, macos-latest] + os: [windows-latest, ubuntu-latest, macos-latest] fail-fast: false steps: - uses: actions/checkout@v3 - name: Install Snap7 Linux - if: ${{ matrix.os == 'ubuntu-20.04' }} + if: ${{ matrix.os == 'ubuntu-latest' }} run: | sudo add-apt-repository ppa:gijzelaar/snap7 -y sudo apt-get update From 1d530c261cdc8fdd304bf7fcd8a164b78848dc05 Mon Sep 17 00:00:00 2001 From: Michael Croes Date: Mon, 2 Jun 2025 23:11:47 +0200 Subject: [PATCH 8/9] ci: Update artifact actions --- .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 43084161..12d48485 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -54,7 +54,7 @@ jobs: /p:PackageVersion=${{ steps.gitversion.outputs.semVer }} --output ${{ env.NuGetDirectory }} - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: nuget if-no-files-found: error @@ -117,7 +117,7 @@ jobs: runs-on: ubuntu-latest needs: [ create_nuget, run_test ] steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: nuget path: ${{ env.NuGetDirectory }} From e162c7cc70449dcba3bade82aa0ce79292f51938 Mon Sep 17 00:00:00 2001 From: Michael Croes Date: Mon, 2 Jun 2025 23:19:20 +0200 Subject: [PATCH 9/9] ci: Use macos-13 for compatibility --- .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 12d48485..099ee79e 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -71,7 +71,7 @@ jobs: artifacts: ${{ github.workspace }}/artifacts strategy: matrix: - os: [windows-latest, ubuntu-latest, macos-latest] + os: [windows-latest, ubuntu-latest, macos-13] fail-fast: false steps: @@ -85,7 +85,7 @@ jobs: sudo apt-get install libsnap7-1 libsnap7-dev - name: Install Snap7 MacOs - if: ${{ matrix.os == 'macos-latest' }} + if: ${{ matrix.os == 'macos-13' }} run: | brew install snap7