Skip to content

Commit 738272e

Browse files
committed
fix macos compress artifcat
1 parent 79984a5 commit 738272e

2 files changed

Lines changed: 12 additions & 19 deletions

File tree

.github/workflows/build-macos.yml

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,11 @@ jobs:
123123
source .venv-macos/bin/activate
124124
python scripts/standalone/build.py --platform macos
125125
126-
- name: Upload app as a workflow artifact
126+
- name: Upload zip as a workflow artifact
127127
uses: actions/upload-artifact@v4
128128
with:
129129
name: AudioMuse-AI-${{ env.ARCH }}-macos
130-
path: dist/_pkg/
130+
path: dist/AudioMuse-AI-${{ env.ARCH }}-macos.zip
131131
if-no-files-found: error
132132

133133
# NB: the PR-description "test build links" block is no longer written
@@ -143,27 +143,14 @@ jobs:
143143
permissions:
144144
contents: write
145145
steps:
146-
- name: Download built packages
146+
- name: Download built zip
147147
uses: actions/download-artifact@v4
148148
with:
149149
path: artifacts
150150
merge-multiple: true
151151

152-
- name: Create zip for release
153-
run: |
154-
python -c "
155-
import zipfile, pathlib
156-
src = pathlib.Path('artifacts/_pkg')
157-
out = 'AudioMuse-AI-arm64-macos.zip'
158-
with zipfile.ZipFile(out, 'w', zipfile.ZIP_DEFLATED, allowZip64=True) as zf:
159-
for f in sorted(src.rglob('*')):
160-
if f.is_file():
161-
zf.write(f, f.relative_to(src).as_posix())
162-
print(f'Created {out}')
163-
"
164-
165152
- name: Attach zip to the release
166153
uses: softprops/action-gh-release@v2
167154
with:
168-
files: AudioMuse-AI-*.zip
155+
files: artifacts/AudioMuse-AI-*.zip
169156
fail_on_unmatched_files: true

scripts/standalone/platforms/macos.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,11 @@ def package(ctx):
5555
if subprocess.run(["cp", "-cR", str(app), str(staged_app)], stderr=subprocess.DEVNULL).returncode != 0:
5656
subprocess.run(["ditto", str(app), str(staged_app)], check=True)
5757
(stage / "readme.md").write_text(_README)
58-
print(f"==> Staged: {stage} (AudioMuse-AI.app + readme.md)")
59-
return [stage]
58+
59+
out = ctx.dist_dir / f"AudioMuse-AI-{ctx.arch}-macos.zip"
60+
if out.exists():
61+
out.unlink()
62+
subprocess.run(["ditto", "-c", "-k", str(stage), str(out)], check=True)
63+
subprocess.run(["rm", "-rf", str(stage)], check=True)
64+
print(f"==> Done: {out} (expands to AudioMuse-AI.app + readme.md)")
65+
return [out]

0 commit comments

Comments
 (0)