Skip to content

Commit 3da0520

Browse files
committed
Fix Unity integration
1 parent a56e781 commit 3da0520

1 file changed

Lines changed: 21 additions & 2 deletions

File tree

.github/workflows/BitMono.Build.yaml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,8 @@ jobs:
190190
run: |
191191
set -e
192192
VERSION_NO_HASH='${{ needs.Build.outputs.version }}'
193+
# Strip any SemVer build metadata (e.g., +<commit-hash>) for filenames
194+
VERSION_NO_HASH="${VERSION_NO_HASH%%+*}"
193195
UNITY_VER='${{ matrix.unity-version }}'
194196
FILE="BitMono-Unity-v${VERSION_NO_HASH}-Unity${UNITY_VER}.unitypackage"
195197
@@ -204,6 +206,23 @@ jobs:
204206
size_mb=$(awk "BEGIN {printf \"%.2f\", $(stat -c%s \"$FILE\")/1024/1024}")
205207
echo "File size: ${size_mb} MB"
206208
209+
- name: Rename .unitypackage to include build metadata (if present)
210+
run: |
211+
VERSION_FULL='${{ needs.Build.outputs.version }}'
212+
UNITY_VER='${{ matrix.unity-version }}'
213+
BASE="BitMono-Unity-v${VERSION_FULL%%+*}-Unity${UNITY_VER}.unitypackage"
214+
if [[ "$VERSION_FULL" == *+* ]]; then
215+
TARGET="BitMono-Unity-v${VERSION_FULL}-Unity${UNITY_VER}.unitypackage"
216+
if [ -f "$BASE" ]; then
217+
echo "Renaming $BASE -> $TARGET"
218+
mv -f "$BASE" "$TARGET"
219+
else
220+
echo "Expected base package not found for rename: $BASE" >&2
221+
fi
222+
else
223+
echo "No build metadata in version; keeping filename: $BASE"
224+
fi
225+
207226
- name: Create Unity Package Directory
208227
run: |
209228
mkdir -p unity-package-temp/Editor
@@ -265,8 +284,8 @@ jobs:
265284
with:
266285
name: BitMono-Unity-v${{ needs.Build.outputs.version }}-Unity${{ matrix.unity-version }}
267286
path: |
268-
BitMono-Unity-v${{ needs.Build.outputs.version }}-Unity${{ matrix.unity-version }}.unitypackage
269-
BitMono-Unity-UPM-v${{ needs.Build.outputs.version }}-Unity${{ matrix.unity-version }}.tgz
287+
BitMono-Unity-v*-Unity${{ matrix.unity-version }}.unitypackage
288+
BitMono-Unity-UPM-v*-Unity${{ matrix.unity-version }}.tgz
270289
if-no-files-found: error
271290

272291
Release:

0 commit comments

Comments
 (0)