-
Notifications
You must be signed in to change notification settings - Fork 3
136 lines (136 loc) · 4.94 KB
/
pyinstaller-macos_x86.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
---
name: Pyinstaller Build on macOS for macOS x86_64
on:
release:
types: ["published"]
push:
branches: ["develop", "trunk"]
permissions:
contents: write
jobs:
build:
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories
runs-on: macos-13
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Cache Homebrew Bundler RubyGems
id: cache
uses: actions/cache@v4
with:
path: ${{ steps.set-up-homebrew.outputs.gems-path }}
key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }}
restore-keys: ${{ runner.os }}-rubygems-
- name: Install Homebrew Bundler RubyGems
if: steps.cache.outputs.cache-hit != 'true'
run: brew install-bundler-gems
- name: Update Homebrew
id: update-homebrew
run: |
brew update --preinstall
# https://trac.ffmpeg.org/wiki/CompilationGuide/macOS#InstallingdependencieswithHomebrew
- name: Get FFmpeg dependencies from Homebrew
id: brew-install-ffmpeg-deps
run: brew install automake nasm shtool xvid
- name: Cache FFmpeg n7.0
id: cache-ffmpeg
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/ffmpeg-n7.0
key: ffmpeg-${{ hashFiles('ffmpeg-n7.0') }}
- name: Clone FFmpeg, n7.0 tag
if: ${{ steps.cache-ffmpeg.outputs.cache-hit != 'true' }}
id: clone-ffmpeg-from-github
uses: actions/checkout@v4
with:
repository: FFmpeg/FFmpeg
path: ffmpeg-n7.0
ref: n7.0
fetch-depth: 1
- name: Build FFmpeg from source
run: |
cd ffmpeg-n7.0
./configure \
--arch=x86_64 \
--target-os=darwin \
--pkg-config-flags="--static" \
--extra-cflags="-march=native" \
--extra-ldflags="-arch x86_64" \
--disable-everything \
--disable-shared \
--disable-doc \
--disable-htmlpages \
--disable-podpages \
--disable-txtpages \
--disable-network \
--disable-autodetect \
--disable-hwaccels \
--disable-ffprobe \
--disable-ffplay \
--enable-bsf=aac_adtstoasc,extract_extradata,h264_metadata,mpeg2_metadata \
--enable-decoder=aac,flac,h264,mjpeg \
--enable-demuxer=aac,eac3,flac,h264,image2,mov,mpegts \
--enable-encoder=aac,flac,h264,mjpeg \
--enable-filter=copy \
--enable-muxer=eac3,flac,h264,mjpeg,mpegts,mp4 \
--enable-parser=aac,h264 \
--enable-protocol=file \
--enable-small
make -j$(sysctl -n hw.logicalcpu)
- name: Set up Python
uses: actions/setup-python@v5
with:
architecture: "x64"
cache: "pip"
check-latest: false
python-version: "3.12.7"
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip pyinstaller setuptools wheel
python3 -m pip install pyinstaller==6.7.0
python3 -m pip install -r requirements.txt
- name: Create Executable with Pyinstaller
run: |
pyinstaller \
--name tidal-wave_macos_amd64 \
--target-arch=x86_64 \
--paths tidal_wave \
--exclude-module pyinstaller \
--exclude-module ruff \
--add-binary "ffmpeg-n7.0/ffmpeg:." \
--clean \
--noupx \
--onefile \
--strip \
./pyinstaller.py
- name: Test just-compiled binary
run: |
./dist/tidal-wave_macos_amd64 --help
- name: Create SHA256 checksum file of just-compiled binary
run: |
python3 -c "from hashlib import sha256;from pathlib import Path;Path('tidal-wave_macos_amd64.sha256').write_text(f'''{sha256(Path('./dist/tidal-wave_macos_amd64').read_bytes()).hexdigest()}\ttidal-wave_macos_amd64''')"
cat tidal-wave_macos_amd64.sha256
- name: Upload Artifact
uses: actions/upload-artifact@v4
if: startsWith(github.ref, 'refs/tags/')
with:
compression-level: 9
name: tidal-wave_macos_amd64
overwrite: true
path: |
./dist/tidal-wave_macos_amd64
tidal-wave_macos_amd64.sha256
retention-days: 7
- name: Add artifact to release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
fail_on_unmatched_files: true
files: |
./dist/tidal-wave_macos_amd64
tidal-wave_macos_amd64.sha256
token: ${{ github.token }}