Skip to content

Commit 0d6ccaf

Browse files
Update main.yml
1 parent 0210053 commit 0d6ccaf

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

.github/workflows/main.yml

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,22 @@ jobs:
3838
- name: Build Mac Package
3939
run: |
4040
quasar build -m electron -T mas -A arm64
41-
cd dist/electron/Packaged
42-
ls -alh
43-
zip -r Mac-Apple-Chip-arm64.zip Flypen-mas-arm64
41+
cd dist/electron/Packaged/Flypen-mas-arm64
42+
app_path="dist/electron/Packaged/Flypen-mas-arm64/Flypen.app"
43+
app_name="$(basename "$app_path" | sed -r "s/\.app$//g")"
44+
dmg_size="$(du -ms "$app_path" | grep -oP "^\d+")"
45+
dmg_path=$(sed -r "s/\.app\/?$/.dmg/g" <<< "$app_path")
46+
set -x
47+
dd if=/dev/zero "of=$dmg_path" bs=1M "count=$dmg_size"
48+
label=$(sed -r "s/\s/_/g" <<< "$app_name")
49+
label=$(sed -r "s/^(.{,27}).*$/\1/g" <<< "$label")
50+
hformat -l "$label" "$dmg_path"
51+
mount_point="$(mktemp -d)"
52+
mount -t hfs -o loop "$dmg_path" "$mount_point"
53+
cp -R "$app_path" "$mount_point"
54+
ls -l "$mount_point"
55+
umount "$mount_point"
56+
du -h "$dmg_path"
4457
cd -
4558
4659
- name: Upload Mac
@@ -49,9 +62,9 @@ jobs:
4962
GITHUB_TOKEN: ${{ secrets.AAA }}
5063
with:
5164
upload_url: ${{ steps.create_release.outputs.upload_url }}
52-
asset_path: ./dist/electron/Packaged/Mac-Apple-Chip-arm64.zip
53-
asset_name: Mac-Apple-Chip-arm64.zip
54-
asset_content_type: application/zip
65+
asset_path: dist/electron/Packaged/Flypen-mas-arm64/Flypen.dmg
66+
asset_name: flypen-mac-apple-chip.dmg
67+
asset_content_type: application/octet-stream
5568

5669
- name: Build Linux Package
5770
run: |

0 commit comments

Comments
 (0)