Spleeter Portable #71
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
name: Spleeter Portable | |
# 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 | |
jobs: | |
build: | |
permissions: | |
contents: write | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [macos-14, ubuntu-latest, windows-latest] | |
# os: [windows-latest] | |
include: | |
- os: macos-14 | |
os_name: darwin | |
os_arch: universal2 | |
- os: ubuntu-latest | |
os_name: linux | |
os_arch: x86_64 | |
- os: windows-latest | |
os_name: windows | |
os_arch: x86_64 | |
env: | |
PYTHONDONTWRITEBYTECODE: TRUE | |
steps: | |
- name: Check-out repository | |
uses: actions/checkout@v4 | |
- name: Download Portable Python | |
run: | | |
curl -L -o python-portable-${{ matrix.os_name }}-${{ matrix.os_arch }}.zip https://github.com/bjia56/portable-python/releases/download/cpython-v3.10.15-build.0/python-headless-3.10.15-${{ matrix.os_name }}-${{ matrix.os_arch }}.zip | |
- name: Extract Portable Python | |
run: | | |
if [[ ${{ matrix.os_name }} == 'windows' ]]; then | |
powershell -command "Expand-Archive python-portable-${{ matrix.os_name }}-${{ matrix.os_arch }}.zip -DestinationPath sp-${{ matrix.os_name }}-${{ matrix.os_arch }}" | |
powershell -command "Move-Item -Path 'sp-${{ matrix.os_name }}-${{ matrix.os_arch }}\\python-headless-3.10.15-${{ matrix.os_name }}-${{ matrix.os_arch }}' -Destination 'PySp3.10'" | |
else | |
unzip python-portable-${{ matrix.os_name }}-${{ matrix.os_arch }}.zip -d sp-${{ matrix.os_name }}-${{ matrix.os_arch }} | |
mv sp-${{ matrix.os_name }}-${{ matrix.os_arch }}/python-headless-3.10.15-${{ matrix.os_name }}-${{ matrix.os_arch }} PySp3.10 | |
fi | |
shell: bash | |
- name: Set up environment path | |
run: | | |
if [[ ${{ matrix.os_name }} == 'windows' ]]; then | |
echo "Adding to PATH" | |
echo "D:\\a\\SpleeterGUI-Chataigne-Module\\SpleeterGUI-Chataigne-Module\\PySp3.10\\bin" >> $GITHUB_PATH | |
echo "D:\\a\\SpleeterGUI-Chataigne-Module\\SpleeterGUI-Chataigne-Module\\PySp3.10\\Scripts" >> $GITHUB_PATH | |
else | |
echo "Adding to PATH" | |
echo "PySp3.10/bin" >> $GITHUB_PATH | |
fi | |
PYTHONDONTWRITEBYTECODE=TRUE | |
shell: bash | |
- name: Upgrade pip | |
run: | | |
python -m pip install --upgrade pip | |
pip --version | |
- name: Install numpy / pytaglib | |
run: | | |
python -m pip install numpy==1.26.4 | |
python -m pip install pytaglib | |
- name: Install spleeter | |
run: python -m pip install spleeter | |
- name: Patch spleeter | |
run: | | |
if [ "${{ matrix.os_name }}" = "windows" ]; then | |
python xtra/fix_shebang.py PySp3.10\\Scripts\\spleeter.exe -o PySp3.10\\Scripts | |
else | |
python xtra/fix_shebang.py PySp3.10/bin/spleeter -o PySp3.10/bin | |
fi | |
shell: bash | |
- name: Zip directory | |
run: | | |
if [ "${{ matrix.os_name }}" = "windows" ]; then | |
powershell -command "Compress-Archive -Path PySp3.10 -DestinationPath spleeter-portable-${{ matrix.os_name }}-${{ matrix.os_arch }}.zip" | |
else | |
zip -r spleeter-portable-${{ matrix.os_name }}-${{ matrix.os_arch }}.zip PySp3.10 | |
fi | |
shell: bash | |
- name: Create Release ${{github.event.inputs.mytag}} for Spleeter Portable python-headless-3.10.15 | |
uses: ncipollo/release-action@v1 | |
with: | |
allowUpdates: true | |
commit: main | |
tag: ${{github.event.inputs.mytag}} | |
artifacts: 'spleeter-portable-${{ matrix.os_name }}-${{ matrix.os_arch }}**' |