Skip to content

Push Release to Server #87

Push Release to Server

Push Release to Server #87

name: 'Push Release to Server'
on:
workflow_dispatch:
jobs:
Git-Subsystem-Manager:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Update Git Version
run: |
mkdir -p /tmp/artifacts
mkdir -p /tmp/artifacts/subsystem_manager
cp -r ./Subsystem-Manager/subsystem-manager-uv/* /tmp/artifacts/subsystem_manager
- name: 'Upload Artifact'
uses: actions/upload-artifact@v4
with:
name: subsystem-manager-github-latest
path: /tmp/artifacts/*
compression-level: 9
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/subsystem-manager-uv/midori_program_ver.txt /tmp/artifacts
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install Dependencies (UV)
run: |
pip install UV
- name: Install Dependencies (Requirements.txt)
run: |
pip install -r ./Subsystem-Manager/model_installer/requirements.txt
- name: Build
run: |
cd Subsystem-Manager/subsystem-manager-uv
uv run pyinstaller --onedir --clean --distpath /tmp/artifacts/${{ matrix.os }}/ --add-data midori_program_ver.txt:. subsystem_manager.py
cd ../..
- 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, Git-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/subsystem-manager-uv/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: Github Artifacts
run: |
cd subsystem-manager-github-latest/subsystem_manager
zip -r ../../subsystem_manager-git.zip *
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 "subsystem_manager-git.zip" --filename "subsystem_manager-git.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"