Pyonstaller Github Actions #10
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: Build and Release with PyInstaller | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build-windows: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.11' # Specify your Python version | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pyinstaller | |
if (Test-Path "OpenUtau-Dictionary-Editor\OU Dictionary Editor\requirements.txt") { pip install -r "OpenUtau-Dictionary-Editor\OU Dictionary Editor\requirements.txt" } | |
- name: Create Executable | |
run: | | |
pyinstaller --onefile --console --icon "OU Dictionary Editor\Assets\icon.ico" ` | |
--hidden-import "Assets.G2p.arpabet_plus" ` | |
--hidden-import "Assets.G2p.frenchG2p" ` | |
--hidden-import "Assets.G2p.germanG2p" ` | |
--hidden-import "Assets.G2p.italianG2p" ` | |
--hidden-import "Assets.G2p.jp_mono" ` | |
--hidden-import "Assets.G2p.millefeuilleG2p" ` | |
--hidden-import "Assets.G2p.portugueseG2p" ` | |
--hidden-import "Assets.G2p.russianG2p" ` | |
--hidden-import "Assets.G2p.spanishG2p" ` | |
"OpenUtau-Dictionary-Editor\OU Dictionary Editor\OpenUtau_Dictionary_Editor.pyw" | |
- name: Package Executable | |
run: | | |
echo "Creating package..." | |
mkdir -p "OU Dictionary Editor" | |
cp -r "dist/OpenUtau_Dictionary_Editor.exe" "OU Dictionary Editor/" | |
zip -r "OU-Dict-Editor-windows.zip" "OU Dictionary Editor/" | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: OU-Dict-Editor-windows.zip | |
asset_name: OU-Dict-Editor-windows.zip | |
asset_content_type: application/zip | |
build-linux: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.11' # Specify your Python version | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pyinstaller | |
if [ -f "OpenUtau-Dictionary-Editor/OU Dictionary Editor/requirements.txt" ]; then pip install -r "OpenUtau-Dictionary-Editor/OU Dictionary Editor/requirements.txt"; fi | |
- name: Create Executable | |
run: | | |
pyinstaller --onefile --console ` | |
--hidden-import "Assets.G2p.arpabet_plus" ` | |
--hidden-import "Assets.G2p.frenchG2p" ` | |
--hidden-import "Assets.G2p.germanG2p" ` | |
--hidden-import "Assets.G2p.italianG2p" ` | |
--hidden-import "Assets.G2p.jp_mono" ` | |
--hidden-import "Assets.G2p.millefeuilleG2p" ` | |
--hidden-import "Assets.G2p.portugueseG2p" ` | |
--hidden-import "Assets.G2p.russianG2p" ` | |
--hidden-import "Assets.G2p.spanishG2p" ` | |
"OpenUtau_Dictionary_Editor.pyw" | |
- name: Package Executable | |
run: | | |
echo "Creating package..." | |
mkdir -p "OU Dictionary Editor" | |
cp -r "dist/OpenUtau_Dictionary_Editor" "OU Dictionary Editor/" | |
zip -r "OU-Dict-Editor-linux.zip" "OU Dictionary Editor/" | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: OU-Dict-Editor-linux.zip | |
asset_name: OU-Dict-Editor-linux.zip | |
asset_content_type: application/zip | |
build-macos: | |
runs-on: macos-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.11' # Specify your Python version | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pyinstaller | |
if [ -f "OpenUtau-Dictionary-Editor/OU Dictionary Editor/requirements.txt" ]; then pip install -r "OpenUtau-Dictionary-Editor/OU Dictionary Editor/requirements.txt"; fi | |
- name: Create Executable | |
run: | | |
pyinstaller --onefile --console ` | |
--hidden-import "Assets.G2p.arpabet_plus" ` | |
--hidden-import "Assets.G2p.frenchG2p" ` | |
--hidden-import "Assets.G2p.germanG2p" ` | |
--hidden-import "Assets.G2p.italianG2p" ` | |
--hidden-import "Assets.G2p.jp_mono" ` | |
--hidden-import "Assets.G2p.millefeuilleG2p" ` | |
--hidden-import "Assets.G2p.portugueseG2p" ` | |
--hidden-import "Assets.G2p.russianG2p" ` | |
--hidden-import "Assets.G2p.spanishG2p" ` | |
"OpenUtau_Dictionary_Editor.pyw" | |
- name: Package Executable | |
run: | | |
echo "Creating package..." | |
mkdir -p "OU Dictionary Editor" | |
cp -r "dist/OpenUtau_Dictionary_Editor.app" "OU Dictionary Editor/" | |
zip -r "OU-Dict-Editor-macos.zip" "OU Dictionary Editor/" | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: OU-Dict-Editor-macos.zip | |
asset_name: OU-Dict-Editor-macos.zip | |
asset_content_type: application/zip |