Sonolus Server v1.6.3 #46
Workflow file for this run
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 (linux-x64) | |
on: | |
release: | |
types: [published] | |
workflow_dispatch: | |
env: | |
VERSION: ${{ github.ref_name }} | |
jobs: | |
linux-x64-build: | |
runs-on: ubuntu-20.04 | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Preparing Sonolus Server Source Code | |
run: | | |
sudo apt search openssl | |
git clone --recursive https://github.com/SonolusHaniwa/sonolus-server-cpp sources | |
- name: Preparing C/C++ Compiler | |
run: | | |
sudo apt update | |
sudo apt install g++ libjsoncpp-dev libmysqlclient-dev libssl-dev libsqlite3-dev sqlite3 libcurl4-openssl-dev libzip-dev libcurl4 -y | |
- name: Checking C/C++ Compiler | |
run: | | |
g++ --version | |
- name: Compiling Sonolus Server for Linux x64 | |
run: | | |
mkdir packages | |
cd sources | |
g++ main.cpp -o../packages/sonolus -ldl -lmysqlclient -lpthread -lcrypto -lssl -ljsoncpp -lsqlite3 -DENABLE_SQLITE -DENABLE_MYSQL -std=c++14 -O2 -w -DENABLE_CURL -lcurl -DENABLE_ZIP -lzip | |
- name: Compiling Plugins | |
run: | | |
mkdir ./packages/plugins | |
cd sources | |
g++ plugins/libsonolush/libsonolush.cpp -o ../packages/plugins/libsonolush.so -fPIC -shared -ldl -lmysqlclient -lpthread -lcrypto -lssl -ljsoncpp -lsqlite3 -std=c++17 -O2 -DENABLE_MYSQL -DENABLE_SQLITE | |
mv plugins/libsonolush ../packages/plugins | |
g++ plugins/libonedrive/libonedrive.cpp -o ../packages/plugins/libonedrive.so -fPIC -shared -ldl -lmysqlclient -lpthread -lcrypto -lssl -ljsoncpp -lsqlite3 -std=c++17 -lcurl -DENABLE_MYSQL -DENABLE_SQLITE | |
mv plugins/libonedrive ../packages/plugins | |
- name: Preparing Package Environment | |
run: | | |
mv ./sources/config ./packages/config | |
mv ./sources/i18n ./packages/i18n | |
mv ./sources/data ./packages/data | |
mkdir ./packages/web | |
mv ./sources/web/css ./packages/web/ | |
mv ./sources/web/js ./packages/web/ | |
mv ./sources/web/html ./packages/web/ | |
mv ./sources/CODE_OF_CONDUCT.md ./packages/ | |
mv ./sources/LICENSE.txt ./packages/ | |
mv ./sources/README.md ./packages/ | |
mv ./sources/README_en.md ./packages/ | |
cd packages | |
sed -i 's/"mysql"/"sqlite"/g' ./config/config.json | |
sqlite3 sonolus.db ".read ../data.sql" | |
- name: Checking Sonolus Server for Linux x64 | |
run: | | |
cd packages | |
./sonolus plugin disable libonedrive | |
./sonolus help | |
- name: Packaging Sonolus Server for Linux x64 | |
run: | | |
cd packages | |
zip ../sonolus-server-linux-x64-${{ env.VERSION }}.zip ./* -r | |
- name: Uploading Sonolus Server for Linux x64 | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: sonolus-server-linux-x64-${{ env.VERSION }}.zip |