Skip to content

Fix imageasset __init__ #174

Fix imageasset __init__

Fix imageasset __init__ #174

name: Build Windows (MINGW64) app
on:
push:
pull_request:
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
# TODO(Martin): p7zip should be 7zip but MINGW64 hasn't updated at the time of writing, try switching it later
- name: Read Package List
id: read_packages
run: |
$packages = Get-Content extra/msyspac.txt -Raw | Out-String
$packages = $packages -replace "`r`n", " " -replace "`n", " "
$packages = $packages.Trim() + " p7zip"
echo "packages=$packages" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8
- name: Set up MSYS2 MinGW-W64
uses: msys2/setup-msys2@v2
with:
msystem: mingw64
update: true
install: ${{ env.packages }}
# ca-certificates
# mingw-w64-x86_64-python-zeroconf
# mingw-w64-x86_64-zlib
- name: Update CA trust and hack opusfile
shell: msys2 {0}
run: |
update-ca-trust
# https://github.com/xiph/opusfile/pull/47
sed -i 's,<opus_multistream.h>,<opus/opus_multistream.h>,' /mingw64/include/opus/opusfile.h
- name: Install Python dependencies and setup venv
shell: msys2 {0}
run: |
python -m pip install --break-system-packages --upgrade pip
python -m venv .venv
export CFLAGS="-I/mingw64/include"
export PIP_FIND_LINKS=https://github.com/ddelange/python-magic/releases/expanded_assets/0.4.28.post8
.venv/bin/python -m pip install \
-r requirements.txt \
build \
pyinstaller
- name: Build the project using python-build
shell: msys2 {0}
run: |
source .venv/bin/activate
python -m compile_translations
python -m build --wheel
- name: Install the project into a venv
shell: msys2 {0}
run: |
source .venv/bin/activate
pip install --prefix ".venv" dist/*.whl
# https://github.com/Taiko2k/Tauon/pull/931#issuecomment-1464880133
- name: Download optionals from latest release files and notofonts' GitHub
shell: msys2 {0}
run: |
curl -L -o librespot.exe https://github.com/Taiko2k/Tauon/releases/download/v7.8.3/librespot.exe
curl -L -o TaskbarLib.tlb https://github.com/Taiko2k/Tauon/releases/download/v7.8.3/TaskbarLib.tlb
curl -L -o TauonSMTC.dll https://github.com/Taiko2k/Tauon/releases/download/v7.8.3/TauonSMTC.dll
mkdir fonts
curl -L -o fonts/NotoSans-ExtraCondensed.ttf https://github.com/notofonts/notofonts.github.io/raw/refs/heads/main/fonts/NotoSans/full/ttf/NotoSans-ExtraCondensed.ttf # 800KB
curl -L -o fonts/NotoSans-ExtraCondensedBold.ttf https://github.com/notofonts/notofonts.github.io/raw/refs/heads/main/fonts/NotoSans/full/ttf/NotoSans-ExtraCondensedBold.ttf # 800KB
curl -L -o fonts/NotoSans-Bold.ttf https://github.com/notofonts/notofonts.github.io/raw/refs/heads/main/fonts/NotoSans/full/ttf/NotoSans-Bold.ttf # 800KB
curl -L -o fonts/NotoSans-Medium.ttf https://github.com/notofonts/notofonts.github.io/raw/refs/heads/main/fonts/NotoSans/full/ttf/NotoSans-Medium.ttf # 800KB
curl -L -o fonts/NotoSans-Regular.ttf https://github.com/notofonts/notofonts.github.io/raw/refs/heads/main/fonts/NotoSans/full/ttf/NotoSans-Regular.ttf # 800KB
curl -L -o fonts/NotoSansCJKjp-Bold.otf https://github.com/notofonts/noto-cjk/raw/refs/heads/main/Sans/OTF/Japanese/NotoSansCJKjp-Bold.otf # 16MB
curl -L -o fonts/NotoSansCJKjp-Medium.otf https://github.com/notofonts/noto-cjk/raw/refs/heads/main/Sans/OTF/Japanese/NotoSansCJKjp-Medium.otf # 16MB
curl -L -o fonts/NotoSansCJKjp-Regular.otf https://github.com/notofonts/noto-cjk/raw/refs/heads/main/Sans/OTF/Japanese/NotoSansCJKjp-Regular.otf # 16MB
- name: "[DEBUG] List all files"
shell: msys2 {0}
run: find .
- name: Build Windows App with PyInstaller
shell: msys2 {0}
run: |
source .venv/bin/activate
pyinstaller --log-level=DEBUG windows.spec
- name: Create 7Z
shell: msys2 {0}
run: |
APP_NAME="TauonMusicBox"
cd "dist/${APP_NAME}"
ARCHIVE_PATH="../../${APP_NAME}.7z"
7z a -r "${ARCHIVE_PATH}" "."
- name: Upload 7Z artifact
uses: actions/upload-artifact@v4
with:
name: TauonMusicBox-windows
path: TauonMusicBox.7z