Skip to content

Commit b3c3bbd

Browse files
committed
Fix GitHub Actions build workflow
- Use CLI arguments instead of spec file in build.py - Add version env variable for consistent release naming - Use Pillow to create .ico on Windows - Fix heredoc formatting in .deb creation - Update README with all v1.1.0 features
1 parent f3cf043 commit b3c3bbd

3 files changed

Lines changed: 138 additions & 61 deletions

File tree

.github/workflows/build.yml

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
pull_request:
88
branches: [main]
99

10+
env:
11+
APP_VERSION: "1.1.0"
12+
1013
jobs:
1114
build-linux:
1215
runs-on: ubuntu-latest
@@ -43,9 +46,9 @@ jobs:
4346
mkdir -p merisio-deb/usr/share/applications
4447
mkdir -p merisio-deb/usr/share/icons/hicolor/256x256/apps
4548
46-
cat > merisio-deb/DEBIAN/control << 'EOF'
49+
cat > merisio-deb/DEBIAN/control << EOF
4750
Package: merisio
48-
Version: 1.1.0
51+
Version: ${{ env.APP_VERSION }}
4952
Section: database
5053
Priority: optional
5154
Architecture: amd64
@@ -57,11 +60,14 @@ jobs:
5760
Homepage: https://github.com/AchrafSoltani/Merisio
5861
EOF
5962
63+
# Remove leading spaces from control file
64+
sed -i 's/^ //' merisio-deb/DEBIAN/control
65+
6066
cp dist/Merisio merisio-deb/usr/bin/merisio
6167
chmod 755 merisio-deb/usr/bin/merisio
6268
cp resources/icons/app_icon.png merisio-deb/usr/share/icons/hicolor/256x256/apps/merisio.png
6369
64-
cat > merisio-deb/usr/share/applications/merisio.desktop << 'EOF'
70+
cat > merisio-deb/usr/share/applications/merisio.desktop << EOF
6571
[Desktop Entry]
6672
Name=Merisio
6773
Comment=MERISE Database Modeling Tool
@@ -73,15 +79,18 @@ jobs:
7379
Keywords=database;modeling;merise;mcd;sql;
7480
EOF
7581
76-
dpkg-deb --build merisio-deb merisio_1.1.0_amd64.deb
82+
# Remove leading spaces from desktop file
83+
sed -i 's/^ //' merisio-deb/usr/share/applications/merisio.desktop
84+
85+
dpkg-deb --build merisio-deb merisio_${{ env.APP_VERSION }}_amd64.deb
7786
7887
- name: Upload Linux artifacts
7988
uses: actions/upload-artifact@v4
8089
with:
8190
name: merisio-linux
8291
path: |
8392
Merisio-linux-x64.tar.gz
84-
merisio_1.1.0_amd64.deb
93+
merisio_${{ env.APP_VERSION }}_amd64.deb
8594
8695
build-windows:
8796
runs-on: windows-latest
@@ -94,7 +103,11 @@ jobs:
94103
python-version: '3.11'
95104

96105
- name: Install dependencies
97-
run: pip install -r requirements.txt pyinstaller
106+
run: pip install -r requirements.txt pyinstaller pillow
107+
108+
- name: Create .ico file
109+
run: |
110+
python -c "from PIL import Image; img = Image.open('resources/icons/app_icon.png'); img.save('resources/icons/app_icon.ico', format='ICO', sizes=[(256,256), (128,128), (64,64), (48,48), (32,32), (16,16)])"
98111
99112
- name: Build executable
100113
run: python build.py build
@@ -134,6 +147,6 @@ jobs:
134147
with:
135148
files: |
136149
Merisio-linux-x64.tar.gz
137-
merisio_1.1.0_amd64.deb
150+
merisio_${{ env.APP_VERSION }}_amd64.deb
138151
Merisio-windows-x64.zip
139152
generate_release_notes: true

README.md

Lines changed: 88 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,25 @@
22

33
A modern MERISE database modeling tool built with Python and PySide6.
44

