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