Build and Release #194
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 | |
on: workflow_dispatch | |
permissions: write-all | |
jobs: | |
Windows: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- windows-latest | |
architecture: | |
- x64 | |
- x86 | |
- arm64 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Check-out repository | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.8' | |
cache: 'pip' | |
cache-dependency-path: | | |
requirements.txt | |
- name: Update Pip and Install Requirements | |
run: | | |
python -m pip install pip setuptools -U | |
python -m pip install -r requirements.txt | |
python -m pip uninstall numpy -y | |
python -m pip uninstall scipy -y | |
- name: Build on Windows | |
run: > | |
python nuitka_build.py --github -y | |
- name: Delete Useless Files and Compress with upx | |
run: | | |
cmd /K rmdir /s /q .\build\MCSL2.dist\zstandard | |
cmd /K del /f /q .\build\MCSL2.dist\_asyncio.pyd | |
cmd /K del /f /q .\build\MCSL2.dist\_multiprocessing.pyd | |
cmd /K del /f /q .\build\MCSL2.dist\_queue.pyd | |
cmd /K del /f /q .\build\MCSL2.dist\pyexpat.pyd | |
cmd /K del /f /q .\build\MCSL2.dist\qt5qml.dll | |
cmd /K del /f /q .\build\MCSL2.dist\qt5qmlmodels.dll | |
cmd /K del /f /q .\build\MCSL2.dist\qt5quick.dll | |
.\upx.exe -9 build/MCSL2.dist/_ctypes.pyd build/MCSL2.dist/_decimal.pyd build/MCSL2.dist/_elementtree.pyd build/MCSL2.dist/_lzma.pyd build/MCSL2.dist/_overlapped.pyd build/MCSL2.dist/_socket.pyd build/MCSL2.dist/_ssl.pyd build/MCSL2.dist/_win32sysloader.pyd build/MCSL2.dist/libffi-7.dll build/MCSL2.dist/libcrypto-1_1.dll build/MCSL2.dist/libssl-1_1.dll build/MCSL2.dist/MCSL2.exe build/MCSL2.dist/python38.dll build/MCSL2.dist/pythoncom38.dll build/MCSL2.dist/pywintypes38.dll build/MCSL2.dist/qt5core.dll build/MCSL2.dist/qt5dbus.dll build/MCSL2.dist/qt5gui.dll build/MCSL2.dist/qt5multimedia.dll build/MCSL2.dist/qt5network.dll build/MCSL2.dist/qt5printsupport.dll build/MCSL2.dist/qt5svg.dll build/MCSL2.dist/qt5websockets.dll build/MCSL2.dist/qt5widgets.dll build/MCSL2.dist/qt5xml.dll build/MCSL2.dist/select.pyd build/MCSL2.dist/unicodedata.pyd build/MCSL2.dist/win32api.pyd build/MCSL2.dist/win32gui.pyd build/MCSL2.dist/win32print.pyd | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: MCSL2-${{ runner.os }}-${{ matrix.architecture }} | |
path: | | |
build/MCSL2.dist/**/* | |
Linux: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-latest | |
architecture: | |
- x64 | |
- x86 | |
- arm64 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Check-out repository | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.8' | |
cache: 'pip' | |
cache-dependency-path: | | |
requirements.txt | |
- name: Update Pip and Install Requirements | |
run: | | |
python -m pip install pip setuptools -U | |
python -m pip install -r requirements.txt | |
python -m pip uninstall numpy -y | |
python -m pip uninstall scipy -y | |
- name: Install Dependencies for Linux | |
run: | | |
sudo apt-get install -y libfuse2 | |
sudo apt-get install -y upx-ucl | |
- name: Build on Linux | |
run: > | |
python nuitka_build.py --github -y | |
- name: Delete Useless Files and Compress with upx | |
run: | | |
cd build | |
cd MCSL2.dist | |
rm -r zstandard | |
sudo rm libQt5Quick.so.5 | |
sudo rm libQt5Qml.so.5 | |
sudo rm libQt5QmlModels.so.5 | |
sudo rm _asyncio.so | |
sudo rm _multiprocessing.so | |
sudo rm _queue.so | |
upx -9 MCSL2.bin | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: MCSL2-${{ runner.os }}-${{ matrix.architecture }} | |
path: | | |
build/MCSL2.dist/**/* | |
Release: | |
runs-on: ubuntu-latest | |
needs: | |
- Windows | |
- Linux | |
strategy: | |
matrix: | |
mcsl2version: | |
- 2.2.2.1 | |
steps: | |
- uses: szenius/[email protected] | |
with: | |
timezoneLinux: 'Asia/Shanghai' | |
- name: Install Tools | |
run: sudo apt install p7zip-full -y | |
- name: Download Artifacts | |
uses: actions/download-artifact@v3 | |
- name: Check-out repository | |
uses: actions/checkout@v3 | |
with: | |
path: repo | |
- name: Compress Artifacts | |
run: | | |
7z a -tzip "MCSL2-${{ matrix.mcsl2version }}-Windows-x64.zip" "./MCSL2-Windows-x64/*" | |
7z a -tzip "MCSL2-${{ matrix.mcsl2version }}-Windows-x86.zip" "./MCSL2-Windows-x86/*" | |
7z a -tzip "MCSL2-${{ matrix.mcsl2version }}-Windows-arm64.zip" "./MCSL2-Windows-arm64/*" | |
7z a -tzip "MCSL2-${{ matrix.mcsl2version }}-Linux-x64.zip" "./MCSL2-Linux-x64/*" | |
7z a -tzip "MCSL2-${{ matrix.mcsl2version }}-Linux-x86.zip" "./MCSL2-Linux-x86/*" | |
7z a -tzip "MCSL2-${{ matrix.mcsl2version }}-Linux-arm64.zip" "./MCSL2-Linux-arm64/*" | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
body_path: ./repo/ChangeLog.md | |
prerelease: false | |
draft: false | |
tag_name: v${{ matrix.mcsl2version }} | |
files: | | |
*.zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |