-
Notifications
You must be signed in to change notification settings - Fork 25
100 lines (97 loc) · 3.26 KB
/
job_nuitka-macos.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
name: job_nuitka-macos
on:
workflow_call:
inputs:
version:
required: true
type: string
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- arch: arm64
pyarch: arm64
- arch: x86_64
pyarch: x64
name: Package ${{ matrix.arch }}
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- uses: actions/setup-python@v5
with:
cache: pip
python-version: '3.12'
check-latest: true
architecture: ${{ matrix.pyarch }}
- name: Install build dependencies
run: pip3 install nuitka
- name: Install target dependencies
run: |
pip3 install -r misc/requirements.in
- name: Generate version information
env:
SETUPTOOLS_SCM_PRETEND_VERSION: ${{ inputs.version }}
run: |
python3 -m setuptools_scm --force-write-version-files
- name: Build
env:
SETUPTOOLS_SCM_PRETEND_VERSION: ${{ inputs.version }}
run: >-
arch -${{ matrix.arch }}
python -m nuitka
--assume-yes-for-downloads
--show-scons
--clang
--lto=no
--jobs=4
--static-libpython=no
--standalone
--enable-plugin=anti-bloat
--enable-plugin=pyside6
--show-modules
--show-anti-bloat-changes
--follow-stdlib
--follow-imports
--nofollow-import-to="*.tests"
--nofollow-import-to="*.distutils"
--nofollow-import-to="distutils"
--nofollow-import-to="unittest"
--nofollow-import-to="pydoc"
--nofollow-import-to="tkinter"
--nofollow-import-to="test"
--prefer-source-code
--include-package=pypresence
--include-package-data=qtawesome
--include-data-dir=rare/resources/images/=rare/resources/images/
--include-data-files=rare/resources/languages/rare_*.qm=rare/resources/languages/
--output-filename=Rare.bin
--file-description=Rare.bin
--company-name=RareDevs
--product-name=Rare
--file-version=${{ inputs.version }}
--product-version=${{ inputs.version }}
--macos-create-app-bundle
--macos-app-name=Rare
--macos-app-mode=gui
--macos-app-version=${{ inputs.version }}
--macos-app-icon=rare/resources/images/Rare.icns
rare
- name: Strip
run: |
find rare.app -iname "*.so*" -type f -exec strip {} \;
find rare.app -iname "*.dylib" -type f -exec strip {} \;
find rare.app -iname "*.bin" -type f -exec strip {} \;
- name: Compress
run: |
mv rare.app Rare-${{ inputs.version }}-${{ matrix.arch }}.app
python -c "import shutil; shutil.make_archive('Rare-${{ inputs.version }}-${{ matrix.arch }}.app', 'zip', '.', 'Rare-${{ inputs.version }}-${{ matrix.arch }}.app')"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: Rare-${{ inputs.version }}-${{ matrix.arch }}-macos.app.zip
path: Rare-${{ inputs.version }}-${{ matrix.arch }}.app.zip