diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a19ce97..8f41b48 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,6 +26,9 @@ jobs: dotnet-version: 7.0.x include-prerelease: true + - name: Setup WSL + uses: Vampire/setup-wsl@v1.2.0 + - name: Restore dependencies run: dotnet restore @@ -84,9 +87,29 @@ jobs: # continue-on-error: false # run: | # dotnet publish -p:PublishProfile=AndroidARM64.pubxml - - - - name: Upload win-x64 + - name: Create Debian Package + continue-on-error: false + shell: wsl-bash -u root + run: | + mkdir Debian64 + mkdir Debian64/etc/hisp + mkdir Debian64/systemd/system + mkdir Debian64/usr/bin + mkdir Debian64/usr/lib + mkdir Debian64/DEBIAN + cp -r HorseIsleServer/HISPd/Resources/DEBIAN/* Debian64/DEBIAN + chmod +x Debian64/DEBIAN/postinst + chmod +x Debian64/DEBIAN/postrm + cp HorseIsleServer/HISPd/bin/x64/Linux/net7.0/linux-x64/publish/HISPd Debian64/usr/bin/HISPd + chmod +x Debian64/usr/bin/HISPd + cp HorseIsleServer/HISPd/bin/x64/Linux/net7.0/linux-x64/publish/libe_sqlite3.so Debian64/usr/lib/libe_sqlite3.so + cp HorseIsleServer/HISPd/bin/x64/Linux/net7.0/linux-x64/publish/HI1.MAP Debian64/etc/hisp/HI1.MAP + cp HorseIsleServer/HISPd/bin/x64/Linux/net7.0/linux-x64/publish/server.properties Debian64/etc/hisp/server.properties + cp HorseIsleServer/HISPd/bin/x64/Linux/net7.0/linux-x64/publish/CrossDomainPolicy.xml Debian64/etc/hisp/CrossDomainPolicy.xml + cp HorseIsleServer/HISPd/bin/x64/Linux/net7.0/linux-x64/publish/gamedata.json Debian64/etc/hisp/gamedata.json + dpkg-deb --build Debian64 + + - name: Upload win-x64 uses: actions/upload-artifact@v2 with: name: HISP-Win64 @@ -165,6 +188,13 @@ jobs: # path: HorseIsleServer/HISPd/bin/arm64/Android/net7.0/android-arm64/publish/ + - name: Upload Debian package + uses: actions/upload-artifact@v2 + with: + name: HISP-DebPackage + path: Debian64.deb + + - name: Upload Website (master) uses: actions/upload-artifact@v2 with: diff --git a/HorseIsleServer/HISPd/HISPd.csproj.user b/HorseIsleServer/HISPd/HISPd.csproj.user deleted file mode 100644 index 86a0523..0000000 --- a/HorseIsleServer/HISPd/HISPd.csproj.user +++ /dev/null @@ -1,6 +0,0 @@ - - - - <_LastSelectedProfileId>C:\Users\User\Documents\git\HISP\HorseIsleServer\HISPd\Properties\PublishProfiles\AndroidARM.pubxml - - \ No newline at end of file diff --git a/HorseIsleServer/HISPd/Resources/DEBIAN/conffiles b/HorseIsleServer/HISPd/Resources/DEBIAN/conffiles new file mode 100644 index 0000000..5ecd5c1 --- /dev/null +++ b/HorseIsleServer/HISPd/Resources/DEBIAN/conffiles @@ -0,0 +1,2 @@ +/etc/hisp/server.properties +/etc/hisp/CrossDomainPolicy.xml diff --git a/HorseIsleServer/HISPd/Resources/DEBIAN/control b/HorseIsleServer/HISPd/Resources/DEBIAN/control new file mode 100644 index 0000000..d7cc254 --- /dev/null +++ b/HorseIsleServer/HISPd/Resources/DEBIAN/control @@ -0,0 +1,7 @@ +Package: hisp +Version: 1.6.1 +Depends: coreutils,systemd,mariadb-server,libsqlite3-dev +Maintainer: Islehorse +Homepage: https://islehorse.com +Architecture: amd64 +Description: Open Source Implementation of the flash game "Horse Isle" server. diff --git a/HorseIsleServer/HISPd/Resources/DEBIAN/postinst b/HorseIsleServer/HISPd/Resources/DEBIAN/postinst new file mode 100644 index 0000000..62fe485 --- /dev/null +++ b/HorseIsleServer/HISPd/Resources/DEBIAN/postinst @@ -0,0 +1,8 @@ +#!/bin/sh + +useradd horseisle +chown -R horseisle /etc/hisp +systemctl enable HISP.service +systemctl start HISP + +echo "Make sure to edit /etc/hisp/server.properties!" diff --git a/HorseIsleServer/HISPd/Resources/DEBIAN/postrm b/HorseIsleServer/HISPd/Resources/DEBIAN/postrm new file mode 100644 index 0000000..f425856 --- /dev/null +++ b/HorseIsleServer/HISPd/Resources/DEBIAN/postrm @@ -0,0 +1,4 @@ +#!/bin/sh +systemctl stop HISP +systemctl disable HISP +userdel horseisle