Skip to content

Commit ec6d63a

Browse files
committed
Fixed: Artifact names with trailing hyphens when features not provided
- Added centralized artifact name generation step in action.yml - Compute feature suffix once: -features when provided, empty when not - Updated all artifact upload steps to use environment variables - Removed trailing hyphens from artifact download references in test workflows
1 parent 34b2dc8 commit ec6d63a

File tree

3 files changed

+31
-12
lines changed

3 files changed

+31
-12
lines changed

.github/workflows/test-symbols-bundled.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
- name: Download Main Binary Artifact
5151
uses: actions/download-artifact@v6
5252
with:
53-
name: prs-rs-cli-${{ matrix.target }}-
53+
name: prs-rs-cli-${{ matrix.target }}
5454
path: main-artifact
5555

5656
- name: Assert Main Artifact Contains Binary and Symbols (Bundled)
@@ -107,7 +107,7 @@ jobs:
107107
id: download-symbols
108108
continue-on-error: true
109109
with:
110-
name: prs-rs-cli-${{ matrix.target }}-.symbols
110+
name: prs-rs-cli-${{ matrix.target }}.symbols
111111
path: symbols-artifact
112112

113113
- name: Assert Symbols Artifact Does Not Exist
@@ -152,7 +152,7 @@ jobs:
152152
- name: Download Main Library Artifact
153153
uses: actions/download-artifact@v6
154154
with:
155-
name: C-Library-prs-rs-${{ matrix.target }}-
155+
name: C-Library-prs-rs-${{ matrix.target }}
156156
path: main-artifact
157157

158158
- name: Assert Main Artifact Contains Library and Symbols (Bundled)
@@ -217,7 +217,7 @@ jobs:
217217
id: download-symbols
218218
continue-on-error: true
219219
with:
220-
name: C-Library-prs-rs-${{ matrix.target }}-.symbols
220+
name: C-Library-prs-rs-${{ matrix.target }}.symbols
221221
path: symbols-artifact
222222

223223
- name: Assert Symbols Artifact Does Not Exist

.github/workflows/test-symbols-separate.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
- name: Download Main Binary Artifact
5050
uses: actions/download-artifact@v6
5151
with:
52-
name: prs-rs-cli-${{ matrix.target }}-
52+
name: prs-rs-cli-${{ matrix.target }}
5353
path: main-artifact
5454

5555
- name: Assert Main Artifact Has Binary But No Symbols
@@ -104,7 +104,7 @@ jobs:
104104
- name: Download Symbols Artifact
105105
uses: actions/download-artifact@v6
106106
with:
107-
name: prs-rs-cli-${{ matrix.target }}-.symbols
107+
name: prs-rs-cli-${{ matrix.target }}.symbols
108108
path: symbols-artifact
109109

110110
- name: Assert Symbols Artifact Has Symbols But No Binary
@@ -185,7 +185,7 @@ jobs:
185185
- name: Download Main Library Artifact
186186
uses: actions/download-artifact@v6
187187
with:
188-
name: C-Library-prs-rs-${{ matrix.target }}-
188+
name: C-Library-prs-rs-${{ matrix.target }}
189189
path: main-artifact
190190

191191
- name: Assert Main Artifact Has Library But No Symbols
@@ -246,7 +246,7 @@ jobs:
246246
- name: Download Symbols Artifact
247247
uses: actions/download-artifact@v6
248248
with:
249-
name: C-Library-prs-rs-${{ matrix.target }}-.symbols
249+
name: C-Library-prs-rs-${{ matrix.target }}.symbols
250250
path: symbols-artifact
251251

252252
- name: Assert Symbols Artifact Has Symbols But No Library

action.yml

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,25 @@ runs:
196196
mkdir -p "$ARTIFACT_OUT_DIR"
197197
echo "ARTIFACT_OUT_DIR=${ARTIFACT_OUT_DIR}" >> $GITHUB_ENV
198198
199+
- name: Generate artifact names
200+
shell: bash
201+
run: |
202+
# Generate feature suffix: -features if set, empty if not
203+
if [ -n "${{ inputs.features }}" ]; then
204+
FEATURE_SUFFIX="-${{ inputs.features }}"
205+
else
206+
FEATURE_SUFFIX=""
207+
fi
208+
209+
# Generate full artifact names
210+
BINARY_ARTIFACT_NAME="${{ inputs.crate-name }}-${{ inputs.target }}${FEATURE_SUFFIX}"
211+
LIBRARY_ARTIFACT_NAME="C-Library-${{ inputs.crate-name }}-${{ inputs.target }}${FEATURE_SUFFIX}"
212+
213+
echo "BINARY_ARTIFACT_NAME=${BINARY_ARTIFACT_NAME}" >> $GITHUB_ENV
214+
echo "BINARY_SYMBOLS_ARTIFACT_NAME=${BINARY_ARTIFACT_NAME}.symbols" >> $GITHUB_ENV
215+
echo "LIBRARY_ARTIFACT_NAME=${LIBRARY_ARTIFACT_NAME}" >> $GITHUB_ENV
216+
echo "LIBRARY_SYMBOLS_ARTIFACT_NAME=${LIBRARY_ARTIFACT_NAME}.symbols" >> $GITHUB_ENV
217+
199218
- name: Setup Rust Caching
200219
if: inputs.use-cache == 'true'
201220
uses: Swatinem/rust-cache@v2
@@ -411,7 +430,7 @@ runs:
411430
if: inputs.upload-artifacts == 'true' && inputs.build-library != 'true'
412431
uses: actions/upload-artifact@v5
413432
with:
414-
name: ${{ inputs.crate-name }}-${{ inputs.target }}-${{ inputs.features }}
433+
name: ${{ env.BINARY_ARTIFACT_NAME }}
415434
path: |
416435
${{ env.ARTIFACT_OUT_DIR }}
417436
!${{ env.ARTIFACT_OUT_DIR }}/*.d
@@ -425,7 +444,7 @@ runs:
425444
'true'
426445
uses: actions/upload-artifact@v5
427446
with:
428-
name: ${{ inputs.crate-name }}-${{ inputs.target }}-${{ inputs.features }}.symbols
447+
name: ${{ env.BINARY_SYMBOLS_ARTIFACT_NAME }}
429448
path: |
430449
${{ env.ARTIFACT_OUT_DIR }}/*.pdb
431450
${{ env.ARTIFACT_OUT_DIR }}/*.dwp
@@ -435,7 +454,7 @@ runs:
435454
if: inputs.upload-artifacts == 'true' && inputs.build-library == 'true'
436455
uses: actions/upload-artifact@v5
437456
with:
438-
name: C-Library-${{ inputs.crate-name }}-${{ inputs.target }}-${{ inputs.features }}
457+
name: ${{ env.LIBRARY_ARTIFACT_NAME }}
439458
path: |
440459
${{ env.ARTIFACT_OUT_DIR }}
441460
${{ inputs.upload-symbols-separately == 'true' && format('!{0}/*.pdb', env.ARTIFACT_OUT_DIR) || '' }}
@@ -448,7 +467,7 @@ runs:
448467
'true'
449468
uses: actions/upload-artifact@v5
450469
with:
451-
name: C-Library-${{ inputs.crate-name }}-${{ inputs.target }}-${{ inputs.features }}.symbols
470+
name: ${{ env.LIBRARY_SYMBOLS_ARTIFACT_NAME }}
452471
path: |
453472
${{ env.ARTIFACT_OUT_DIR }}/*.pdb
454473
${{ env.ARTIFACT_OUT_DIR }}/*.dwp

0 commit comments

Comments
 (0)