Skip to content

Commit 0f6cb1a

Browse files
authored
Merge pull request #11 from BOSSincrypto/devin/1780855870-fix-release-packaging
fix: proper packaging for macOS (.app bundle) and Linux (AppImage)
2 parents bdc7be0 + 6caee92 commit 0f6cb1a

11 files changed

Lines changed: 80 additions & 18 deletions

File tree

.github/workflows/release.yml

Lines changed: 79 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,10 @@ jobs:
1616
include:
1717
- os: windows-latest
1818
name: Windows
19-
ext: .exe
2019
- os: ubuntu-22.04
2120
name: Linux
22-
ext: ""
2321
- os: macos-latest
2422
name: macOS
25-
ext: ""
2623
runs-on: ${{ matrix.os }}
2724

2825
steps:
@@ -37,41 +34,105 @@ jobs:
3734
pip install -r requirements.txt
3835
pip install pyinstaller
3936
40-
- name: Build executable
37+
# ────────── Windows ──────────
38+
- name: Build Windows executable
39+
if: matrix.name == 'Windows'
4140
run: |
4241
pyinstaller --onefile --windowed \
42+
--icon=resources/icon.ico \
4343
--collect-data customtkinter \
4444
--collect-data magika \
4545
--name MarkItDown \
4646
run.py
4747
shell: bash
4848

49-
- name: Rename portable artifact
50-
run: |
51-
cd dist
52-
if [ "${{ matrix.ext }}" = ".exe" ]; then
53-
cp MarkItDown.exe MarkItDown-Windows-Portable.exe
54-
else
55-
mv MarkItDown MarkItDown-${{ matrix.name }}
56-
chmod +x MarkItDown-${{ matrix.name }}
57-
fi
58-
shell: bash
59-
6049
- name: Build Windows Installer
61-
if: matrix.os == 'windows-latest'
50+
if: matrix.name == 'Windows'
6251
env:
6352
APP_VERSION: ${{ github.ref_name }}
6453
run: iscc installer.iss
6554
shell: cmd
6655

56+
# ────────── macOS ──────────
57+
- name: Create macOS icon
58+
if: matrix.name == 'macOS'
59+
run: |
60+
mkdir -p resources/icon.iconset
61+
cp resources/icon_16.png resources/icon.iconset/icon_16x16.png
62+
cp resources/icon_32.png resources/icon.iconset/icon_16x16@2x.png
63+
cp resources/icon_32.png resources/icon.iconset/icon_32x32.png
64+
cp resources/icon_64.png resources/icon.iconset/icon_32x32@2x.png
65+
cp resources/icon_128.png resources/icon.iconset/icon_128x128.png
66+
cp resources/icon_256.png resources/icon.iconset/icon_128x128@2x.png
67+
cp resources/icon_256.png resources/icon.iconset/icon_256x256.png
68+
cp resources/icon_512.png resources/icon.iconset/icon_256x256@2x.png
69+
cp resources/icon_512.png resources/icon.iconset/icon_512x512.png
70+
cp resources/icon_1024.png resources/icon.iconset/icon_512x512@2x.png
71+
iconutil -c icns resources/icon.iconset -o resources/icon.icns
72+
73+
- name: Build macOS app bundle
74+
if: matrix.name == 'macOS'
75+
run: |
76+
pyinstaller --onedir --windowed \
77+
--icon=resources/icon.icns \
78+
--osx-bundle-identifier com.bossincrypto.markitdown \
79+
--collect-data customtkinter \
80+
--collect-data magika \
81+
--name MarkItDown \
82+
run.py
83+
cd dist
84+
zip -r -y MarkItDown-macOS.zip MarkItDown.app
85+
86+
# ────────── Linux ──────────
87+
- name: Build Linux executable
88+
if: matrix.name == 'Linux'
89+
run: |
90+
pyinstaller --onefile \
91+
--icon=resources/icon.png \
92+
--collect-data customtkinter \
93+
--collect-data magika \
94+
--name MarkItDown \
95+
run.py
96+
97+
- name: Package Linux AppImage
98+
if: matrix.name == 'Linux'
99+
run: |
100+
mkdir -p MarkItDown.AppDir/usr/bin
101+
cp dist/MarkItDown MarkItDown.AppDir/usr/bin/
102+
103+
cat > MarkItDown.AppDir/AppRun << 'EOF'
104+
#!/bin/bash
105+
SELF="$(readlink -f "$0")"
106+
HERE="${SELF%/*}"
107+
exec "${HERE}/usr/bin/MarkItDown" "$@"
108+
EOF
109+
chmod +x MarkItDown.AppDir/AppRun
110+
111+
cat > MarkItDown.AppDir/MarkItDown.desktop << 'EOF'
112+
[Desktop Entry]
113+
Name=MarkItDown
114+
Exec=MarkItDown
115+
Icon=markitdown
116+
Type=Application
117+
Categories=Utility;
118+
EOF
119+
120+
cp resources/icon.png MarkItDown.AppDir/markitdown.png
121+
122+
wget -q "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage" -O appimagetool
123+
chmod +x appimagetool
124+
./appimagetool --appimage-extract > /dev/null 2>&1
125+
ARCH=x86_64 ./squashfs-root/AppRun MarkItDown.AppDir dist/MarkItDown-Linux.AppImage
126+
127+
# ────────── Upload ──────────
67128
- name: Upload artifact
68129
uses: actions/upload-artifact@v4
69130
with:
70131
name: MarkItDown-${{ matrix.name }}
71132
path: |
72-
dist/MarkItDown-${{ matrix.name }}*
73-
dist/MarkItDown-Windows-Portable.exe
74133
dist/MarkItDown-Windows-Setup.exe
134+
dist/MarkItDown-macOS.zip
135+
dist/MarkItDown-Linux.AppImage
75136
76137
release:
77138
needs: build

installer.iss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ AppVersion={#GetEnv('APP_VERSION')}
44
AppPublisher=BOSSincrypto
55
DefaultDirName={autopf}\MarkItDown
66
DefaultGroupName=MarkItDown
7+
SetupIconFile=resources\icon.ico
78
UninstallDisplayIcon={app}\MarkItDown.exe
89
OutputDir=dist
910
OutputBaseFilename=MarkItDown-Windows-Setup

resources/icon.ico

17.8 KB
Binary file not shown.

resources/icon.png

6.39 KB
Loading

resources/icon_1024.png

43.2 KB
Loading

resources/icon_128.png

4.16 KB
Loading

resources/icon_16.png

635 Bytes
Loading

resources/icon_256.png

7.68 KB
Loading

resources/icon_32.png

1.19 KB
Loading

resources/icon_512.png

6.39 KB
Loading

0 commit comments

Comments
 (0)