2024-01-08 22:06:36 +00:00
|
|
|
name: Release-Linux
|
2024-01-08 21:51:04 +00:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- 'v*'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build-ubuntu:
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2024-02-19 21:18:12 +00:00
|
|
|
uses: actions/checkout@v4
|
2024-01-08 21:51:04 +00:00
|
|
|
with:
|
|
|
|
path: hydrus
|
|
|
|
-
|
|
|
|
name: Setup Python
|
2024-02-19 21:18:12 +00:00
|
|
|
uses: actions/setup-python@v5
|
2024-01-08 21:51:04 +00:00
|
|
|
with:
|
2024-04-17 20:22:16 +00:00
|
|
|
python-version: '3.11'
|
2024-01-08 21:51:04 +00:00
|
|
|
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: Build Hydrus
|
|
|
|
run: |
|
|
|
|
cp hydrus/static/build_files/linux/hydrus_client.spec hydrus_client.spec
|
|
|
|
cp hydrus/static/build_files/linux/hydrus_server.spec hydrus_server.spec
|
|
|
|
pyinstaller hydrus_server.spec
|
|
|
|
pyinstaller hydrus_client.spec
|
|
|
|
-
|
|
|
|
name: Remove Chonk
|
|
|
|
run: |
|
|
|
|
find dist/hydrus_client/ -type f -name "*.pyc" -delete
|
|
|
|
while read line; do find dist/hydrus_client/ -type f -name "${line}" -delete ; done < hydrus/static/build_files/linux/files_to_delete.txt
|
|
|
|
-
|
|
|
|
name: Remove Surplus File
|
|
|
|
run: |
|
|
|
|
rm -f dist/hydrus_client/libxkbcommon.so*
|
|
|
|
-
|
|
|
|
name: Set Permissions
|
|
|
|
run: |
|
|
|
|
sudo chown --recursive 1000:1000 dist/hydrus_client
|
|
|
|
sudo find dist/hydrus_client -type d -exec chmod 0755 {} \;
|
|
|
|
sudo chmod +x dist/hydrus_client/hydrus_client dist/hydrus_client/hydrus_server dist/hydrus_client/bin/swfrender_linux
|
|
|
|
-
|
|
|
|
name: Compress Client
|
|
|
|
run: |
|
|
|
|
mv dist/hydrus_client "dist/Hydrus Network"
|
|
|
|
tar --zstd -cvf Ubuntu-Extract.tar.zst -C dist "Hydrus Network"
|
|
|
|
-
|
|
|
|
name: Extract Version Metadata
|
|
|
|
id: meta
|
|
|
|
run: |
|
|
|
|
echo "version=${GITHUB_REF##*/}" >> $GITHUB_ENV
|
|
|
|
echo "version_short=${GITHUB_REF##*/v}" >> $GITHUB_ENV
|
|
|
|
-
|
|
|
|
name: Rename Files
|
|
|
|
run: |
|
2024-02-19 21:18:12 +00:00
|
|
|
mv Ubuntu-Extract.tar.zst Hydrus.Network.${{ env.version_short }}.-.Linux.-.Executable.tar.zst
|
2024-01-08 21:51:04 +00:00
|
|
|
-
|
|
|
|
name: Upload Files
|
2024-03-13 01:04:14 +00:00
|
|
|
uses: softprops/action-gh-release@v2
|
2024-01-08 21:51:04 +00:00
|
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
|
|
with:
|
|
|
|
files: |
|
|
|
|
Hydrus.Network.${{ env.version_short }}.-.Linux.-.Executable.tar.zst
|