From 920defeeb72c818e8343a2c5bb2684a26faf8ae1 Mon Sep 17 00:00:00 2001 From: Martijn Bodeman <11424653+skwasjer@users.noreply.github.com> Date: Wed, 7 Feb 2024 17:51:15 +0100 Subject: [PATCH] ci: change to v4 actions / upgrade to NodeJS 20 (#94) * ci: update to v4 actions/use NodeJS 16 See https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/ * ci: v4 upload/download improvements don't require custom tar logic anymore --- .github/actions/download-artifact/action.yml | 32 ------------- .github/actions/upload-artifact/action.yml | 47 -------------------- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/main.yml | 24 +++++----- .github/workflows/sonarcloud.yml | 8 ++-- 5 files changed, 17 insertions(+), 96 deletions(-) delete mode 100644 .github/actions/download-artifact/action.yml delete mode 100644 .github/actions/upload-artifact/action.yml diff --git a/.github/actions/download-artifact/action.yml b/.github/actions/download-artifact/action.yml deleted file mode 100644 index 7227ff2..0000000 --- a/.github/actions/download-artifact/action.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Download artifact -description: Wrapper around GitHub's official action, with additional extraction before download - -# https://github.com/actions/download-artifact/blob/main/action.yml -# https://github.com/actions/upload-artifact/issues/199 -inputs: - name: - description: Artifact name - required: true - path: - description: Destination path - required: false - default: . - -runs: - using: composite - steps: - - name: Download artifacts - uses: actions/download-artifact@v3 - with: - name: ${{ inputs.name }} - path: ${{ inputs.path }} - - - name: Extract artifacts - run: tar -xvf ${{ inputs.name }}.tar - shell: bash - working-directory: ${{ inputs.path }} - - - name: Remove archive - run: rm -f ${{ inputs.name }}.tar - shell: bash - working-directory: ${{ inputs.path }} diff --git a/.github/actions/upload-artifact/action.yml b/.github/actions/upload-artifact/action.yml deleted file mode 100644 index b8aeff2..0000000 --- a/.github/actions/upload-artifact/action.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Upload artifact -description: Wrapper around GitHub's official action, with additional archiving before upload - -# https://github.com/actions/upload-artifact/blob/main/action.yml -# https://github.com/actions/upload-artifact/issues/199 -inputs: - name: - description: Artifact name - required: true - path: - description: One or more files, directories or wildcard pattern that describes what to upload - required: true - if-no-files-found: - description: > - The desired behavior if no files are found using the provided path. - Available Options: - warn: Output a warning but do not fail the action - error: Fail the action with an error message - ignore: Do not output any warnings or errors, the action does not fail - required: false - default: warn - retention-days: - description: > - Duration after which artifact will expire in days. 0 means using default retention. - Minimum 1 day. - Maximum 90 days unless changed from the repository settings page. - required: false - default: '0' - -runs: - using: composite - steps: - - name: Archive artifacts - run: tar -cv -I 'xz -0 -T0' -f ${{ inputs.name }}.tar $(echo "${{ inputs.path }}" | tr '\n' ' ') - shell: bash - - - name: Upload artifacts - uses: actions/upload-artifact@v3 - with: - if-no-files-found: ${{ inputs.if-no-files-found }} - name: ${{ inputs.name }} - path: ${{ inputs.name }}.tar - retention-days: ${{ inputs.retention-days }} - - - name: Remove archive - run: rm -f ${{ inputs.name }}.tar - shell: bash diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index bf3f30a..6c772d4 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -48,7 +48,7 @@ jobs: steps: # Setup - - uses: actions/setup-dotnet@v3 + - uses: actions/setup-dotnet@v4 with: dotnet-version: ${{ env.dotnet-version }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 216fd3f..035ec3d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -38,12 +38,12 @@ jobs: fetch-tags: true - name: Install GitVersion ${{ env.GITVERSION }} - uses: gittools/actions/gitversion/setup@v0.10.2 + uses: gittools/actions/gitversion/setup@v0.11.0 with: versionSpec: ${{ env.GITVERSION }} - name: Determine version - uses: gittools/actions/gitversion/execute@v0.10.2 + uses: gittools/actions/gitversion/execute@v0.11.0 id: gitversion with: useConfigFile: true @@ -60,7 +60,7 @@ jobs: msbuild-version-args: ${{ env.msbuild-version-args }} steps: # Setup - - uses: actions/setup-dotnet@v3 + - uses: actions/setup-dotnet@v4 with: dotnet-version: ${{ env.dotnet-version }} @@ -73,7 +73,7 @@ jobs: # NuGet cache - name: Restore NuGet global package cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.nuget/packages key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.targets','**/*.props','**/*.csproj') }} # Can't use packages.lock.json yet, because Dependabot does not support it. @@ -86,7 +86,7 @@ jobs: # Build - run: dotnet build --no-restore -c Release ${{ env.msbuild-version-args }} - name: Upload build artifacts - uses: ./.github/actions/upload-artifact + uses: actions/upload-artifact@v4 with: name: build path: | @@ -107,7 +107,7 @@ jobs: runs-on: ${{ matrix.os }} steps: # Setup - - uses: actions/setup-dotnet@v3 + - uses: actions/setup-dotnet@v4 with: dotnet-version: ${{ env.dotnet-version }} @@ -118,7 +118,7 @@ jobs: # Restore build artifacts - name: Download build artifacts - uses: ./.github/actions/download-artifact + uses: actions/download-artifact@v4 with: name: build @@ -132,7 +132,7 @@ jobs: runs-on: ubuntu-latest steps: # Setup - - uses: actions/setup-dotnet@v3 + - uses: actions/setup-dotnet@v4 with: dotnet-version: ${{ env.dotnet-version }} @@ -143,7 +143,7 @@ jobs: # NuGet cache (.NET Framework Reference assemblies are needed for pack) - name: Restore NuGet global package cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.nuget/packages key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.targets','**/*.props','**/*.csproj') }} # Can't use packages.lock.json yet, because Dependabot does not support it. @@ -153,14 +153,14 @@ jobs: # Restore build artifacts - name: Download build artifacts - uses: ./.github/actions/download-artifact + uses: actions/download-artifact@v4 with: name: build # Pack - run: dotnet pack --no-restore --no-build -c Release ${{ needs.build.outputs.msbuild-version-args }} - name: Upload release artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: release-${{ needs.determine-version.outputs.package-version }} path: | @@ -179,7 +179,7 @@ jobs: steps: # Restore release artifacts - name: Download release artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: release-${{ needs.determine-version.outputs.package-version }} diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 8afda02..8ec8252 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -33,17 +33,17 @@ jobs: needs: authorize runs-on: ubuntu-latest steps: - - uses: actions/setup-dotnet@v3 + - uses: actions/setup-dotnet@v4 with: dotnet-version: ${{ env.dotnet-version }} - run: dotnet --info - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 20 - - uses: actions/setup-java@v3 + - uses: actions/setup-java@v4 with: distribution: "temurin" java-version: "17"