Repository: WorksApplications/sudachi.rs (language: python)

Issue:
Update github workflow
Some actions become deprecated.
e.g.
```
actions/checkout@v3
actions/setup-python@v4
actions/cache@v3
actions/upload-artifact@v3
peaceiris/actions-gh-pages@v3
```

ref:
https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20

https://github.com/WorksApplications/sudachi.rs/actions/runs/8058810554
https://github.com/WorksApplications/sudachi.rs/actions/runs/8058810553
https://github.com/WorksApplications/sudachi.rs/actions/runs/8058810544




Discussion / hints:

Fix patch:
diff --git a/.github/workflows/build-python-wheels.yml b/.github/workflows/build-python-wheels.yml
index 6a0a14a2..e027d157 100644
--- a/.github/workflows/build-python-wheels.yml
+++ b/.github/workflows/build-python-wheels.yml
@@ -14,10 +14,10 @@ jobs:
     name: Build source distribution
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/checkout@v3
+      - uses: actions/checkout@v4
 
       - name: Setup python
-        uses: actions/setup-python@v4
+        uses: actions/setup-python@v5
         with:
           python-version: '3.11'
 
@@ -30,20 +30,21 @@ jobs:
         working-directory: ./python
         run: bash build-sdist.sh
 
-      - uses: actions/upload-artifact@v3
+      - uses: actions/upload-artifact@v4
         with:
