Push Release to Server #85
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: 'Push Release to Server' | |
on: | |
workflow_dispatch: | |
jobs: | |
Build-Subsystem-Manager: | |
strategy: | |
matrix: | |
os: [ubuntu-20.04, windows-latest, macos-latest] | |
python: ['3.10'] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Update Version Name | |
run: | | |
mkdir -p /tmp/artifacts | |
cp ./Subsystem-Manager/midori_program_ver.txt /tmp/artifacts | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install Dependencies (Pyinstaller) | |
run: | | |
pip install pyinstaller | |
- name: Install Dependencies (Requirements.txt) | |
run: | | |
pip install -r ./Subsystem-Manager/model_installer/requirements.txt | |
- name: Build | |
run: | | |
pyinstaller --onedir --clean --distpath /tmp/artifacts/${{ matrix.os }}/ --add-data ./Subsystem-Manager/midori_program_ver.txt:. ./Subsystem-Manager/model_installer/subsystem_manager.py | |
- name: 'Upload Artifact' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: subsystem-manager-${{ matrix.os }} | |
path: /tmp/artifacts/${{ matrix.os }}/* | |
compression-level: 9 | |
Push-Build-To-Server: | |
needs: [Build-Subsystem-Manager] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Fetch Artifacts | |
uses: actions/download-artifact@v4 | |
- name: Install Dependencies | |
run: | | |
cp ./Subsystem-Manager/midori_program_ver.txt . | |
pip install requests cryptography | |
- name: Linux Artifacts | |
run: | | |
tar -cvvvzf model_installer_linux.tar.gz -C subsystem-manager-ubuntu-20.04/subsystem_manager subsystem_manager _internal | |
- name: Windows Artifacts | |
run: | | |
cd subsystem-manager-windows-latest/subsystem_manager | |
zip -r ../../model_installer_windows.zip subsystem_manager.exe _internal | |
cd ../../ | |
- name: Mac Artifacts | |
run: | | |
cd subsystem-manager-macos-latest/subsystem_manager | |
zip -r ../../model_installer_mac.zip subsystem_manager _internal | |
cd ../../ | |
- name: Download the Uploader | |
run: | | |
curl -O https://tea-cup.midori-ai.xyz/download/midori_ai_downloader | |
chmod +x midori_ai_downloader | |
./midori_ai_downloader git_uploader.py | |
- name: Upload Artifacts to Server | |
run: | | |
python3.10 git_uploader.py --type Linux --username "${{ secrets.MIDORI_AI_USERNAME }}" --password "${{ secrets.MIDORI_AI_PASSWORD }}" --twoflogin "${{ secrets.MIDORI_AI_TFA }}" --file "model_installer_linux.tar.gz" --filename "model_installer_linux.tar.gz" | |
python3.10 git_uploader.py --type Windows --username "${{ secrets.MIDORI_AI_USERNAME }}" --password "${{ secrets.MIDORI_AI_PASSWORD }}" --twoflogin "${{ secrets.MIDORI_AI_TFA }}" --file "model_installer_windows.zip" --filename "model_installer_windows.zip" | |
python3.10 git_uploader.py --type Mac --username "${{ secrets.MIDORI_AI_USERNAME }}" --password "${{ secrets.MIDORI_AI_PASSWORD }}" --twoflogin "${{ secrets.MIDORI_AI_TFA }}" --file "model_installer_mac.zip" --filename "model_installer_mac.zip" | |
python3.10 git_uploader.py --type Linux --username "${{ secrets.MIDORI_AI_USERNAME }}" --password "${{ secrets.MIDORI_AI_PASSWORD }}" --twoflogin "${{ secrets.MIDORI_AI_TFA }}" --file "midori_program_ver.txt" --filename "midori_program_ver.txt" |