-
-
Notifications
You must be signed in to change notification settings - Fork 5
165 lines (149 loc) · 5.72 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
163
164
165
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 -- --sign --distpath=build
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/Flowkeeper.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
PORTABLE_FILENAME="dist/flowkeeper-${FK_VERSION}-${{ matrix.os }}-${{ matrix.compiler }}-portable${BINARY_EXTENSION}"
echo "Will output portable to $PORTABLE_FILENAME"
if [[ "${{ matrix.compiler}}" == "nuitka" ]]; then
mv build/Flowkeeper* $PORTABLE_FILENAME
mv build/desktop.dist dist/standalone
else
mv build/flowkeeper/Flowkeeper${BINARY_EXTENSION} $PORTABLE_FILENAME
mv build/flowkeeper/_internal dist/standalone/_internal
fi
echo "Moved ${{ matrix.compiler }} binaries to dist/standalone"
ls -al dist/standalone
if [[ "$OSTYPE" == "darwin"* ]]; then
scripts/macos/create-dmg.sh
scripts/macos/notarize-dmg.sh
elif [[ "$OSTYPE" == "msys" ]]; then
scripts/windows/package-installer.sh
else
scripts/linux/debian/package-deb.sh
scripts/linux/appimage/package-appimage.sh
fi
- name: Archive portable single-file build
uses: actions/upload-artifact@v4
with:
name: dist-${{ matrix.os }}-${{ matrix.compiler }}-portable
path: |
dist/Flowkeeper*
- name: Archive portable build ZIP
uses: actions/upload-artifact@v4
with:
name: dist-${{ matrix.os }}-${{ matrix.compiler }}-zip
path: |
dist/standalone
- name: Archive Windows installer
uses: actions/upload-artifact@v4
with:
name: dist-${{ matrix.os }}-${{ matrix.compiler }}-installers
path: |
dist/setup*.exe
- name: Archive AppImage
uses: actions/upload-artifact@v4
with:
name: dist-${{ matrix.os }}-${{ matrix.compiler }}-AppImage
path: |
dist/*.AppImage
- name: Archive DEB package
uses: actions/upload-artifact@v4
with:
name: dist-${{ matrix.os }}-${{ matrix.compiler }}-deb
path: |
dist/flowkeeper.deb