From 28d8c9e8fdc6c026f9398cf81ee00e528c22a3fe Mon Sep 17 00:00:00 2001
From: Dominic Orchard <dom.orchard@gmail.com>
Date: Thu, 12 Sep 2024 10:47:37 +0100
Subject: [PATCH] update ci/cd actions to use v4 loader

---
 .github/workflows/ci.yml               | 30 +++++++++++++-------------
 .github/workflows/disabled/hackage.yml |  8 +++----
 2 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index d0657377..dae1d6c6 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -17,11 +17,11 @@ jobs:
     runs-on: ubuntu-latest
     name: Ubuntu / Stack / test
     steps:
-    - uses: actions/checkout@v2
+    - uses: actions/checkout@v4
 
     # relative paths are relative to the project directory
     - name: Cache Stack build artifacts (user + project)
-      uses: actions/cache@v2
+      uses: actions/cache@v4
       with:
         path: |
           ~/.stack
@@ -41,7 +41,7 @@ jobs:
       run: stack --no-terminal install
 
     - name: Upload executable
-      uses: actions/upload-artifact@v2
+      uses: actions/upload-artifact@v4
       with:
         path: ~/.local/bin/${{ env.EXE_NAME }}
         name: ${{ env.EXE_NAME }}-ubuntu-stack-${{ github.sha }}
@@ -69,7 +69,7 @@ jobs:
     # My issue on haskell/actions: https://github.com/haskell/actions/issues/41
     # This also requires us to do a deep fetch, else we don't get the Git commit
     # history we need to rewrite mod times.
-    - uses: actions/checkout@v2
+    - uses: actions/checkout@v4
       with:
         fetch-depth: 0
     - name: Set all tracked file modification times to the time of their last commit
@@ -81,7 +81,7 @@ jobs:
 
     - name: Setup Haskell build environment
       id: setup-haskell-build-env
-      uses: haskell/actions/setup@v2
+      uses: haskell/actions/setup@v4
       with:
         ghc-version: ${{ matrix.ghc }}
         cabal-version: ${{ matrix.cabal }}
@@ -89,7 +89,7 @@ jobs:
     - run: cabal freeze
 
     - name: Cache Cabal build artifacts
-      uses: actions/cache@v2
+      uses: actions/cache@v4
       with:
         path: |
           ${{ steps.setup-haskell-build-env.outputs.cabal-store }}
@@ -114,11 +114,11 @@ jobs:
     steps:
 
     # TODO figure out timestamp fixer on Mac (no Mac available to test)
-    - uses: actions/checkout@v2
+    - uses: actions/checkout@v4
 
     - name: Setup Haskell build environment
       id: setup-haskell-build-env
-      uses: haskell/actions/setup@v2
+      uses: haskell/actions/setup@v4
       with:
         ghc-version: ${{ matrix.ghc }}
         cabal-version: ${{ matrix.cabal }}
@@ -126,7 +126,7 @@ jobs:
     - run: cabal freeze
 
     - name: Cache Cabal build artifacts
-      uses: actions/cache@v2
+      uses: actions/cache@v4
       with:
         path: |
           ${{ steps.setup-haskell-build-env.outputs.cabal-store }}
@@ -143,10 +143,10 @@ jobs:
       env:
         HSPEC_OPTIONS: --color
 
-    # note that Cabal uses symlinks -- actions/upload-artifact@v2 apparently
+    # note that Cabal uses symlinks -- actions/upload-artifact@v4 apparently
     # dereferences for us
     - name: Upload executable
-      uses: actions/upload-artifact@v2
+      uses: actions/upload-artifact@v4
       with:
         path: ~/.cabal/bin/${{ env.EXE_NAME }}
         name: ${{ env.EXE_NAME }}-macos-ghc-${{ matrix.ghc }}-cabal-${{ github.sha }}
@@ -162,11 +162,11 @@ jobs:
         ghc: ["9.2"]
     steps:
     # TODO figure out timestamp fixer on Windows (need Bash)
-    - uses: actions/checkout@v2
+    - uses: actions/checkout@v4
 
     - name: Setup Haskell build environment
       id: setup-haskell-build-env
-      uses: haskell/actions/setup@v2
+      uses: haskell/actions/setup@v4
       with:
         ghc-version: ${{ matrix.ghc }}
         cabal-version: ${{ matrix.cabal }}
@@ -174,7 +174,7 @@ jobs:
     - run: cabal freeze
 
     - name: Cache Cabal build artifacts
-      uses: actions/cache@v2
+      uses: actions/cache@v4
       with:
         path: |
           ${{ steps.setup-haskell-build-env.outputs.cabal-store }}
@@ -192,7 +192,7 @@ jobs:
         HSPEC_OPTIONS: --color
 
     - name: Upload executable
-      uses: actions/upload-artifact@v2
+      uses: actions/upload-artifact@v4
       with:
         path: "C:/cabal/bin/${{ env.EXE_NAME }}.exe"
         name: ${{ env.EXE_NAME }}-windows-ghc-${{ matrix.ghc }}-cabal-${{ github.sha }}.exe
diff --git a/.github/workflows/disabled/hackage.yml b/.github/workflows/disabled/hackage.yml
index c8bd69a5..af6ae2ab 100644
--- a/.github/workflows/disabled/hackage.yml
+++ b/.github/workflows/disabled/hackage.yml
@@ -34,7 +34,7 @@ jobs:
     # My issue on haskell/actions: https://github.com/haskell/actions/issues/41
     # This also requires us to do a deep fetch, else we don't get the Git commit
     # history we need to rewrite mod times.
-    - uses: actions/checkout@v2
+    - uses: actions/checkout@v4
       with:
         fetch-depth: 0
     - name: Set all tracked file modification times to the time of their last commit
@@ -56,7 +56,7 @@ jobs:
     - run: cabal freeze
 
     - name: Cache global Cabal store
-      uses: actions/cache@v2
+      uses: actions/cache@v4
       with:
         path: ~/.cabal/store
         key: hackage-deps-${{ runner.os }}-ghc_${{ env.ghc }}
@@ -68,14 +68,14 @@ jobs:
     - run: cabal sdist
 
     - name: Upload Hackage sdist
-      uses: actions/upload-artifact@v2
+      uses: actions/upload-artifact@v4
       with:
         path: dist-newstyle/sdist/${{ env.package_name }}-*.tar.gz
         name: ${{ env.package_name }}-sdist-${{ github.sha }}.tar.gz
         if-no-files-found: error
 
     - name: Upload Hackage Haddock docs
-      uses: actions/upload-artifact@v2
+      uses: actions/upload-artifact@v4
       with:
         path: dist-newstyle/${{ env.package_name }}-*-docs.tar.gz
         name: ${{ env.package_name }}-hackage-haddocks-${{ github.sha }}.tar.gz