From 2cbea801da7fe93b08a7f71aad236118bd809540 Mon Sep 17 00:00:00 2001 From: Hydrus Network Developer Date: Wed, 9 Nov 2022 17:56:38 -0600 Subject: [PATCH] restoring build script --- .github/workflows/release.yml | 145 +++++++++++++++++++++++++++++++++- 1 file changed, 144 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e48c752e..9e7fb9c7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,6 +5,144 @@ on: - 'v*' jobs: + build-macos: + runs-on: macos-11 + steps: + - + name: Checkout + uses: actions/checkout@v3 + - + name: Setup FFMPEG + uses: FedericoCarboni/setup-ffmpeg@v1.1.0 + id: setup_ffmpeg + with: + token: ${{ secrets.GITHUB_TOKEN }} + - + name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: 3.9 + - + name: Install mkdocs-material + run: python3 -m pip install mkdocs-material + - + name: Build docs to /help + run: mkdocs build -d help + - + name: Install PyOxidizer + run: python3 -m pip install pyoxidizer + - + name: Build Hydrus + run: | + cd $GITHUB_WORKSPACE + cp ${{ steps.setup_ffmpeg.outputs.ffmpeg-path }} bin/ + cp static/build_files/macos/pyoxidizer.bzl pyoxidizer.bzl + cp static/build_files/macos/requirements.txt requirements.txt + basename $(rustc --print sysroot) | sed -e "s/^stable-//" > triple.txt + pyoxidizer build --release + cd build/$(head -n 1 triple.txt)/release + mkdir -p "Hydrus Network.app/Contents/MacOS" + mkdir -p "Hydrus Network.app/Contents/Resources" + mkdir -p "Hydrus Network.app/Contents/Frameworks" + mv install/static/icon.icns "Hydrus Network.app/Contents/Resources/icon.icns" + cp install/static/build_files/macos/Info.plist "Hydrus Network.app/Contents/Info.plist" + cp install/static/build_files/macos/ReadMeFirst.rtf ./ReadMeFirst.rtf + cp install/static/build_files/macos/running_from_app "install/running_from_app" + ln -s /Applications ./Applications + mv install/* "Hydrus Network.app/Contents/MacOS/" + rm -rf install + - + name: Build DMG + run: | + cd $GITHUB_WORKSPACE + temp_dmg="$(mktemp).dmg" + hdiutil create "$temp_dmg" -ov -volname "HydrusNetwork" -fs HFS+ -format UDZO -srcfolder "$GITHUB_WORKSPACE/build/$(head -n 1 triple.txt)/release" + mv "$temp_dmg" HydrusNetwork.dmg + - + name: Upload a Build Artifact + uses: actions/upload-artifact@v3 + with: + name: MacOS-DMG + path: HydrusNetwork.dmg + if-no-files-found: error + retention-days: 2 + + build-ubuntu: + runs-on: ubuntu-20.04 + steps: + - + name: Checkout + uses: actions/checkout@v3 + with: + path: hydrus + - + name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: 3.9 + architecture: x64 + - + name: APT Install + run: | + sudo apt-get update + sudo apt-get install -y libmpv1 + - + name: Pip Install + run: python3 -m pip install -r hydrus/static/build_files/linux/requirements.txt + - + name: Build docs to /help + run: mkdocs build -d help + working-directory: hydrus + #- name: Cache Qt + # id: cache-qt + # uses: actions/cache@v1 + # with: + # path: Qt + # key: ${{ runner.os }}-QtCache + #- + # name: Install Qt + # uses: jurplel/install-qt-action@v2 + # with: + # install-deps: true + # setup-python: 'false' + # modules: qtcharts qtwidgets qtgui qtcore + # cached: ${{ steps.cache-qt.outputs.cache-hit }} + - + name: Build Hydrus + run: | + cp hydrus/static/build_files/linux/client.spec client.spec + cp hydrus/static/build_files/linux/server.spec server.spec + pyinstaller server.spec + pyinstaller client.spec + - + name: Remove Chonk + run: | + find dist/client/ -type f -name "*.pyc" -delete + while read line; do find dist/client/ -type f -name "${line}" -delete ; done < hydrus/static/build_files/linux/files_to_delete.txt + - + name: Remove Surplus File + run: | + rm -f dist/client/libxkbcommon.so* + - + name: Set Permissions + run: | + sudo chown --recursive 1000:1000 dist/client + sudo find dist/client -type d -exec chmod 0755 {} \; + sudo chmod +x dist/client/client dist/client/server dist/client/bin/swfrender_linux + - + name: Compress Client + run: | + mv dist/client "dist/Hydrus Network" + tar -czvf Ubuntu-Extract.tar.gz -C dist "Hydrus Network" + - + name: Upload a Build Artifact + uses: actions/upload-artifact@v3 + with: + name: Ubuntu-Extract + path: Ubuntu-Extract.tar.gz + if-no-files-found: error + retention-days: 2 + build-windows: runs-on: windows-2019 steps: @@ -104,7 +242,7 @@ jobs: create-release: name: Create Release Entry runs-on: ubuntu-20.04 - needs: [build-windows] + needs: [build-windows, build-ubuntu, build-macos] steps: - name: Checkout code @@ -124,6 +262,8 @@ jobs: mkdir ubuntu windows mv Windows-Install/HydrusInstaller.exe Hydrus.Network.${{ env.version_short }}.-.Windows.-.Installer.exe mv Windows-Extract/Windows-Extract.zip Hydrus.Network.${{ env.version_short }}.-.Windows.-.Extract.only.zip + mv Ubuntu-Extract/Ubuntu-Extract.tar.gz Hydrus.Network.${{ env.version_short }}.-.Linux.-.Executable.tar.gz + mv MacOS-DMG/HydrusNetwork.dmg Hydrus.Network.${{ env.version_short }}.-.macOS.-.App.dmg - name: Release new uses: softprops/action-gh-release@v1 @@ -132,4 +272,7 @@ jobs: files: | Hydrus.Network.${{ env.version_short }}.-.Windows.-.Installer.exe Hydrus.Network.${{ env.version_short }}.-.Windows.-.Extract.only.zip + Hydrus.Network.${{ env.version_short }}.-.Linux.-.Executable.tar.gz + Hydrus.Network.${{ env.version_short }}.-.macOS.-.App.dmg + env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}