Cross Compile Manual workflow v2 #220
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
# Cross-compile workflow that is manually triggered | |
name: Cross Compile Manual workflow v2 | |
# Controls when the action will run. Workflow runs when manually triggered using the UI | |
# or API. | |
on: | |
workflow_dispatch: | |
# Inputs the workflow accepts. | |
inputs: | |
mytag: | |
# Friendly description to be shown in the UI instead of 'name' | |
description: 'Input Tag' | |
# Default value if no value is explicitly provided | |
default: '0.0.0.0' | |
# Input has to be provided for the workflow to run | |
required: true | |
# The data type of the input | |
type: string | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
build: | |
permissions: | |
contents: write | |
strategy: | |
matrix: | |
# os: [macos-13, macos-latest, ubuntu-latest, windows-latest] | |
os: [macos-13, macos-latest, ubuntu-latest, windows-latest] | |
env: | |
YOUTUBE_DISABLE: no | |
DEBUG_COMPILATION: yes | |
COMP_VERSION: ${{github.event.inputs.mytag}} | |
runs-on: ${{matrix.os}} | |
steps: | |
- uses: kenchan0130/actions-system-info@master | |
id: system-info | |
- name: Get current time | |
uses: josStorer/get-current-time@v2 | |
id: current-time | |
with: | |
format: YYYYMMDD-HH | |
utcOffset: "+02:00" | |
- name: Check-out repository | |
uses: actions/checkout@v4 | |
- name: Windows specific | |
if: matrix.os == 'windows-latest' | |
run: | | |
echo "ARCHITECTURE=x86_64" >> $env:GITHUB_ENV | |
curl -L -o xtra/info_window.exe https://github.com/zak-45/InfoWindow/releases/download/0.0.0.0/info_window-Windows_.exe | |
- name: Ubuntu specific | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
sudo apt-get update | |
sudo apt-get upgrade | |
sudo apt-get install libasound-dev portaudio19-dev libportaudio2 libportaudiocpp0 | |
sudo apt-get install libfontconfig1 libgl1-mesa-dri | |
ARCHITECTURE=$(uname -m) | |
echo "ARCHITECTURE=$ARCHITECTURE" >> $GITHUB_ENV | |
curl -L -o xtra/info_window https://github.com/zak-45/InfoWindow/releases/download/0.0.0.0/info_window-Linux_x86_64 | |
chmod +x xtra/info_window | |
- name: MacOS specific Apple(Mx) | |
if: matrix.os == 'macos-latest' | |
run: | | |
brew update | |
brew install portaudio | |
brew reinstall libsndfile | |
brew install ffmpeg | |
brew install fileicon | |
ARCHITECTURE=$(uname -m) | |
echo "ARCHITECTURE=$ARCHITECTURE" >> $GITHUB_ENV | |
curl -L -o xtra/info_window https://github.com/zak-45/InfoWindow/releases/download/0.0.0.0/info_window-macOS_arm64 | |
chmod +x xtra/info_window | |
xattr -c xtra/info_window | |
- name: MacOS specific Intel | |
if: matrix.os == 'macos-13' | |
run: | | |
brew update | |
brew unlink python && brew link --overwrite python | |
brew install portaudio | |
brew reinstall libsndfile | |
brew install ffmpeg | |
brew install fileicon | |
ARCHITECTURE=$(uname -m) | |
echo "ARCHITECTURE=$ARCHITECTURE" >> $GITHUB_ENV | |
curl -L -o xtra/info_window https://github.com/zak-45/InfoWindow/releases/download/0.0.0.0/info_window-macOS_x86_64 | |
chmod +x xtra/info_window | |
xattr -c xtra/info_window | |
- name: Setup Python x64 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' # Version range or exact version of a Python version to use | |
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified | |
cache: 'pip' | |
cache-dependency-path: | | |
**/requirements*.txt | |
- name: Add version info to json file | |
env: | |
GitRun: ${{ github.run_id }}.${{ github.run_number }}.${{ github.run_attempt }} | |
run: | | |
echo '{"version": "${{env.COMP_VERSION}}","gitrun": "${{env.GitRun}}","date": "${{ steps.current-time.outputs.time }}","name": "${{ steps.system-info.outputs.name }}","platform": "${{ steps.system-info.outputs.platform }}","release": "${{ steps.system-info.outputs.release }}","python":"${{env.Python_ROOT_DIR}}","youtube_disable":"${{env.YOUTUBE_DISABLE}}","debug_compilation":"${{env.DEBUG_COMPILATION}}"}' > ./assets/version-${{ steps.system-info.outputs.platform }}.json | |
- name: Ubuntu specific bis | |
if: matrix.os == 'ubuntu-latest' | |
# | |
run: | | |
sudo apt update | |
sudo apt upgrade | |
sudo apt-get -y install libavdevice-dev | |
sudo add-apt-repository ppa:ubuntuhandbook1/ffmpeg7 | |
sudo apt install ffmpeg | |
ffmpeg -version | |
sudo apt-get install libgirepository-2.0-dev gcc libcairo2-dev pkg-config python3-dev gir1.2-gtk-3.0 gir1.2-webkit2-4.1 | |
sudo apt-get install gstreamer1.0-plugins-bad | |
sudo apt install gir1.2-appindicator3-0.1 gir1.2-girepository-2.0 | |
pip3 install av --no-binary av | |
- name: Install Dependencies for All | |
run: | | |
pip install -r requirements.txt | |
- name: Build Executable for ${{runner.os}} | |
uses: Nuitka/Nuitka-Action@main | |
with: | |
# nuitka-version: 2.6.2 | |
nuitka-version: main | |
script-name: WLEDVideoSync.py | |
company-name: zak-45 | |
product-version: ${{github.event.inputs.mytag}} | |
file-version: ${{github.event.inputs.mytag}} | |
enable-plugins: tk-inter | |
windows-console-mode: disable | |
deployment: true | |
windows-icon-from-ico: assets/favicon.ico | |
macos-app-icon: assets/favicon.ico | |
mode: app | |
onefile-tempdir-spec: ./WLEDVideoSync | |
output-file: WLEDVideoSync-${{runner.os}}_${{ env.ARCHITECTURE }} | |
include-package: certifi | |
include-package-data: | | |
nicegui | |
coldtype | |
certifi | |
include-module: | | |
src.txt.textanimator | |
src.txt.coldtypemp | |
zeroconf._utils.ipaddress | |
zeroconf._handlers.answers | |
pygments.formatters.html | |
dbm.dumb | |
comtypes.stream | |
av.opaque | |
coldtype.raster | |
fontgoggles.font.otfFont | |
moviepy | |
PIL.Image | |
PIL.ImageDraw | |
PIL.ImageFont | |
PIL.ImageFilter | |
include-data-dir: | | |
tmp=tmp | |
log=log | |
assets=assets | |
config=config | |
media=media | |
include-data-files: | | |
favicon.ico=favicon.ico | |
favicon.png=favicon.png | |
splash-screen.png=splash-screen.png | |
user-package-configuration-file: | | |
coldtype-nuitka-package.config.yml | |
yt_dlp-fix-nuitka-package.config.yml | |
# Use tar to preserve attribute | |
- name: MacOS prepare app from Nuitka | |
if: matrix.os == 'macos-13' || matrix.os == 'macos-latest' | |
run: | | |
chmod +x build/WLEDVideoSync.app/Contents/MacOS/WLEDVideoSync-${{ runner.os }}_${{ env.ARCHITECTURE }}** | |
mkdir WLEDVideoSync | |
fileicon set WLEDVideoSync build/WLEDVideoSync.app/Contents/MacOS/assets/custom_folder.png | |
mv build/WLEDVideoSync.app WLEDVideoSync/WLEDVideoSync-${{ runner.os }}_${{ env.ARCHITECTURE }}.app | |
tar cp WLEDVideoSync | gzip --best > WLEDVideoSync-${{runner.os}}_${{ env.ARCHITECTURE }}.tar.gz | |
- name: Create Release ${{github.event.inputs.mytag}} with Builds from Nuitka for Win/Linux | |
if: matrix.os == 'windows-latest' || matrix.os == 'ubuntu-latest' | |
uses: ncipollo/release-action@v1 | |
with: | |
allowUpdates: true | |
commit: main | |
tag: ${{github.event.inputs.mytag}} | |
artifacts: 'build/WLEDVideoSync-${{runner.os}}_${{ env.ARCHITECTURE }}**' | |
- name: Create Release ${{github.event.inputs.mytag}} with Builds from Nuitka for MacOS | |
if: matrix.os == 'macos-13' || matrix.os == 'macos-latest' | |
uses: ncipollo/release-action@v1 | |
with: | |
allowUpdates: true | |
commit: main | |
tag: ${{github.event.inputs.mytag}} | |
artifacts: 'WLEDVideoSync-${{runner.os}}_${{ env.ARCHITECTURE }}.tar.gz' |