-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (97 loc) · 3.16 KB
/
Copy pathbuild.yml
File metadata and controls
97 lines (97 loc) · 3.16 KB
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
name: Build (Nuitka)
on:
push:
tags: ["v*"]
workflow_dispatch: {}
jobs:
build:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
artifact: PartsPack-linux
lowmem: "0"
- os: windows-latest
artifact: PartsPack-windows
lowmem: "1"
- os: macos-latest
artifact: PartsPack-macos
lowmem: "0"
runs-on: ${{ matrix.os }}
env:
PARTSPACK_JOBS: "2"
PARTSPACK_LOWMEM: ${{ matrix.lowmem }}
steps:
- uses: actions/checkout@v4
- name: Install Linux system deps
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y \
patchelf binutils clang ccache \
libgl1 libglu1-mesa libxrender1 libxcb-cursor0 libegl1 \
libxkbcommon0 libdbus-1-3
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Cache Nuitka + ccache
uses: actions/cache@v4
with:
path: |
~/.cache/Nuitka
~/AppData/Local/Nuitka/Nuitka
~/Library/Caches/Nuitka
~/.cache/ccache
~/AppData/Local/ccache
~/Library/Caches/ccache
key: nuitka-${{ runner.os }}-${{ hashFiles('requirements-build-*.txt') }}
- name: Create build venv
run: python packaging/make_build_venv.py
- name: Fix lib3mf install id (macOS)
if: runner.os == 'macOS'
run: |
PKG=$(.build-venv/bin/python -c "import lib3mf, os; print(os.path.dirname(lib3mf.__file__))")
DYLIB="$PKG/lib3mf.dylib"
echo "--- id before ---"
otool -D "$DYLIB"
install_name_tool -id "@loader_path/lib3mf.dylib" "$DYLIB"
codesign --force --sign - "$DYLIB" 2>/dev/null || true
echo "-- id after ---"
otool -D "$DYLIB"
- name: Build (Linux/macOS)
if: runner.os != 'Windows'
run: .build-venv/bin/python packaging/build.py
- name: Build (Windows)
if: runner.os == 'Windows'
run: .build-venv\Scripts\python packaging\build.py
- name: Package AppImage (Linux)
if: runner.os == 'Linux'
run: .build-venv/bin/python packaging/make_appimage.py
- name: Package macOS .dmg
if: runner.os == 'macOS'
run: |
hdiutil create -volname PartsPack -srcfolder bin/PartsPack.app \
-ov -format UDZO bin/PartsPack-macos.dmg
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact }}
path: |
bin/PartsPack.exe
bin/PartsPack-x86_64.AppImage
bin/PartsPack-macos.dmg
if-no-files-found: ignore
retention-days: 14
- name: Attach to release
if: success() && startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
files: |
bin/PartsPack.exe
bin/PartsPack-x86_64.AppImage
bin/PartsPack-macos.dmg
fail_on_unmatched_files: false