+          name: artifact-sdist
           path: python/dist/*
 
   build-linux-wheels:
     name: Build Linux Python Wheels (+PGO)
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/checkout@v3
+      - uses: actions/checkout@v4
 
       - name: Download dictionary
         run: bash fetch_dictionary.sh "20220519" "core"
 
-      - uses: actions/cache@v3
+      - uses: actions/cache@v4
         with:
           path: |
             ~/.cargo/bin/
@@ -57,8 +58,9 @@ jobs:
         with:
           script: python/build-wheels-manylinux-pgo.sh
 
-      - uses: actions/upload-artifact@v3
+      - uses: actions/upload-artifact@v4
         with:
+          name: artifact-manylinux
           path: python/dist/*manylinux*
 
   build-non-linux-wheels:
@@ -67,16 +69,16 @@ jobs:
     strategy:
       matrix:
         os: [windows-latest, macOS-latest]
-        python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11", "3.12" ]
+        python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
 
     steps:
-      - uses: actions/checkout@v3
+      - uses: actions/checkout@v4
 
-      - uses: actions/setup-python@v4
+      - uses: actions/setup-python@v5
         with:
           python-version: ${{ matrix.python-version }}
 
-      - uses: actions/cache@v3
+      - uses: actions/cache@v4
         with:
           path: |
             ~/.cargo/bin/
@@ -102,8 +104,9 @@ jobs:
           ARCHFLAGS: -arch x86_64 -arch arm64
           MACOSX_DEPLOYMENT_TARGET: 10.12
 
-      - uses: actions/upload-artifact@v3
+      - uses: actions/upload-artifact@v4
         with:
+          name: artifact-${{ matrix.os }}-${{ matrix.python-version }}
           path: python/dist/*.whl
 
   upload-to-pypi: # run only if all have succeeded
@@ -112,10 +115,11 @@ jobs:
     if: startsWith(github.ref, 'refs/tags/v') # only for tags
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/download-artifact@v3
+      - uses: actions/download-artifact@v4
         with:
-          name: artifact # default artifact name
+          pattern: artifact-*
           path: dist/
+          merge-multiple: true
 
       - name: List files to upload
         run: ls -R dist/
diff --git a/.github/workflows/docs-deploy.yml b/.github/workflows/docs-deploy.yml
index 69976342..713449ff 100644
--- a/.github/workflows/docs-deploy.yml
+++ b/.github/workflows/docs-deploy.yml
@@ -8,7 +8,7 @@ jobs:
   deploy:
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/checkout@v3
+      - uses: actions/checkout@v4
 
       - name: Build rust document
         # build document of lib only for now to avoid name collision.
@@ -19,7 +19,7 @@ jobs:
         run: mv ./target/doc ./docs/rust
 
       - name: Setup python
-        uses: actions/setup-python@v4
+        uses: actions/setup-python@v5
         with:
           python-version: '3.11'
       - name: Install dependencies
@@ -36,7 +36,7 @@ jobs:
         run: mv ./python/docs/build/html ./docs/python
 
       - name: Deploy
-        uses: peaceiris/actions-gh-pages@v3
+        uses: peaceiris/actions-gh-pages@v4
         with:
           github_token: ${{ secrets.GITHUB_TOKEN }}
           publish_dir: ./docs
diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml
index 292782b5..ae3dbbec 100644
--- a/.github/workflows/python.yml
+++ b/.github/workflows/python.yml
@@ -17,11 +17,11 @@ jobs:
     runs-on: ${{ matrix.os }}
 
     steps:
-      - uses: actions/checkout@v3
+      - uses: actions/checkout@v4
       - name: Download dictionary
         run: bash fetch_dictionary.sh "20220519" "core"
 
-      - uses: actions/cache@v3
+      - uses: actions/cache@v4
         with:
           path: |
             ~/.cargo/bin/
@@ -32,7 +32,7 @@ jobs:
           key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
 
       - name: Setup python
-        uses: actions/setup-python@v4
+        uses: actions/setup-python@v5
         with:
           python-version: '3.11'
       - name: Install dependencies
diff --git a/.github/workflows/rust-lint-fmt.yml b/.github/workflows/rust-lint-fmt.yml
index f4a368fb..dc314457 100644
--- a/.github/workflows/rust-lint-fmt.yml
+++ b/.github/workflows/rust-lint-fmt.yml
@@ -12,6 +12,6 @@ jobs:
     runs-on: ubuntu-latest
 
     steps:
-      - uses: actions/checkout@v3
+      - uses: actions/checkout@v4
       - name: Rustfmt
         run: cargo fmt -- --check --files-with-diff
\ No newline at end of file
diff --git a/.github/workflows/rust-noncached.yml b/.github/workflows/rust-noncached.yml
index e4ab91d6..bd7d354c 100644
--- a/.github/workflows/rust-noncached.yml
+++ b/.github/workflows/rust-noncached.yml
@@ -18,7 +18,7 @@ jobs:
     runs-on: ${{ matrix.os }}
 
     steps:
-      - uses: actions/checkout@v3
+      - uses: actions/checkout@v4
       - name: Download dictionary
         run: bash fetch_dictionary.sh "20220519" "core"
       - name: Run tests (Debug)
diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml
index 42cbc05e..aec5e80f 100644
--- a/.github/workflows/rust.yml
+++ b/.github/workflows/rust.yml
@@ -20,11 +20,11 @@ jobs:
     runs-on: ${{ matrix.os }}
 
     steps:
-    - uses: actions/checkout@v3
+    - uses: actions/checkout@v4
     - name: Download dictionary
       run: bash fetch_dictionary.sh "20220519" "core"
 
-    - uses: actions/cache@v3
+    - uses: actions/cache@v4
       with:
         path: |
           ~/.cargo/bin/


Test patch:
diff --git a/.github/workflows/python-upload-test.yml b/.github/workflows/python-upload-test.yml
index 7dfe24d5..30aad9b7 100644
--- a/.github/workflows/python-upload-test.yml
+++ b/.github/workflows/python-upload-test.yml
@@ -9,10 +9,10 @@ jobs:
     name: Build source distribution
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/checkout@v3
+      - uses: actions/checkout@v4
 
       - name: Setup python
-        uses: actions/setup-python@v4
+        uses: actions/setup-python@v5
         with:
           python-version: '3.11'
 
@@ -28,20 +28,21 @@ jobs:
         working-directory: ./python
         run: bash build-sdist.sh
 
-      - uses: actions/upload-artifact@v3
+      - uses: actions/upload-artifact@v4
         with:
+          name: artifact-sdist
           path: python/dist/*
 
   build-linux-wheels:
     name: Build Linux Python Wheels (+PGO)
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/checkout@v3
+      - uses: actions/checkout@v4
 
       - name: Download dictionary
         run: bash fetch_dictionary.sh "20220519" "core"
 
-      - uses: actions/cache@v3
+      - uses: actions/cache@v4
         with:
           path: |
             ~/.cargo/bin/
@@ -58,8 +59,9 @@ jobs:
         with:
           script: python/build-wheels-manylinux-pgo.sh
 
-      - uses: actions/upload-artifact@v3
+      - uses: actions/upload-artifact@v4
         with:
+          name: artifact-manylinux
           path: python/dist/*manylinux*
 
   build-non-linux-wheels:
@@ -68,16 +70,16 @@ jobs:
     strategy:
       matrix:
         os: [windows-latest, macOS-latest]
-        python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11", "3.12" ]
+        python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
 
     steps:
-      - uses: actions/checkout@v3
+      - uses: actions/checkout@v4
 
-      - uses: actions/setup-python@v4
+      - uses: actions/setup-python@v5
         with:
           python-version: ${{ matrix.python-version }}
 
-      - uses: actions/cache@v3
+      - uses: actions/cache@v4
         with:
           path: |
             ~/.cargo/bin/
@@ -106,18 +108,20 @@ jobs:
           ARCHFLAGS: -arch x86_64 -arch arm64
           MACOSX_DEPLOYMENT_TARGET: 10.12
 
-      - uses: actions/upload-artifact@v3
+      - uses: actions/upload-artifact@v4
         with:
+          name: artifact-${{ matrix.os }}-${{ matrix.python-version }}
           path: python/dist/*.whl
 
   upload-to-testpypi: # run only if all have succeeded
     needs: [ build-sdist, build-non-linux-wheels, build-linux-wheels ]
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/download-artifact@v3
+      - uses: actions/download-artifact@v4
         with:
-          name: artifact # default artifact name
+          pattern: artifact-*
           path: dist/
+          merge-multiple: true
 
       - name: List files to upload
         run: ls -R dist/
@@ -135,13 +139,13 @@ jobs:
     strategy:
       matrix:
         os: [ ubuntu-latest, windows-latest, macOS-latest ]
-        python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ]
+        python-version: [ "3.8", "3.9", "3.10", "3.11" ]
       fail-fast: false
     runs-on: ${{ matrix.os }}
 
     steps:
-      - uses: actions/checkout@v3
-      - uses: actions/setup-python@v4
+      - uses: actions/checkout@v4
+      - uses: actions/setup-python@v5
         with:
           python-version: ${{ matrix.python-version }}