5+
![Version](https://img.shields.io/badge/version-1.1.0-blue)
6+
![License](https://img.shields.io/badge/license-GPL%20v2-green)
7+
![Python](https://img.shields.io/badge/python-3.11+-yellow)
8+
59
## Features
610

711
- **MCD Editor** - Visual diagram editor for entities, associations, and links
12+
- Drag-and-drop positioning
13+
- Multi-selection and deletion
14+
- Cardinalities: (0,1), (0,N), (1,1), (1,N)
15+
- Link styles: Curved, Orthogonal, Straight
16+
- Toggle attribute visibility
817
- **Data Dictionary** - Overview of all attributes across entities
918
- **MLD View** - Logical Data Model with table/column tree view
19+
- Editable column names (right-click or double-click to rename)
20+
- Custom names saved in project and used in SQL generation
1021
- **SQL Generation** - PostgreSQL CREATE TABLE statements
11-
- **Project Management** - Save/load projects (.merisio format)
22+
- **Project Management** - Save/load projects in `.merisio` JSON format
23+
- **Options Menu** - Show/hide attributes, link style selection
1224

1325
## Screenshots
1426

@@ -21,6 +33,31 @@ A modern MERISE database modeling tool built with Python and PySide6.
2133

2234
## Installation
2335

36+
### Pre-built Binaries
37+
38+
Download the latest release from the [Releases](https://github.com/AchrafSoltani/Merisio/releases) page.
39+
40+
**Linux:**
41+
- `Merisio-x.x.x-linux-x64.tar.gz` - Portable archive
42+
- `merisio_x.x.x_amd64.deb` - Debian/Ubuntu package
43+
44+
**Windows:**
45+
- `Merisio-x.x.x-windows-x64.zip` - Portable archive
46+
47+
#### Linux Installation
48+
49+
**From .deb package (Debian/Ubuntu):**
50+
```bash
51+
sudo dpkg -i merisio_1.1.0_amd64.deb
52+
```
53+
54+
**From archive:**
55+
```bash
56+
tar -xzvf Merisio-1.1.0-linux-x64.tar.gz
57+
cd Merisio-1.1.0-linux-x64
58+
./Merisio
59+
```
60+
2461
### From Source
2562

2663
```bash
@@ -40,10 +77,6 @@ pip install -r requirements.txt
4077
python main.py
4178
```
4279

43-
### Pre-built Binaries
44-
45-
Download the latest release from the [Releases](https://github.com/AchrafSoltani/Merisio/releases) page.
46-
4780
## Building from Source
4881

4982
### Prerequisites
@@ -84,37 +117,12 @@ python build.py build
84117
python build.py clean
85118
```
86119

87-
## Distribution
88-
89-
### Linux
90-
91-
```bash
92-
# Create a tarball with all necessary files
93-
mkdir -p Merisio-linux
94-
cp dist/Merisio Merisio-linux/
95-
cp resources/icons/app_icon.svg Merisio-linux/
96-
cp merisio.desktop Merisio-linux/
97-
tar -czvf Merisio-1.0.0-linux-x64.tar.gz Merisio-linux
98-
```
99-
100-
Users can then:
101-
1. Extract the archive
102-
2. Run `./Merisio`
103-
3. Optionally install the .desktop file for system integration
104-
105-
### Windows
106-
107-
```bash
108-
# Create a ZIP archive
109-
# Or use NSIS/Inno Setup for an installer
110-
```
111-
112120
## Usage
113121

114-
1. **Create Entities** - Click "Add Entity" in the MCD tab, define name and attributes
115-
2. **Create Associations** - Click "Add Association" to define relationships
116-
3. **Link Them** - Click "Add Link" to connect entities to associations with cardinalities
117-
4. **View MLD** - Switch to MLD tab to see the logical model
122+
1. **Create Entities** - Right-click on the MCD canvas or use the toolbar to add entities
123+
2. **Create Associations** - Add associations to define relationships between entities
124+
3. **Link Them** - Connect entities to associations with cardinalities
125+
4. **View MLD** - Switch to MLD tab to see the logical model (double-click columns to rename)
118126
5. **Generate SQL** - Switch to SQL tab to see PostgreSQL DDL statements
119127
6. **Save Project** - File > Save to save your work
120128

@@ -132,23 +140,56 @@ Users can then:
132140
| Delete | Delete Selected |
133141
| Ctrl+Scroll | Zoom In/Out |
134142

143+
### Options Menu
144+
145+
| Option | Description |
146+
|--------|-------------|
147+
| Show Attributes | Toggle attribute visibility in MCD entities/associations |
148+
| Link Style > Curved | Bezier curve links (default) |
149+
| Link Style > Orthogonal | Right-angle links |
150+
| Link Style > Straight | Direct line links |
151+
135152
## Project Structure
136153

137154
```
138-
AnalyseSI/
155+
Merisio/
139156
├── main.py # Application entry point
140-
├── build.py # Build script
141-
├── analysesi.spec # PyInstaller configuration
157+
├── build.py # Build script for PyInstaller
158+
├── merisio.spec # PyInstaller configuration
159+
├── merisio.desktop # Linux desktop integration
142160
├── requirements.txt # Python dependencies
143161
├── resources/
144162
│ └── icons/
145-
│ └── app_icon.svg # Application icon
163+
│ ├── app_icon.svg # Vector icon
164+
│ └── app_icon.png # PNG icon (256x256)
146165
├── src/
147-
│ ├── models/ # Data models
148-
│ ├── views/ # UI components
149-
│ ├── controllers/ # Business logic
150-
│ └── utils/ # Utilities and constants
151-
└── tests/ # Unit tests
166+
│ ├── models/ # Data models (Entity, Association, Link, Project)
167+
│ ├── views/ # UI components (Canvas, Dialogs, Views)
168+
│ ├── controllers/ # Business logic (MLD transformer, SQL generator)
169+
│ └── utils/ # Utilities, constants, theme
170+
├── tests/ # Unit tests
171+
└── .github/
172+
└── workflows/
173+
└── build.yml # GitHub Actions CI/CD
174+
```
175+
176+
## File Format
177+
178+
Merisio uses a JSON-based project format with the `.merisio` extension:
179+
180+
```json
181+
{
182+
"version": "1.0",
183+
"dictionary": { "attributes": [...] },
184+
"mcd": {
185+
"entities": [...],
186+
"associations": [...],
187+
"links": [...]
188+
},
189+
"mld": {
190+
"column_overrides": { "TABLE.original_col": "renamed_col" }
191+
}
192+
}
152193
```
153194

154195
## License
@@ -157,8 +198,10 @@ GNU GPL v2
157198

158199
## Author
159200

160-
Achraf SOLTANI
201+
**Achraf SOLTANI**
202+
Email: achraf.soltani@pm.me
203+
GitHub: [@AchrafSoltani](https://github.com/AchrafSoltani)
161204

162205
## Acknowledgments
163206

164-
Based on the original [AnalyseSI](https://launchpad.net/analysesi) Java project.
207+
Inspired by the original [AnalyseSI](https://launchpad.net/analysesi) Java project.

build.py

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python3
2-
"""Build script for AnalyseSI Modern."""
2+
"""Build script for Merisio."""
33

44
import os
55
import sys
@@ -39,14 +39,36 @@ def build():
3939
print("PyInstaller not found. Installing...")
4040
subprocess.run([sys.executable, '-m', 'pip', 'install', 'pyinstaller'])
4141

42-
# Build command
42+
# Determine icon path
43+
if system == 'windows':
44+
icon_path = 'resources/icons/app_icon.ico'
45+
if not os.path.exists(icon_path):
46+
icon_path = 'resources/icons/app_icon.png'
47+
else:
48+
icon_path = 'resources/icons/app_icon.png'
49+
50+
# Build command using CLI arguments (no spec file needed)
4351
cmd = [
4452
sys.executable, '-m', 'PyInstaller',
4553
'--clean',
4654
'--noconfirm',
47-
'merisio.spec'
55+
'--onefile',
56+
'--windowed',
57+
'--name', APP_NAME,
58+
'--add-data', f'resources/icons/app_icon.svg{os.pathsep}resources/icons',
59+
'--add-data', f'resources/icons/app_icon.png{os.pathsep}resources/icons',
60+
'--hidden-import', 'PySide6.QtCore',
61+
'--hidden-import', 'PySide6.QtGui',
62+
'--hidden-import', 'PySide6.QtWidgets',
4863
]
4964

65+
# Add icon if exists
66+
if os.path.exists(icon_path):
67+
cmd.extend(['--icon', icon_path])
68+
69+
# Add main entry point
70+
cmd.append('main.py')
71+
5072
print(f"Running: {' '.join(cmd)}")
5173
result = subprocess.run(cmd)
5274

@@ -66,19 +88,18 @@ def build():
6688

6789

6890
def create_windows_ico():
69-
"""Create Windows .ico file from SVG (requires inkscape or imagemagick)."""
70-
svg_path = "resources/icons/app_icon.svg"
91+
"""Create Windows .ico file from PNG (requires ImageMagick)."""
92+
png_path = "resources/icons/app_icon.png"
7193
ico_path = "resources/icons/app_icon.ico"
7294

73-
if not os.path.exists(svg_path):
74-
print(f"SVG not found: {svg_path}")
95+
if not os.path.exists(png_path):
96+
print(f"PNG not found: {png_path}")
7597
return False
7698

7799
# Try using ImageMagick
78100
try:
79101
subprocess.run([
80-
'convert', '-background', 'none',
81-
svg_path,
102+
'convert', png_path,
82103
'-define', 'icon:auto-resize=256,128,64,48,32,16',
83104
ico_path
84105
], check=True)

0 commit comments

Comments
 (0)