-
Notifications
You must be signed in to change notification settings - Fork 20
78 lines (67 loc) · 2.22 KB
/
Copy pathbuild-binary.yml
File metadata and controls
78 lines (67 loc) · 2.22 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
name: Build binaries
# Builds standalone, no-Python-needed binaries for macOS, Linux, and Windows
# and attaches them to the GitHub Release. Trigger by pushing a tag like v1.4.83
# (or run manually from the Actions tab).
on:
push:
tags:
- "v*"
workflow_dispatch:
permissions:
contents: write
jobs:
build:
name: ${{ matrix.label }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: macos-14 # Apple Silicon
label: macos-arm64
asset: yourmemory-macos-arm64
- os: macos-13 # Intel
label: macos-x86_64
asset: yourmemory-macos-x86_64
- os: ubuntu-latest
label: linux-x86_64
asset: yourmemory-linux-x86_64
- os: windows-latest
label: windows-x86_64
asset: yourmemory-windows-x86_64.exe
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install app + PyInstaller + spaCy model
run: |
python -m pip install --upgrade pip
pip install -e .
pip install pyinstaller
python -m spacy download en_core_web_sm
- name: Build binary (bundles all deps + models)
run: pyinstaller yourmemory.spec --noconfirm --clean
- name: Package artifact (compress + preserve exec bit)
shell: bash
run: |
mkdir -p out
if [ "${{ runner.os }}" = "Windows" ]; then
mv dist/yourmemory.exe "${{ matrix.asset }}"
7z a "out/${{ matrix.asset }}.zip" "${{ matrix.asset }}"
else
mv dist/yourmemory "${{ matrix.asset }}"
chmod +x "${{ matrix.asset }}"
# store exec bit inside the archive so downloads stay runnable
tar -czf "out/${{ matrix.asset }}.tar.gz" "${{ matrix.asset }}"
fi
- name: Upload workflow artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.asset }}
path: out/*
- name: Attach to release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
files: out/*