SDL: ci: always upload the artifacts

From a6bc6b882c27522e08f317a4b7fa6e2eb67da566 Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Sun, 27 Aug 2023 16:25:55 +0200
Subject: [PATCH] ci: always upload the artifacts

---
 .github/workflows/main.yml | 3 +++
 .github/workflows/msvc.yml | 6 +++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 2a0a8e47bc99..431787d842db 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -103,6 +103,7 @@ jobs:
           -DCMAKE_BUILD_TYPE=Release \
           ${{ matrix.platform.cmake }}
     - name: Build (CMake)
+      id: build
       run: |
         ${{ matrix.platform.source_cmd }}
         cmake --build build/ --config Release --verbose --parallel
@@ -123,6 +124,7 @@ jobs:
         cmake --install build/ --config Release
         ( cd cmake_prefix; find . ) | LC_ALL=C sort -u
     - name: Package (CPack)
+      if: ${{ always() && steps.build.outcome == 'success' }}
       run: |
         cmake --build build/ --config Release --target package
     - name: Verify CMake configuration files
@@ -141,6 +143,7 @@ jobs:
         export PKG_CONFIG_PATH=$(echo "${{ github.workspace }}/cmake_prefix/lib/pkgconfig" | sed  -e 's#\\#/#g')
         cmake/test/test_pkgconfig.sh
     - uses: actions/upload-artifact@v3
+      if: ${{ always() && steps.build.outcome == 'success' }}
       with:
         if-no-files-found: error
         name: ${{ matrix.platform.artifact }}
diff --git a/.github/workflows/msvc.yml b/.github/workflows/msvc.yml
index d7b51e292fab..897f694300cc 100644
--- a/.github/workflows/msvc.yml
+++ b/.github/workflows/msvc.yml
@@ -57,7 +57,9 @@ jobs:
         ${{ matrix.platform.flags }} `
         -DCMAKE_INSTALL_PREFIX=prefix
     - name: Build (CMake)
-      run: cmake --build build/ --config Release --parallel
+      id: build
+      run: |
+        cmake --build build/ --config Release --parallel
     - name: Run build-time tests
       if: ${{ !matrix.platform.notests }}
       run: |
@@ -68,6 +70,7 @@ jobs:
         echo "SDL3_DIR=$Env:GITHUB_WORKSPACE/prefix" >> $Env:GITHUB_ENV
         cmake --install build/
     - name: Package (CPack)
+      if: ${{ always() && steps.build.outcome == 'success' }}
       run: |
         cmake --build build/ --config Release --target PACKAGE
     - name: Verify CMake configuration files
@@ -84,6 +87,7 @@ jobs:
       if: ${{ matrix.platform.project != '' }}
       run: msbuild ${{ matrix.platform.project }} /m /p:BuildInParallel=true /p:Configuration=Release ${{ matrix.platform.projectflags }}
     - uses: actions/upload-artifact@v3
+      if: ${{ always() && steps.build.outcome == 'success' }}
       with:
         if-no-files-found: error
         name: ${{ matrix.platform.artifact }}