Push Release to Server #3
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 Upload 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 | |
- name: Update Version Name | |
run: | | |
mkdir -p /tmp/artifacts | |
cp ./other_files/midori_program_ver.txt /tmp/artifacts | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install Dependencies | |
run: | | |
pip install pyinstaller | |
pip install -r ./other_files/model_installer/requirements.txt | |
- name: Build | |
run: | | |
pyinstaller --onefile --clean --distpath /tmp/artifacts/ --add-data ./other_files/midori_program_ver.txt:. ./other_files/model_installer/subsystem_manager.py | |
- name: 'Upload Artifact' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: subsystem-manager-${{ matrix.os }} | |
path: /tmp/artifacts/* | |
compression-level: 0 | |
Push-Build-To-Server: | |
needs: [Build-Subsystem-Manager] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- 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 ./other_files/midori_program_ver.txt . | |
pip install requests | |
- name: View Artifacts | |
run: | | |
ls | |
- name: Linux Artifacts | |
run: | | |
mv subsystem-manager-ubuntu-20.04 subsystem_manager | |
tar -cvzf model_installer_linux.tar.gz -C subsystem_manager . | |
rm -rf subsystem_manager | |
- name: Windows Artifacts | |
run: | | |
mv subsystem-manager-windows-latest subsystem_manager | |
zip -r model_installer_windows.zip -j subsystem_manager/* | |
rm -rf subsystem_manager | |
- name: Mac Artifacts | |
run: | | |
mv subsystem-manager-macos-latest subsystem_manager | |
zip -r model_installer_mac.zip -j subsystem_manager/* | |
rm -rf subsystem_manager | |
- name: Download the Uploader | |
run: | | |
curl -O https://tea-cup.midori-ai.xyz/download/git_uploader.py | |
- name: Upload Artifacts to Server | |
run: | | |
python3.10 git_uploader.py --type Linux --key ${{ secrets.UPLOADER_APIKEY }} --file "model_installer_linux.tar.gz" --filename "model_installer_linux.tar.gz" | |
python3.10 git_uploader.py --type Windows --key ${{ secrets.UPLOADER_APIKEY }} --file "model_installer_windows.zip" --filename "model_installer_windows.zip" | |
python3.10 git_uploader.py --type Mac --key ${{ secrets.UPLOADER_APIKEY }} --file "model_installer_mac.zip" --filename "model_installer_mac.zip" | |
python3.10 git_uploader.py --type Linux --key ${{ secrets.UPLOADER_APIKEY }} --file "midori_program_ver.txt" --filename "midori_program_ver.txt" |