Skip to content

Commit 8b78688

Browse files
committed
fix(release): stop the macOS .app archives from colliding
Both macOS targets produce a bundle named "BootAnimix Studio.app", so packing it to "BootAnimix Studio.app.tar.gz" gave two artifacts the same name. The release job merged the artifacts into one directory, and the x86_64 archive silently overwrote the arm64 one: the v3.0.0 release only shipped the arm64 .app. - Name the packed .app after the target triple so the two macOS archives are distinct. - Stop merging the artifacts blindly. Download them into per-artifact subdirectories, fail the job if two artifacts produce the same asset name, and only then flatten them for upload. A collision should stop the release instead of dropping an installer.
1 parent 4a0cba0 commit 8b78688

1 file changed

Lines changed: 28 additions & 4 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,14 @@ jobs:
199199
\( -name '*.exe' -o -name '*.msi' -o -name '*.dmg' -o -name '*.deb' \
200200
-o -name '*.rpm' -o -name '*.AppImage' \) \
201201
-exec cp {} "${stage}/" \;
202+
# The .app bundle is named "BootAnimix Studio.app" on every macOS
203+
# target, so the tarball has to carry the target triple or the
204+
# arm64 and x86_64 archives would collide when the release job
205+
# merges the artifacts.
202206
for app in "${bundle_dir}"/macos/*.app; do
203207
[ -d "${app}" ] || continue
204-
tar -czf "${stage}/$(basename "${app}").tar.gz" -C "$(dirname "${app}")" "$(basename "${app}")"
208+
tar -czf "${stage}/BootAnimix-Studio-${{ matrix.target }}.app.tar.gz" \
209+
-C "$(dirname "${app}")" "$(basename "${app}")"
205210
done
206211
ls -l "${stage}"
207212
test -n "$(ls -A "${stage}")"
@@ -226,11 +231,30 @@ jobs:
226231
uses: actions/download-artifact@v4
227232
with:
228233
path: dist
229-
merge-multiple: true
234+
# Keep the per-artifact subdirectories so that a filename collision
235+
# between two targets is detected below, rather than one artifact
236+
# silently overwriting the other.
237+
merge-multiple: false
238+
239+
- name: Flatten artifacts and check for duplicate names
240+
shell: bash
241+
run: |
242+
set -euo pipefail
243+
find dist -type f -printf '%f\n' | sort | uniq -d > duplicate_names.txt || true
244+
if [ -s duplicate_names.txt ]; then
245+
echo "::error::Two build artifacts produced the same asset name:"
246+
cat duplicate_names.txt
247+
exit 1
248+
fi
249+
mkdir -p flat
250+
find dist -type f -exec cp {} flat/ \;
251+
ls -l flat
252+
230253
- name: Show published files
231-
run: ls -lR dist
254+
run: ls -lR flat
255+
232256
- name: Create GitHub Release with binaries
233257
uses: softprops/action-gh-release@v2
234258
with:
235259
generate_release_notes: true
236-
files: dist/**
260+
files: flat/**

0 commit comments

Comments
 (0)