Skip to content

Commit

Permalink
Update to Version 2024.4.2 (#149)
Browse files Browse the repository at this point in the history
* Update .github/workflows/pyinstaller-*:

Use FFmpeg 7.0 and Python 3.12.2 in all pyinstaller invocations
Remove libfdk-aac in Dockerfile and pyinstaller-*.yml as keeping track of the .so and .a files isn't worth the hassle

* Update {README,BUILDME}.md with reference to new executables

* Revamp pyinstaller.py to be tidal_wave/main.py but with match, case flow

* Remove PyApp GitHub Actions Workflow Files (#147) (#148)

* Delete .github/workflows/pyapp-linux.yml

* Delete .github/workflows/pyapp-macos_arm64.yml

* Delete .github/workflows/pyapp-macos_x86.yml

* Delete .github/workflows/pyapp-windows.yml

* Change pyinstaller-macos_x86.yml to use 'macos-13' and pyinstaller-macos_arm64.yml to use 'macos-14'

* Remove pyinstaller.py from the flake8 linting

* Make edits based on flake8

* Bump version to 2024.4.2
  • Loading branch information
ebb-earl-co committed Apr 9, 2024
1 parent 5f12c36 commit 65eba2e
Show file tree
Hide file tree
Showing 14 changed files with 347 additions and 149 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ jobs:
org.opencontainers.image.description="Waving at the TIDAL music service with Python"
org.opencontainers.image.documentation="https://github.com/ebb-earl-co/tidal-wave/blob/trunk/README.md"
org.opencontainers.image.source="https://github.com/ebb-earl-co/tidal-wave"
org.opencontainers.image.licenses="LGPL-2.1-only"
org.opencontainers.image.licenses="LGPL-2.1-only"
38 changes: 20 additions & 18 deletions .github/workflows/pyinstaller-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,26 @@ jobs:
version: 1.0
packages: g++ gcc git make pkg-config yasm

- name: Cache FFmpeg n6.1.1
- name: Cache FFmpeg n7.0
id: cache-ffmpeg
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/ffmpeg-n6.1.1
key: ffmpeg-${{ hashFiles('ffmpeg-n6.1.1') }}
path: ${{ github.workspace }}/ffmpeg-n7.0
key: ffmpeg-${{ hashFiles('ffmpeg-n7.0') }}

- name: Clone FFmpeg, n6.1.1 tag
- 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-n6.1.1
ref: n6.1.1
path: ffmpeg-n7.0
ref: n7.0
fetch-depth: 1

- name: Build FFmpeg from source (git submodule)
run: |
cd ffmpeg-n6.1.1
cd ffmpeg-n7.0
./configure \
--arch=x86_64 \
--pkg-config-flags="--static" \
Expand Down Expand Up @@ -75,21 +75,23 @@ jobs:
with:
architecture: "x64"
cache: "pip"
check-latest: true
python-version: "3.11.8"
check-latest: false
python-version: "3.12.2"

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip pyinstaller setuptools wheel
python3 -m pip install --upgrade pip setuptools wheel
python3 -m pip install pyinstaller==6.5.0
python3 -m pip install -r requirements.txt
- name: Create Executable with Pyinstaller
- name: Create Executable with PyInstaller
run: |
pyinstaller \
--name tidal-wave_py311_FFmpeg611_linux \
--name tidal-wave_ubuntu_amd64 \
--paths tidal_wave \
--exclude-module pyinstaller \
--add-data "README.md:." \
--add-binary "./ffmpeg-n6.1.1/ffmpeg:." \
--add-binary "ffmpeg-n7.0/ffmpeg:." \
--clean \
--noupx \
--onefile \
Expand All @@ -98,13 +100,13 @@ jobs:
- name: Test just-compiled binary
run: |
chmod +x ./dist/tidal-wave_py311_FFmpeg611_linux
./dist/tidal-wave_py311_FFmpeg611_linux --help
chmod +x ./dist/tidal-wave_ubuntu_amd64
./dist/tidal-wave_ubuntu_amd64 --help
- name: Add artifact to release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
token: ${{ github.token }}
fail_on_unmatched_files: true
files: ./dist/tidal-wave_py311_FFmpeg611_linux
files: ./dist/tidal-wave_ubuntu_amd64
token: ${{ github.token }}
35 changes: 21 additions & 14 deletions .github/workflows/pyinstaller-macos_arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ permissions:

jobs:
build:
runs-on: flyci-macos-large-latest-m1
# 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: flyci-macos-large-latest-m1
runs-on: macos-14

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -39,31 +41,32 @@ jobs:
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 libtool nasm shtool xvid

- name: Clone FFmpeg, n6.1.1 tag
- name: Clone FFmpeg, n7.0 tag
id: clone-ffmpeg-from-github
uses: actions/checkout@v4
with:
repository: FFmpeg/FFmpeg
path: ffmpeg-n6.1.1
ref: n6.1.1
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-n6.1.1/ffmpeg
key: macos-arm64-compiled-ffmpeg-n6.1.1
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-n6.1.1
cd ffmpeg-n7.0
./configure \
--arch=arm64 \
--target-os=darwin \
Expand All @@ -72,6 +75,7 @@ jobs:
--extra-ldflags="-arch arm64" \
--ld="g++" \
--disable-everything \
--disable-shared \
--disable-doc \
--disable-htmlpages \
--disable-podpages \
Expand All @@ -96,22 +100,25 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip" # caching pip dependencies
cache: "pip"
check-latest: false
python-version: "3.12.2"

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip pyinstaller setuptools wheel
python3 -m pip install --upgrade pip setuptools wheel
python3 -m pip install pyinstaller==6.5.0
python3 -m pip install -r requirements.txt
- name: Create Executable with Pyinstaller
run: |
pyinstaller \
--name=tidal-wave_py311_FFmpeg611_macos_arm64 \
--name=tidal-wave_macos_aarch64 \
--target-arch=arm64 \
--paths tidal_wave \
--exclude-module pyinstaller \
--add-data "README.md:." \
--add-binary "ffmpeg-n6.1.1/ffmpeg:." \
--add-binary "ffmpeg-n7.0/ffmpeg:." \
--clean \
--noupx \
--onefile \
Expand All @@ -120,12 +127,12 @@ jobs:
- name: Test just-compiled binary
run: |
./dist/tidal-wave_py311_FFmpeg611_macos_arm64 --help
./dist/tidal-wave_macos_aarch64 --help
- name: Add artifact to release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
token: ${{ github.token }}
fail_on_unmatched_files: true
files: ./dist/tidal-wave_py311_FFmpeg611_macos_arm64
files: ./dist/tidal-wave_macos_aarch64
35 changes: 24 additions & 11 deletions .github/workflows/pyinstaller-macos_x86.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ permissions:

jobs:
build:
runs-on: macos-latest
# 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
Expand Down Expand Up @@ -43,18 +44,26 @@ jobs:
id: brew-install-ffmpeg-deps
run: brew install automake libtool nasm shtool xvid

- name: Clone FFmpeg, n6.1.1 tag
- 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-n6.1.1
ref: n6.1.1
path: ffmpeg-n7.0
ref: n7.0
fetch-depth: 1

- name: Build FFmpeg from source
run: |
cd ffmpeg-n6.1.1
cd ffmpeg-n7.0
./configure \
--arch=x86_64 \
--target-os=darwin \
Expand Down Expand Up @@ -86,22 +95,26 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip" # caching pip dependencies
architecture: "x64"
cache: "pip"
check-latest: false
python-version: "3.12.2"

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip pyinstaller setuptools wheel
python3 -m pip install pyinstaller==6.5.0
python3 -m pip install -r requirements.txt
- name: Create Executable with Pyinstaller
run: |
pyinstaller \
--name tidal-wave_py311_FFmpeg611_macos_amd64 \
--name tidal-wave_macos_amd64 \
--target-arch=x86_64 \
--paths tidal_wave \
--exclude-module pyinstaller \
--add-data "README.md:." \
--add-binary "ffmpeg-n6.1.1/ffmpeg:." \
--add-binary "ffmpeg-n7.0/ffmpeg:." \
--clean \
--noupx \
--onefile \
Expand All @@ -110,12 +123,12 @@ jobs:
- name: Test just-compiled binary
run: |
./dist/tidal-wave_py311_FFmpeg611_macos_amd64 --help
./dist/tidal-wave_macos_amd64 --help
- name: Add artifact to release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
token: ${{ github.token }}
fail_on_unmatched_files: true
files: ./dist/tidal-wave_py311_FFmpeg611_macos_amd64
files: ./dist/tidal-wave_macos_amd64
18 changes: 10 additions & 8 deletions .github/workflows/pyinstaller-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ jobs:
uses: actions/cache@v4
id: cache-ffmpeg-exe
with:
path: ffmpeg.exe
key: ffmpeg-n6.1.1-from-media-autobuild-suite
path: ${{ github.workspace }}\ffmpeg.exe
key: ffmpeg-n7.0-from-media-autobuild-suite

- name: Download ffmpeg binary if not found
if: steps.cache-ffmpeg-exe.outputs.cache-hit != 'true'
shell: pwsh
run: |
Invoke-WebRequest "https://github.com/ebb-earl-co/media-autobuild_suite/releases/download/n6.1.1/ffmpeg.exe" -OutFile "ffmpeg.exe"
Invoke-WebRequest "https://github.com/ebb-earl-co/media-autobuild_suite/releases/download/n7.0/ffmpeg.exe" -OutFile "ffmpeg.exe"
- name: Cache UPX 4.2.3 zip downloaded from GitHub
uses: actions/cache@v4
Expand All @@ -51,24 +51,26 @@ jobs:
with:
architecture: "x64"
cache: "pip"
python-version: "3.11"
python-version: "3.12.2"

- name: Install Python dependencies
shell: pwsh
run: |
python.exe -m venv .\venv
& .\venv\Scripts\activate
pip install --upgrade pip pyinstaller pypiwin32==223 setuptools wheel
pip install --upgrade pip setuptools wheel
pip install pyinstaller==6.5.0 pypiwin32==223
pip install -r requirements.txt
- name: Create Executable with Pyinstaller
run: |
& .\venv\Scripts\activate
pyinstaller `
--name tidal-wave_py311_FFmpeg611_windows.exe `
--name tidal-wave_windows.exe `
--paths tidal_wave `
--add-data "README.md:." `
--add-binary "ffmpeg.exe:." `
--exclude-module pyinstaller `
--clean `
--upx-dir "~\AppData\Local\upx-4.2.3-win64" `
--onefile `
Expand All @@ -77,12 +79,12 @@ jobs:
- name: Test just-compiled binary
shell: pwsh
run: |
& .\dist\tidal-wave_py311_FFmpeg611_windows.exe --help
& .\dist\tidal-wave_windows.exe --help
- 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_py311_FFmpeg611_windows.exe
files: .\dist\tidal-wave_windows.exe
token: ${{ github.token }}
4 changes: 2 additions & 2 deletions .github/workflows/python-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip" # caching pip dependencies
python-version: "3.12.2"
cache: "pip"

- name: Install dependencies
run: |
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/python-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ jobs:
strategy:
matrix:
version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-latest, windows-latest, macOS-latest]
# 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
os: [ubuntu-latest, windows-latest, macos-13, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.version }}
cache: "pip" # caching pip dependencies
cache: "pip"
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
Expand All @@ -27,8 +28,8 @@ jobs:
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude pyinstaller.py
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --exclude pyinstaller.py
- name: Format with Black
run: black tidal_wave
Loading

0 comments on commit 65eba2e

Please sign in to comment.