Skip to content

Commit a767de8

Browse files
authored
Merge pull request #3 from doubleSlashde/feature/build-executables
Adaptions to build executables for Windows and macOS via GitHub Action
2 parents f670e20 + 79034e5 commit a767de8

File tree

5 files changed

+54
-20
lines changed

5 files changed

+54
-20
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ jobs:
2020
- name: Install dependencies
2121
run: |
2222
python -m pip install --upgrade pip
23-
pip install -r requirements.txt
24-
pip install -r requirements-dev.txt
23+
pip install -r requirements-build.txt
2524
2625
- name: Update version numbers
2726
shell: python
@@ -65,7 +64,7 @@ jobs:
6564
uses: actions/upload-artifact@v4
6665
with:
6766
name: p2d-windows
68-
path: dist/p2d.exe
67+
path: dist/p2d/p2d.exe
6968

7069
build-macos:
7170
runs-on: macos-latest
@@ -80,8 +79,7 @@ jobs:
8079
- name: Install dependencies
8180
run: |
8281
python -m pip install --upgrade pip
83-
pip install -r requirements.txt
84-
pip install -r requirements-dev.txt
82+
pip install -r requirements-build.txt
8583
8684
- name: Update version numbers
8785
shell: python

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,37 @@ stop
127127
- Regular expressions for parsing
128128
- XML libraries for Draw.io generation
129129

130+
## 📦 Executables
131+
132+
The project provides pre-built executables for both Windows and macOS through GitHub Actions. These executables are automatically built when:
133+
- A new version tag is pushed (e.g., `v1.0.0`)
134+
- The workflow is manually triggered via GitHub Actions UI
135+
136+
### Download Executables
137+
138+
1. Go to the [Releases](https://github.com/doubleSlashde/plantuml2drawio/releases) page to download the latest release
139+
2. Or download the latest build artifacts from the [Actions](https://github.com/doubleSlashde/plantuml2drawio/actions) page:
140+
- `p2d-windows` - Windows executable with all dependencies
141+
- `p2d-macos` - macOS application bundle (.app)
142+
143+
### Building Executables Locally
144+
145+
You can build the executables locally using PyInstaller. You only need the runtime dependencies and PyInstaller:
146+
147+
```bash
148+
# Install build requirements (includes runtime dependencies)
149+
pip install -r requirements-build.txt
150+
151+
# Build executable
152+
python -m PyInstaller --clean p2d.spec
153+
```
154+
155+
The built executables will be available in the `dist` directory:
156+
- Windows: `dist/p2d/p2d.exe` (with dependencies)
157+
- macOS: `dist/p2d.app` (application bundle)
158+
159+
Note: The final executable will include all necessary runtime dependencies, so end users don't need to install Python or any requirements.
160+
130161
## 🗺️ Roadmap
131162

132163
- [x] Support for activity diagrams

p2d.spec

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33

44
a = Analysis(
55
['src/plantuml2drawio/app.py'],
6-
pathex=[],
6+
pathex=['src'],
77
binaries=[],
88
datas=[],
9-
hiddenimports=[],
9+
hiddenimports=['plantuml2drawio'],
1010
hookspath=[],
1111
hooksconfig={},
1212
runtime_hooks=[],
@@ -19,16 +19,13 @@ pyz = PYZ(a.pure)
1919
exe = EXE(
2020
pyz,
2121
a.scripts,
22-
a.binaries,
23-
a.datas,
2422
[],
23+
exclude_binaries=True,
2524
name='p2d',
2625
debug=False,
2726
bootloader_ignore_signals=False,
2827
strip=False,
2928
upx=True,
30-
upx_exclude=[],
31-
runtime_tmpdir=None,
3229
console=False,
3330
disable_windowed_traceback=False,
3431
argv_emulation=False,
@@ -37,8 +34,20 @@ exe = EXE(
3734
entitlements_file=None,
3835
icon=['resources/icons/p2d_icon.icns'],
3936
)
40-
app = BUNDLE(
37+
38+
coll = COLLECT(
4139
exe,
40+
a.binaries,
41+
a.zipfiles,
42+
a.datas,
43+
strip=False,
44+
upx=True,
45+
upx_exclude=[],
46+
name='p2d'
47+
)
48+
49+
app = BUNDLE(
50+
coll,
4251
name='p2d.app',
4352
icon='resources/icons/p2d_icon.icns',
4453
bundle_identifier=None,

requirements-build.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-r requirements.txt
2+
3+
# Building
4+
pyinstaller>=6.4.0

requirements-dev.txt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,3 @@ pre-commit>=3.6.2
1717
# Documentation
1818
sphinx>=7.2.6
1919
sphinx-rtd-theme>=2.0.0
20-
21-
from plantuml2drawio.logging_config import setup_logging
22-
23-
setup_logging(
24-
log_level="DEBUG",
25-
log_file="app.log",
26-
log_format="%(asctime)s - %(levelname)s - %(message)s"
27-
)

0 commit comments

Comments
 (0)