Skip to content

Commit 0e19258

Browse files
committed
Add build configuration for app packaging and update icon path
1 parent c3051f7 commit 0e19258

File tree

4 files changed

+177
-1
lines changed

4 files changed

+177
-1
lines changed

.github/workflows/build_app.yaml

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
#A* -------------------------------------------------------------------
2+
#B* This file contains source code for running a GitHub automation
3+
#-* related to the build process of the PyMOL computer program
4+
#C* Copyright 2025 by Martin Urban.
5+
#D* -------------------------------------------------------------------
6+
#E* It is unlawful to modify or remove this copyright notice.
7+
#F* -------------------------------------------------------------------
8+
#G* Please see the accompanying LICENSE file for further information.
9+
#H* -------------------------------------------------------------------
10+
#I* Additional authors of this source file include:
11+
#-*
12+
#-*
13+
#-*
14+
#Z* -------------------------------------------------------------------
15+
name: Build app packages
16+
17+
on: [push]
18+
19+
jobs:
20+
# ----- Windows build section
21+
build-windows:
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
win_arch: ['x86', 'x64']
26+
runs-on: windows-latest
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v4
30+
with:
31+
submodules: recursive
32+
33+
- name: Setup Python 3.11
34+
uses: actions/setup-python@v5
35+
with:
36+
python-version: "3.11"
37+
38+
- name: Create virtual environment
39+
run: |
40+
python -m venv .venv
41+
call .venv\Scripts\activate.bat
42+
python -m pip install --upgrade setuptools pip build
43+
python -m pip install -r requirements.txt
44+
shell: cmd
45+
46+
- name: Download Inno Setup installer
47+
run: |
48+
Invoke-WebRequest -Uri https://files.jrsoftware.org/is/6/innosetup-6.4.2.exe -OutFile inno-setup.exe
49+
50+
- name: Install Inno Setup
51+
run: |
52+
.\inno-setup.exe /SILENT
53+
54+
- name: Add Inno Setup to PATH
55+
run: |
56+
$env:PATH += ";C:\Program Files (x86)\Inno Setup 6"
57+
58+
- name: Build frozen Python application
59+
if: ${{ matrix.win_arch == 'x64' }}
60+
run: |
61+
.\win_automator.bat build app
62+
shell: powershell
63+
64+
- name: Compile .iss file
65+
run: |
66+
iscc os_specific/windows/inno_setup/setup.iss
67+
68+
- name: Upload artifact
69+
uses: actions/upload-artifact@v4
70+
with:
71+
name: Open-Source-PyMOL-Windows-${{ matrix.win_arch }}-Setup
72+
path: ./dist/*.exe
73+
# --- end
74+
75+
# ----- macOS build section
76+
build-macos:
77+
strategy:
78+
fail-fast: false
79+
matrix:
80+
os: [ macos-13, macos-14 ]
81+
runs-on: ${{ matrix.os }}
82+
steps:
83+
- name: Checkout repository
84+
uses: actions/checkout@v4
85+
with:
86+
submodules: recursive
87+
88+
- name: Setup Python 3.11
89+
uses: actions/setup-python@v5
90+
with:
91+
python-version: "3.11"
92+
93+
- name: Create virtual environment
94+
run: |
95+
python -m venv .venv
96+
source .venv/bin/activate
97+
python -m pip install wheel setuptools
98+
python -m pip install -r requirements.txt
99+
100+
- name: Build app package
101+
run: |
102+
./automator.sh build app
103+
104+
- name: Rename app package
105+
run: mv dist/open_source_pymol-3.1.0a0.app dist/Open-Source-PyMOL-3.1.0a0.app
106+
107+
- name: Build DMG
108+
uses: urban233/create-dmg-actions@v0.0.2
109+
with:
110+
dmg_name: 'Open-Source-PyMOL'
111+
src_dir: 'dist/Open-Source-PyMOL-3.1.0a0.app'
112+
bg_filepath: 'alternative_design/dmg_bg.png'
113+
114+
- name: Upload artifact
115+
uses: actions/upload-artifact@v4
116+
with:
117+
name: Open-Source-PyMOL-macOS-${{ matrix.arch }}-Setup
118+
path: ./*.dmg
119+
# --- end
120+
121+
# ----- GNU Linux build section
122+
build-gnu-linux:
123+
runs-on: ubuntu-22.04
124+
steps:
125+
- name: Checkout repository
126+
uses: actions/checkout@v4
127+
with:
128+
submodules: recursive
129+
130+
- name: Install system dependencies
131+
run: |
132+
sudo apt-get update
133+
sudo apt-get install git build-essential libxmu-dev libxi-dev libgl-dev libglew-dev libpng-dev libfreetype6-dev libxml2-dev libmsgpack-dev libglm-dev libnetcdf-dev linux-libc-dev autoconf perl
134+
135+
- name: Initialize vcpkg
136+
run: |
137+
git clone https://github.com/Microsoft/vcpkg.git vendor/vcpkg
138+
139+
- name: Setup Python 3.11
140+
uses: actions/setup-python@v5
141+
with:
142+
python-version: "3.11"
143+
144+
- name: Create virtual environment
145+
run: |
146+
python -m venv .venv
147+
source .venv/bin/activate
148+
python -m pip install wheel setuptools cibuildwheel
149+
python -m pip install -r requirements.txt
150+
151+
- name: Bootstrap vcpkg
152+
run: ${{ env.VCPKG_ROOT }}/bootstrap-vcpkg.sh -disableMetrics
153+
154+
- name: Install vcpkg dependencies
155+
run: |
156+
${{ env.VCPKG_ROOT }}/vcpkg install
157+
158+
- name: Last build environment setup steps
159+
run: |
160+
source .venv/bin/activate
161+
python automations/my_automator.py setup dev-env
162+
163+
- name: Build C extension
164+
run: |
165+
source .venv/bin/activate
166+
python automations/my_automator.py setup dev-env
167+
cibuildwheel .
168+
169+
- name: Upload artifact
170+
uses: actions/upload-artifact@v4
171+
with:
172+
name: PyMOL-wheel-GNU-Linux-3.11
173+
path: ./wheelhouse/*.whl
174+
# --- end

alternative_design/splash2.png

-389 KB
Binary file not shown.

os_specific/macos/icon.icns

671 KB
Binary file not shown.

os_specific/macos/setup_build_exe.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import toml
55
from cx_Freeze import setup
66

7+
from automations.const import OS_SPECIFIC_DIR
8+
79
# <editor-fold desc="Module constants">
810
tmp_pyproject_toml = toml.load("../pyproject.toml")
911
PROJECT_NAME = tmp_pyproject_toml["project"]["name"]
@@ -51,7 +53,7 @@
5153
"target_name": "PyMOL",
5254
"script": pathlib.Path(PYMOL_PACKAGE_DIR / "startup_wrapper.py"),
5355
"base": "gui",
54-
"icon": pathlib.Path(PROJECT_ROOT_DIR / "alternative_design/icon.icns"),
56+
"icon": pathlib.Path(OS_SPECIFIC_DIR / "icon.icns"),
5557
}
5658
],
5759
)

0 commit comments

Comments
 (0)