@@ -48,10 +48,24 @@ outputs:
4848 packagesPath :
4949 description : ' Folder containing the generated packages'
5050 value : ${{ steps.pack.outputs.packagesPath }}
51+ packageNames :
52+ description : ' JSON array of generated package names, for use with fromJson() in subsequent matrix jobs'
53+ value : ${{ steps.step-summary.outputs.packageNames }}
5154
5255runs :
5356 using : " composite"
5457 steps :
58+ - id : sanitize-version
59+ name : Sanitize version
60+ shell : bash
61+ run : |
62+ # Remove leading 'v' if present in version (e.g., v1.0.0 -> 1.0.0)
63+ sanitizedVersion="${{ inputs.projectVersion }}"
64+ if [[ "$sanitizedVersion" == v* ]]; then
65+ sanitizedVersion="${sanitizedVersion:1}"
66+ fi
67+ echo "projectVersion=$sanitizedVersion" >> $GITHUB_OUTPUT
68+
5569 - id : set-urls
5670 name : Set URLs
5771 shell : bash
8397
8498 while IFS= read -r p; do
8599 echo "::group::uipcli output for packing project: $p"
86- uipcli package pack "$p" \
100+ if ! packResult=$( uipcli package pack "$p" \
87101 --output "$packages" \
88102 --libraryOrchestratorUrl "${{ inputs.orchestratorUrl }}" \
89103 --libraryOrchestratorTenant "${{ inputs.orchestratorTenant }}" \
@@ -93,22 +107,22 @@ runs:
93107 --libraryOrchestratorApplicationScope "${{ inputs.orchestratorApplicationScope }}" \
94108 --libraryOrchestratorFolder "${{ inputs.orchestratorFolder }}" \
95109 --releaseNotes "${{ inputs.releaseNotes }}" \
96- --version "${{ inputs .projectVersion }}" \
110+ --version "${{ steps.sanitize-version.outputs .projectVersion }}" \
97111 -l en-US \
98112 --repositoryUrl "${{ steps.set-urls.outputs.repoUrl }}" \
99113 --repositoryCommit "${{ github.sha }}" \
100114 --repositoryBranch "${{ github.head_ref || github.ref_name }}" \
101115 --repositoryType git \
102116 --projectUrl "${{ steps.set-urls.outputs.projectUrl }}" \
103117 --traceLevel "${{ inputs.traceLevel }}" \
104- --author "${{ inputs.author }}"
105-
106- echo "::endgroup::"
107-
108- if [ $? -ne 0 ]; then
118+ --author "${{ inputs.author }}" 2>&1); then
109119 echo "Pack Failed"
120+ echo "uipcli output: $packResult"
121+ echo "::endgroup::"
110122 exit 1
111123 fi
124+ echo "Pack Succeeded: $packResult"
125+ echo "::endgroup::"
112126 done <<< "$projectJsonFiles"
113127
114128 - id : step-summary
@@ -118,10 +132,25 @@ runs:
118132 run : |
119133 echo "### Generated packages: " >> $GITHUB_STEP_SUMMARY
120134
121- packages=$(find "${{ steps.pack.outputs.packagesPath }}" -type f -name "*.nupkg")
122- for package in $packages; do
123- echo ":package: $(basename "$package")" >> $GITHUB_STEP_SUMMARY
124- done
135+ packageNames=()
136+ while IFS= read -r -d '' package; do
137+ packageFileName=$(basename "$package")
138+ packageName="${packageFileName%.nupkg}"
139+ versionSuffix=".${{ steps.sanitize-version.outputs.projectVersion }}"
140+ if [[ "$packageName" == *"$versionSuffix" ]]; then
141+ packageName="${packageName%$versionSuffix}"
142+ fi
143+ packageNames+=("$packageName")
144+ echo "📦 $packageFileName" >> $GITHUB_STEP_SUMMARY
145+ done < <(find "${{ steps.pack.outputs.packagesPath }}" -type f -name "*.nupkg" -print0)
146+
147+ if [ ${#packageNames[@]} -gt 0 ]; then
148+ packageNamesJson=$(printf '%s\n' "${packageNames[@]}" | jq -R . | jq -s -c .)
149+ else
150+ packageNamesJson="[]"
151+ fi
152+
153+ echo "packageNames=$packageNamesJson" >> $GITHUB_OUTPUT
125154
126155
127156
0 commit comments