-
-
Notifications
You must be signed in to change notification settings - Fork 5
163 lines (147 loc) · 5.88 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
name: Build binaries
on:
workflow_dispatch:
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
compiler: [nuitka, pyinstaller]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.MAC_SIGN_CERT }}
P12_PASSWORD: ${{ secrets.MAC_SIGN_PASSWORD }}
KEYCHAIN_PASSWORD: ${{ secrets.MAC_KEYCHAIN_PASSWORD }}
shell: bash
run: |
export FK_VERSION=$(scripts/common/get-version.sh)
echo "FK_VERSION=$FK_VERSION" >> $GITHUB_ENV
if [[ "$OSTYPE" == "darwin"* ]]; then
scripts/macos/install-create-dmg.sh
scripts/macos/install-certificates.sh
export BINARY_EXTENSION=""
echo "BINARY_EXTENSION=" >> $GITHUB_ENV
elif [[ "$OSTYPE" == "msys" ]]; then
scripts/windows/install-innosetup.sh
export BINARY_EXTENSION=".exe"
echo "BINARY_EXTENSION=.exe" >> $GITHUB_ENV
else
scripts/linux/appimage/install-appimage.sh
export BINARY_EXTENSION=""
echo "BINARY_EXTENSION=" >> $GITHUB_ENV
fi
pip install -r requirements.txt
if [[ "${{ matrix.compiler}}" == "nuitka" ]]; then
pip install nuitka
else
pip install pyinstaller
fi
- name: Prepare sources
shell: bash
run: |
scripts/common/generate-resources.sh
rm -rf build dist
mkdir -p build dist
- name: Package builds (PyInstaller)
if: ${{ matrix.compiler == 'pyinstaller' }}
shell: bash
run: |
if [[ "$OSTYPE" == "darwin"* ]]; then
pyinstaller scripts/common/pyinstaller/normal.spec --distpath=build -- --sign
echo "Built PyInstaller for macOS"
ls -al build/
else
pyinstaller scripts/common/pyinstaller/portable.spec --distpath=build
pyinstaller scripts/common/pyinstaller/normal.spec --distpath=build
echo "Built PyInstaller for Linux or Windows"
ls -al build/
fi
- name: Package builds (Nuitka)
if: ${{ matrix.compiler == 'nuitka' }}
uses: Nuitka/Nuitka-Action@main
with:
nuitka-version: main
script-name: src/fk/desktop/desktop.py
mode: onefile
enable-plugins: pyside6
windows-console-mode: disable
windows-icon-from-ico: res/flowkeeper.ico
macos-app-icon: flowkeeper.icns
macos-signed-app-name: org.flowkeeper.Flowkeeper
macos-app-version: "${{ env.FK_VERSION }}"
macos-app-name: Flowkeeper
macos-sign-identity: "Developer ID Application: Constantine Kulak (ELWZ9S676C)"
product-name: Flowkeeper
product-version: "${{ env.FK_VERSION }}"
file-description: Flowkeeper is a Pomodoro Technique desktop timer for power users
copyright: Copyright (c) 2023 Constantine Kulak <[email protected]>
output-dir: 'build'
output-file: 'Flowkeeper'
env:
PYTHONPATH: src
- name: Create installers
env:
NOTARIZATION_PASSWORD: ${{ secrets.MAC_NOTARIZATION_PASSWORD }}
NOTARIZATION_ID: ${{ secrets.MAC_NOTARIZATION_ID }}
NOTARIZATION_TEAM: ${{ secrets.MAC_NOTARIZATION_TEAM }}
shell: bash
run: |
echo "Prepare dist directory"
mkdir -p dist/standalone
PREFIX="dist/flowkeeper-${FK_VERSION}-${{ matrix.os }}-${{ matrix.compiler }}"
echo "Will create artifacts with $PREFIX prefix"
if [[ "${{ matrix.compiler}}" == "nuitka" ]]; then
mv build/Flowkeeper* $PREFIX-portable${BINARY_EXTENSION}
mv build/desktop.dist/* dist/standalone
if [[ "$OSTYPE" == "darwin"* ]]; then
mv dist/standalone/Flowkeeper.bin dist/standalone/Flowkeeper.app
fi
else
if [[ "$OSTYPE" == "darwin"* ]]; then
echo "macOS doesn't support portable binaries"
ls -al build/Flowkeeper.app
mv build/Flowkeeper.app dist/standalone
else
mv build/Flowkeeper${BINARY_EXTENSION} $PREFIX-portable${BINARY_EXTENSION}
mv build/flowkeeper/* dist/standalone
fi
fi
echo "Moved ${{ matrix.compiler }} binaries to dist/standalone"
ls -al dist/
ls -al dist/standalone
if [[ "$OSTYPE" == "darwin"* ]]; then
echo "Building macOS DMG installer"
scripts/macos/create-dmg.sh
scripts/macos/notarize-dmg.sh
mv dist/Flowkeeper.dmg "$PREFIX-installer.dmg"
elif [[ "$OSTYPE" == "msys" ]]; then
echo "Building Windows setup.exe installer"
scripts/windows/package-installer.sh
mv dist/setup.exe "$PREFIX-installer.exe"
else
echo "Building Debian "fat" DEB package"
scripts/linux/debian/package-deb.sh
mv dist/flowkeeper.deb "$PREFIX-package.deb"
echo "Building Debian "lean" DEB package"
scripts/linux/debian/package-deb-min.sh
mv dist/flowkeeper-min.deb "$PREFIX-min-package.deb"
# Temporarily disable AppImage build
# echo "Building AppImage package"
# scripts/linux/appimage/package-appimage.sh
# mv dist/org.flowkeeper.Flowkeeper.AppImage "$PREFIX-portable.AppImage"
fi
- name: Archive the builds
uses: actions/upload-artifact@v4
with:
name: dist-all
path: |
dist