From fc89d076e862e65d56a9693d7a3811fc1efaaf48 Mon Sep 17 00:00:00 2001 From: Tian Sizhe Date: Tue, 19 Nov 2024 08:56:26 +0100 Subject: [PATCH] Update versions of actions/download-artifact and actions/upload-artifact (#5) * Update versions of actions/download-artifact and actions/upload-artifact * Update versions of actions/download-artifact and actions/upload-artifact * update artifact name * update download-artifact version --- .github/workflows/ci.yml | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cf56ef6..7465f11 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,17 +58,28 @@ jobs: ccache -s fi - + - name: Sanitize artifact name + id: sanitize + # This step removes special characters from the artifact name to ensure compatibility with upload-artifact + # Characters removed: " : < > | * ? \r \n \ / + # Spaces are replaced with underscores + # This sanitization prevents errors in artifact creation and retrieval + shell: pwsh + run: | + $originalName = "Shell_${{ steps.sofa.outputs.run_branch }}_for-SOFA-${{ steps.sofa.outputs.sofa_version }}_${{ runner.os }}" + $artifact_name = $originalName -replace '[":;<>|*?\r\n\\/]', '' -replace ' ', '_' + echo "artifact_name=$artifact_name" >> $env:GITHUB_OUTPUT + - name: Create artifact - uses: actions/upload-artifact@v2.2.4 + uses: actions/upload-artifact@v4.4.0 with: - name: Shell_${{ steps.sofa.outputs.run_branch }}_for-SOFA-${{ steps.sofa.outputs.sofa_version }}_${{ runner.os }} + name: ${{ steps.sanitize.outputs.artifact_name }} path: ${{ env.WORKSPACE_INSTALL_PATH }} - name: Install artifact - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4.1.7 with: - name: Shell_${{ steps.sofa.outputs.run_branch }}_for-SOFA-${{ steps.sofa.outputs.sofa_version }}_${{ runner.os }} + name: ${{ steps.sanitize.outputs.artifact_name }} path: ${{ env.WORKSPACE_ARTIFACT_PATH }} deploy: @@ -79,7 +90,7 @@ jobs: continue-on-error: true steps: - name: Get artifacts - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4.1.7 with: path: artifacts