From 5ea1eb17854fc56883d1a6b7ba0eba0968947101 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Boldi=C5=A1?= Date: Sun, 4 Sep 2022 18:01:30 +0200 Subject: [PATCH] Add GitHub actions and improve docs --- .github/workflows/release.yml | 46 +++++++++++++++++++++++++++++++++++ .gitignore | 3 ++- CMakeLists.txt | 4 +-- LICENCE | 2 +- README.md | 30 +++++++++++++++++++++++ 5 files changed, 81 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..78f4aae --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,46 @@ +name: Release + +on: + push: + tags: + - '*' + +jobs: + release: + runs-on: ubuntu-latest + steps: + - + name: Checkout repository + uses: actions/checkout@v3 + - + name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y cmake libglew-dev libglfw3-dev + - + name: Build artifacts + run: | + mkdir build-release + cmake -D CMAKE_BUILD_TYPE=Release -B build-release + cmake --build build-release -- -j $(($(nproc) * 3 / 4)) + - + name: Create release + id: create_release + uses: actions/create-release@v1 + with: + draft: false + prerelease: false + release_name: ${{ github.ref }} + tag_name: ${{ github.ref }} + env: + GITHUB_TOKEN: ${{ github.token }} + - + name: Upload artifacts + uses: actions/upload-release-asset@v1 + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: build-release/Mandelbrot + asset_name: Mandelbrot + asset_content_type: application/octet-stream + env: + GITHUB_TOKEN: ${{ github.token }} diff --git a/.gitignore b/.gitignore index 957dc7d..902739f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .vs .idea -cmake-build-* +build +build-* diff --git a/CMakeLists.txt b/CMakeLists.txt index 5cc4d4a..7fa82c3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,10 +2,10 @@ cmake_minimum_required(VERSION 3.16) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED YES) -set(CMAKE_CXX_EXTENSIONS YES) +set(CMAKE_CXX_EXTENSIONS NO) project(Mandelbrot VERSION 0.0.1 - DESCRIPTION "OpenGL Mandelbrot example" + DESCRIPTION "OpenGL Mandelbrot demo" LANGUAGES CXX) find_package(OpenGL REQUIRED) diff --git a/LICENCE b/LICENCE index bf4b2e4..e64a046 100644 --- a/LICENCE +++ b/LICENCE @@ -1,4 +1,4 @@ -Copyright 2020,2022 Richard Boldiš +Copyright 2020-2022 Richard Boldiš Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/README.md b/README.md index 1082c58..82a447c 100644 --- a/README.md +++ b/README.md @@ -15,3 +15,33 @@ - `1` - Point of interest 1 - `2` - Point of interest 2 - `Esc` - Exit + +## Build + +### Dependencies + +Ubuntu +```shell +apt install build-essential cmake libglew-dev libglfw3-dev +``` + +Archlinux +```shell +# Wayland +yay -S glew glfw-wayland + +# X11 +yay -S glew glfw-x11 +``` + +### Bootstrap +```shell +mkdir build +cd build +cmake .. +``` + +### Compile +```shell +cmake --build . -- -j $(($(nproc) * 3 / 4)) +```