Update python-app.yml

This commit is contained in:
Yonokid
2025-12-27 13:27:45 -05:00
parent e719119764
commit 2769503899

View File

@@ -1,162 +1,159 @@
name: PyTaiko name: PyTaiko
on: on:
push: workflow_dispatch:
branches: ["main"]
pull_request:
branches: ["main"]
permissions: permissions:
contents: write contents: write
pull-requests: write pull-requests: write
issues: write issues: write
repository-projects: write repository-projects: write
jobs: jobs:
build: build:
strategy: strategy:
matrix: matrix:
os: [ubuntu-22.04, windows-latest] os: [ubuntu-22.04, windows-latest]
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Check-out repository - name: Check-out repository
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
submodules: recursive submodules: recursive
- name: Install libaudio Dependencies (macOS) - name: Install libaudio Dependencies (macOS)
if: runner.os == 'macOS' if: runner.os == 'macOS'
run: | run: |
brew update brew update
brew install portaudio libsndfile speexdsp ccache brew install portaudio libsndfile speexdsp ccache
- name: Install libaudio Dependencies (Windows) - name: Install libaudio Dependencies (Windows)
if: runner.os == 'Windows' if: runner.os == 'Windows'
uses: msys2/setup-msys2@v2 uses: msys2/setup-msys2@v2
with: with:
update: true update: true
install: >- install: >-
base-devel base-devel
mingw-w64-x86_64-gcc mingw-w64-x86_64-gcc
mingw-w64-x86_64-libsndfile mingw-w64-x86_64-libsndfile
mingw-w64-x86_64-speexdsp mingw-w64-x86_64-speexdsp
mingw-w64-x86_64-ccache mingw-w64-x86_64-ccache
- name: Install libaudio Dependencies (Linux) - name: Install libaudio Dependencies (Linux)
if: runner.os == 'Linux' if: runner.os == 'Linux'
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt-get install -y \ sudo apt-get install -y \
build-essential \ build-essential \
pkg-config \ pkg-config \
libsndfile1-dev \ libsndfile1-dev \
libspeexdsp-dev \ libspeexdsp-dev \
portaudio19-dev \ portaudio19-dev \
libpulse-dev \ libpulse-dev \
ccache \ ccache \
- name: Build libaudio (Windows) - name: Build libaudio (Windows)
if: runner.os == 'Windows' if: runner.os == 'Windows'
shell: msys2 {0} shell: msys2 {0}
run: | run: |
cd libs/audio cd libs/audio
make clean make clean
make all make all
make verify make verify
- name: Build libaudio (Unix) - name: Build libaudio (Unix)
if: runner.os != 'Windows' if: runner.os != 'Windows'
shell: bash shell: bash
run: | run: |
cd libs/audio cd libs/audio
make clean make clean
make all make all
make verify make verify
- name: Upload libaudio Artifacts - name: Upload libaudio Artifacts
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: libaudio-${{ runner.os }}-${{ runner.arch }} name: libaudio-${{ runner.os }}-${{ runner.arch }}
path: | path: |
libs/audio/libaudio.dll libs/audio/libaudio.dll
libs/audio/libaudio.so libs/audio/libaudio.so
libs/audio/libaudio.dylib libs/audio/libaudio.dylib
libs/audio/*.a libs/audio/*.a
if-no-files-found: ignore if-no-files-found: ignore
- name: Install uv - name: Install uv
uses: astral-sh/setup-uv@v4 uses: astral-sh/setup-uv@v4
- name: Setup Python - name: Setup Python
run: uv python install run: uv python install
- name: Build Executable - name: Build Executable
shell: bash shell: bash
run: | run: |
uv run nuitka \ uv run nuitka \
--lto=yes \ --lto=yes \
--mode=app \ --mode=app \
--noinclude-setuptools-mode=nofollow \ --noinclude-setuptools-mode=nofollow \
--noinclude-IPython-mode=nofollow \ --noinclude-IPython-mode=nofollow \
--assume-yes-for-downloads \ --assume-yes-for-downloads \
--windows-icon-from-ico=libs/icon.ico \ --windows-icon-from-ico=libs/icon.ico \
--macos-app-icon=libs/icon.icns \ --macos-app-icon=libs/icon.icns \
--linux-icon=libs/icon.png \ --linux-icon=libs/icon.png \
PyTaiko.py PyTaiko.py
- name: Create Release Directory - name: Create Release Directory
run: | run: |
mkdir -p release mkdir -p release
cp -r Skins Songs config.toml shader model release/ cp -r Skins Songs config.toml shader model release/
if [ "${{ runner.os }}" == "Windows" ]; then if [ "${{ runner.os }}" == "Windows" ]; then
cp libs/audio/*.dll release/ 2>/dev/null || echo "libaudio not found" cp libs/audio/*.dll release/ 2>/dev/null || echo "libaudio not found"
elif [ "${{ runner.os }}" == "macOS" ]; then elif [ "${{ runner.os }}" == "macOS" ]; then
cp libs/audio/libaudio.dylib release/ 2>/dev/null || echo "libaudio not found" cp libs/audio/libaudio.dylib release/ 2>/dev/null || echo "libaudio not found"
else else
cp libs/audio/libaudio.so release/ 2>/dev/null || echo "libaudio not found" cp libs/audio/libaudio.so release/ 2>/dev/null || echo "libaudio not found"
fi fi
if [ "${{ runner.os }}" == "Windows" ]; then if [ "${{ runner.os }}" == "Windows" ]; then
cp *.exe release/ 2>/dev/null || echo "No .exe files found" cp *.exe release/ 2>/dev/null || echo "No .exe files found"
elif [ "${{ runner.os }}" == "macOS" ]; then elif [ "${{ runner.os }}" == "macOS" ]; then
cp -r *.app release/ 2>/dev/null || echo "No .app bundles found" cp -r *.app release/ 2>/dev/null || echo "No .app bundles found"
else else
cp *.bin release/ 2>/dev/null || echo "No .bin files found" cp *.bin release/ 2>/dev/null || echo "No .bin files found"
fi fi
shell: bash shell: bash
- name: Create Zip Archive - name: Create Zip Archive
run: | run: |
cd release cd release
if [ "${{ runner.os }}" == "Windows" ]; then if [ "${{ runner.os }}" == "Windows" ]; then
7z a ../PyTaiko-${{ runner.os }}-${{ runner.arch }}.zip * 7z a ../PyTaiko-${{ runner.os }}-${{ runner.arch }}.zip *
else else
zip -r ../PyTaiko-${{ runner.os }}-${{ runner.arch }}.zip * zip -r ../PyTaiko-${{ runner.os }}-${{ runner.arch }}.zip *
fi fi
shell: bash shell: bash
- name: Upload Build Artifacts - name: Upload Build Artifacts
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: pytaiko-${{ runner.os }}-${{ runner.arch }} name: pytaiko-${{ runner.os }}-${{ runner.arch }}
path: PyTaiko-${{ runner.os }}-${{ runner.arch }}.zip path: PyTaiko-${{ runner.os }}-${{ runner.arch }}.zip
retention-days: 1 retention-days: 1
release: release:
needs: build needs: build
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' && github.event_name == 'push' if: github.ref == 'refs/heads/main' && github.event_name == 'push'
steps: steps:
- name: Download All Artifacts - name: Download All Artifacts
uses: actions/download-artifact@v4 uses: actions/download-artifact@v4
with: with:
pattern: pytaiko-* pattern: pytaiko-*
merge-multiple: true merge-multiple: true
- name: Upload Release - name: Upload Release
uses: softprops/action-gh-release@v2 uses: softprops/action-gh-release@v2
with: with:
files: PyTaiko-*.zip files: PyTaiko-*.zip
name: "PyTaiko [Rolling Release]" name: "PyTaiko [Rolling Release]"
tag_name: "latest" tag_name: "latest"
make_latest: true make_latest: true
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}