Skip to content

Commit 714042f

Browse files
committed
update workflow fix macos platform bug
Signed-off-by: samzong <[email protected]>
1 parent 373ef25 commit 714042f

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

.github/workflows/build.yml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,13 @@ jobs:
2222
build-macos:
2323
runs-on: ${{ matrix.os }}
2424
strategy:
25+
fail-fast: false
2526
matrix:
26-
os: [macos-latest, macos-14] # macos-latest for Intel, macos-14 for Apple Silicon
27+
include:
28+
- os: macos-latest
29+
arch: x86_64
30+
- os: macos-14
31+
arch: arm64
2732
python-version: ['3.10']
2833

2934
steps:
@@ -61,13 +66,13 @@ jobs:
6166
echo ' "Applications": (500, 120)' >> settings.py
6267
echo '}' >> settings.py
6368
64-
dmgbuild -s settings.py "HF Model Downloader" "hf-model-downloader-${{ runner.arch }}.dmg"
69+
dmgbuild -s settings.py "HF Model Downloader" "hf-model-downloader-${{ matrix.arch }}.dmg"
6570
done
6671
6772
- name: Upload artifact
6873
uses: actions/upload-artifact@v4
6974
with:
70-
name: hf-model-downloader-macos-${{ matrix.os }}-${{ runner.arch }}
75+
name: hf-model-downloader-macos-${{ matrix.os }}-${{ matrix.arch }}
7176
path: |
7277
dist/*.dmg
7378
if-no-files-found: error
@@ -100,7 +105,7 @@ jobs:
100105
- name: Upload artifact
101106
uses: actions/upload-artifact@v4
102107
with:
103-
name: huggingface-model-downloader-windows-x64
108+
name: hf-model-downloader-windows-x64
104109
path: dist/*.exe
105110
if-no-files-found: error
106111

@@ -127,6 +132,12 @@ jobs:
127132
uses: actions/download-artifact@v4
128133
with:
129134
path: dist
135+
136+
- name: Flatten directory structure
137+
run: |
138+
cd dist
139+
find . -type f -name "*.dmg" -o -name "*.exe" -exec mv {} . \;
140+
rm -rf */
130141
131142
- name: List downloaded artifacts
132143
run: ls -R dist/
@@ -137,8 +148,8 @@ jobs:
137148
echo "" >> release_notes.md
138149
echo "## Downloads" >> release_notes.md
139150
echo "- Windows (x64)" >> release_notes.md
140-
echo "- macOS Intel (x64) - Built on macos-latest" >> release_notes.md
141-
echo "- macOS Apple Silicon (arm64) - Built on macos-14" >> release_notes.md
151+
echo "- macOS Intel (x86_64)" >> release_notes.md
152+
echo "- macOS Apple Silicon (arm64)" >> release_notes.md
142153
echo "" >> release_notes.md
143154
echo "## Changes" >> release_notes.md
144155
echo "- Latest build from ${{ github.sha }}" >> release_notes.md
@@ -152,8 +163,6 @@ jobs:
152163
body_path: release_notes.md
153164
draft: false
154165
prerelease: ${{ !startsWith(github.ref, 'refs/tags/v') }}
155-
files: |
156-
dist/**/*.dmg
157-
dist/**/*.exe
166+
files: dist/*
158167
env:
159168
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)