Skip to content

Commit c3b9e1d

Browse files
authored
Merge pull request #5 from antennae/update_ci
update ci
2 parents b67b9b2 + cea6e47 commit c3b9e1d

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,19 +56,31 @@ jobs:
5656
echo ${CCACHE_BASEDIR}
5757
ccache -s
5858
fi
59+
60+
- name: Sanitize artifact name
61+
id: sanitize
62+
# This step removes special characters from the artifact name to ensure compatibility with upload-artifact
63+
# Characters removed: " : < > | * ? \r \n \ /
64+
# Spaces are replaced with underscores
65+
# This sanitization prevents errors in artifact creation and retrieval
66+
shell: pwsh
67+
run: |
68+
$originalName = "SofaMJEDFEM_${{ steps.sofa.outputs.run_branch }}_for-SOFA-${{ steps.sofa.outputs.sofa_version }}_${{ runner.os }}"
69+
$artifact_name = $originalName -replace '[":;<>|*?\r\n\\/]', '' -replace ' ', '_'
70+
echo "artifact_name=$artifact_name" >> $env:GITHUB_OUTPUT
71+
5972
- name: Create artifact
60-
uses: actions/upload-artifact@v2
73+
uses: actions/upload-artifact@v4.4.0
6174
with:
62-
name: SofaMJEDFEM_${{ steps.sofa.outputs.run_branch }}_for-SOFA-${{ steps.sofa.outputs.sofa_version }}_${{ runner.os }}
75+
name: ${{ steps.sanitize.outputs.artifact_name }}
6376
path: ${{ env.WORKSPACE_INSTALL_PATH }}
6477

6578
- name: Install artifact
66-
uses: actions/download-artifact@v2
79+
uses: actions/download-artifact@v4.1.7
6780
with:
68-
name: SofaMJEDFEM_${{ steps.sofa.outputs.run_branch }}_for-SOFA-${{ steps.sofa.outputs.sofa_version }}_${{ runner.os }}
81+
name: ${{ steps.sanitize.outputs.artifact_name }}
6982
path: ${{ env.WORKSPACE_ARTIFACT_PATH }}
7083

71-
7284
deploy:
7385
name: Deploy artifacts
7486
if: always() && startsWith(github.ref, 'refs/heads/') # we are on a branch (not a PR)
@@ -77,7 +89,7 @@ jobs:
7789
continue-on-error: true
7890
steps:
7991
- name: Get artifacts
80-
uses: actions/download-artifact@v2
92+
uses: actions/download-artifact@v4.1.7
8193
with:
8294
path: artifacts
8395

0 commit comments

Comments
 (0)