From 1d152a6fd04f4ecc7f97dfa6ee8fdb64b73ccf1b Mon Sep 17 00:00:00 2001 From: TianSizhe Date: Thu, 12 Sep 2024 17:02:04 +0200 Subject: [PATCH 1/2] update ci --- .github/workflows/ci.yml | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ac4ad8c..7e3d28d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,19 +56,31 @@ jobs: echo ${CCACHE_BASEDIR} 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 = "SofaMJEDFEM_${{ 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 + uses: actions/upload-artifact@v4.4.0 with: - name: SofaMJEDFEM_${{ 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: SofaMJEDFEM_${{ 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: name: Deploy artifacts if: always() && startsWith(github.ref, 'refs/heads/') # we are on a branch (not a PR) From cea6e476e1e23b955735d7f51e422cc6797173d2 Mon Sep 17 00:00:00 2001 From: TianSizhe Date: Fri, 13 Sep 2024 16:50:58 +0200 Subject: [PATCH 2/2] update ci --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7e3d28d..ec80e9f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -89,7 +89,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