Skip to content

feat: impl linux build #1

feat: impl linux build

feat: impl linux build #1

Workflow file for this run

name: build-linux
on:
push:
branches:
- main # Adjust branch name if necessary
pull_request:
branches:
- main # Adjust branch name if necessary
jobs:
deployment:
name: build-linux
runs-on: ubuntu-latest
permissions: write-all
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y build-essential cmake g++ gdb make ninja-build rsync zip
- name: Check CMake version
run: cmake --version
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install Conan
run: |
sudo pip install conan==2.2.2
sudo conan config install https://bitbucket.org/telkom-workspace/gaboot-backend/downloads/config_linux.zip
- name: Install Package
run: sudo conan install conanfile.py -of=conan/Linux --build=missing
- name: Echo list of files before removal
run: ls
- name: Remove CMakeUserPresets.json
run: sudo rm CMakeUserPresets.json
- name: Echo list of files after removal
run: ls
- name: Configure CMakeList
run: sudo cmake -D CMAKE_BUILD_TYPE=Release -S. -Bbuild -G Ninja
- name: Build 64bit release Executable
run: |
sudo cmake --build ./build --config Release --target Gaboot --
- name: Check if Executable got built
run: if [ ! -f "build/Gaboot" ]; then exit 1; fi
- name: Move binary to new folder
run: |
sudo mkdir Linux
sudo mkdir Linux/postgres
sudo mkdir Linux/postgres/data
echo "SERVER_KEY=${{ secrets.SERVER_KEY }}" | sudo tee ./Linux/.env
echo "SECRET=${{ secrets.SECRET }}" | sudo tee -a ./Linux/.env
sudo cp -r src/assets Linux/assets
sudo cp config/config.json Linux/config.json
sudo cp config/pg_hba.conf Linux/postgres/data/pg_hba.conf
sudo cp config/supervisord.conf Linux/supervisord.conf
sudo cp Dockerfile Linux/Dockerfile
sudo cp docker-compose.yml Linux/docker-compose.yml
sudo cp build/Gaboot Linux/Gaboot
- name: Zip files
run: sudo zip -r Gaboot.zip Linux/Gaboot Linux/config.json Linux/Dockerfile Linux/docker-compose.yml Linux/supervisord.conf Linux/assets Linux/.env
- name: Upload binary to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./Gaboot.zip
tag: v1.0.0
asset_name: Gaboot.zip
overwrite: true
body: "Gaboot Release Binary"
repo_name: skript023/Gaboot