Dependabot monitoring PyPi dependencies(deps): Bump dataclass-wizard … #436
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Pyinstaller Build on macOS for macOS arm64 | |
on: | |
release: | |
types: ["published"] | |
push: | |
branches: ["develop", "trunk"] | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: macos-14 | |
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 | |
continue-on-error: true | |
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: Clone FFmpeg, n7.0 tag | |
id: clone-ffmpeg-from-github | |
uses: actions/checkout@v4 | |
with: | |
repository: FFmpeg/FFmpeg | |
path: ffmpeg-n7.0 | |
ref: n7.0 | |
fetch-depth: 1 | |
- name: Cache compiled ffmpeg | |
uses: actions/cache@v4 | |
id: cache-ffmpeg-darwin-arm64 | |
with: | |
path: ffmpeg-n7.0/ffmpeg | |
key: macos-arm64-compiled-ffmpeg-n7.0 | |
- name: Build FFmpeg from source | |
if: steps.cache-ffmpeg-darwin-arm64.outputs.cache-hit != 'true' | |
id: compile-ffmpeg | |
run: | | |
cd ffmpeg-n7.0 | |
./configure \ | |
--arch=arm64 \ | |
--target-os=darwin \ | |
--pkg-config-flags="--static" \ | |
--extra-cflags="-march=native" \ | |
--extra-ldflags="-arch arm64" \ | |
--ld="g++" \ | |
--disable-everything \ | |
--disable-shared \ | |
--disable-doc \ | |
--disable-htmlpages \ | |
--disable-podpages \ | |
--disable-txtpages \ | |
--disable-network \ | |
--disable-autodetect \ | |
--disable-hwaccels \ | |
--disable-ffprobe \ | |
--disable-ffplay \ | |
--enable-neon \ | |
--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: | |
cache: "pip" | |
check-latest: false | |
python-version: "3.12.7" | |
- name: Install dependencies | |
run: | | |
python3 -m pip install --upgrade pip 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_aarch64 \ | |
--target-arch=arm64 \ | |
--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_aarch64 --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_aarch64.sha256').write_text(f'''{sha256(Path('./dist/tidal-wave_macos_aarch64').read_bytes()).hexdigest()}\ttidal-wave_macos_aarch64''')" | |
cat tidal-wave_macos_aarch64.sha256 | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
compression-level: 9 | |
name: tidal-wave_macos_aarch64 | |
overwrite: true | |
path: | | |
./dist/tidal-wave_macos_aarch64 | |
tidal-wave_macos_aarch64.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_aarch64 | |
tidal-wave_macos_aarch64.sha256 | |
token: ${{ github.token }} |