diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml new file mode 100644 index 0000000..86b6d61 --- /dev/null +++ b/.github/workflows/build-test.yml @@ -0,0 +1,55 @@ +name: Build test +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build: + name: Build + runs-on: ubuntu-latest + container: ${{ matrix.container }} + strategy: + matrix: + container: [ 'ubuntu:latest', 'ubuntu:20.04', 'fedora:latest', 'archlinux:base-devel' ] + + steps: + - name: Install dependencies (Ubuntu) + if: startsWith(matrix.container, 'ubuntu') + env: + DEBIAN_FRONTEND: noninteractive + TZ: Etc/UTC + run: | + apt-get update -y -q + apt-get install -y -q \ + build-essential cmake git pkg-config \ + libevdev-dev libudev-dev libconfig++-dev libglib2.0-dev + + - name: Install dependencies (Fedora) + if: startsWith(matrix.container, 'fedora') + run: | + dnf update -y + dnf install -y \ + cmake git libevdev-devel \ + systemd-devel libconfig-devel gcc-c++ glib2-devel + + - name: Install dependencies (Arch Linux) + if: startsWith(matrix.container, 'archlinux') + run: | + pacman -Syu --noconfirm \ + cmake git libevdev libconfig systemd-libs glib2 + + - name: Checkout repository + uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Build LogiOps + run: | + cmake -B build \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_CXX_FLAGS="-Werror" + cmake --build build -j$(nproc) diff --git a/.github/workflows/make-release.yml b/.github/workflows/make-release.yml new file mode 100644 index 0000000..abdbf5a --- /dev/null +++ b/.github/workflows/make-release.yml @@ -0,0 +1,33 @@ +name: Publish release tarball +on: + push: + tags: + - 'v*.*' + +jobs: + publish: + name: Publish release tarball + runs-on: ubuntu-latest + strategy: + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Add version info + run: echo ${{ github.ref_name }} > version.txt + + - name: Remove git repo information + run: find . -name '.git' | xargs rm -rf + + - name: Create tarball + run: | + tar cvfz /tmp/logiops.tar.gz . + mv /tmp/logiops.tar.gz logiops-${{ github.ref_name }}.tar.gz + + - name: Upload release asset + uses: softprops/action-gh-release@v0.1.15 + with: + files: logiops-${{ github.ref_name }}.tar.gz diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index c2c32ea..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: release-ci -on: - push: - types: - - tags - workflow_dispatch: - -jobs: - job: - name: ${{ matrix.os }}-release - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] - include: - - os: ubuntu-latest - triplet: x64-linux - installDependencies: 'sudo apt-get update -m && sudo apt-get install libconfig++-dev libevdev-dev libudev-dev' - - steps: - - uses: actions/checkout@v1 - with: - submodules: true - - name: Install dependencies - run: '${{ matrix.installDependencies }}' - - name: Run CMake+Make - uses: lukka/run-cmake@v2 - id: runcmake - with: - cmakeGenerator: 'UnixMakefiles' - cmakeListsOrSettingsJson: 'CMakeListsTxtBasic' - cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt' - cmakeAdditionalArgs: '-DFORCE_BUILD_HIDPP=True' - buildWithCMakeArgs: '-- -v' - cmakeBuildType: 'Release' - buildDirectory: '${{ runner.workspace }}/build/' diff --git a/CMakeLists.txt b/CMakeLists.txt index 5661b95..e409a57 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,10 +13,10 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) option(USE_USER_BUS "Uses user bus" OFF) -find_package(Git REQUIRED) +find_package(Git) # Set version number and update submodules -if(EXISTS ${CMAKE_SOURCE_DIR}/.git) +if(EXISTS ${CMAKE_SOURCE_DIR}/.git AND GIT_FOUND) execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags OUTPUT_VARIABLE LOGIOPS_VERSION RESULT_VARIABLE LOGIOPS_VERSION_RET @@ -36,9 +36,10 @@ elseif(EXISTS ${CMAKE_SOURCE_DIR}/version.txt) file(READ version.txt LOGIOPS_VERSION) string(REGEX REPLACE "\n$" "" LOGIOPS_VERSION ${LOGIOPS_VERSION}) - IF(NOT EXISTS src/ipcgull) - message(FATAL_ERROR "Missing ipcgull submodule") - endif() +endif() + +IF(NOT EXISTS src/ipcgull) + message(FATAL_ERROR "Missing ipcgull submodule") endif() if(NOT LOGIOPS_VERSION) diff --git a/README.md b/README.md index 49a8db4..86a426b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ -# logiops +# LogiOps + +![Build Status](https://github.com/PixlOne/logiops/actions/workflows/main.yml/badge.svg) This is an unofficial driver for Logitech mice and keyboard. @@ -16,17 +18,17 @@ Default location for the configuration file is /etc/logid.cfg, but another can b This project requires a C++20 compiler, `cmake`, `libevdev`, `libudev`, `glib`, and `libconfig`. For popular distributions, I've included commands below. -**Arch Linux:** `sudo pacman -S base-devel cmake g++ libevdev libconfig pkgconf glib2` +**Arch Linux:** `sudo pacman -S base-devel cmake libevdev libconfig systemd-libs glib2` -**Debian/Ubuntu:** `sudo apt install git cmake g++ libevdev-dev libudev-dev libconfig++-dev libglib2.0-dev` +**Debian/Ubuntu:** `sudo apt install build-essential cmake pkg-config libevdev-dev libudev-dev libconfig++-dev libglib2.0-dev` -**Fedora:** `sudo dnf install cmake libevdev-devel systemd-devel libconfig-devel gcc-c++ glib2` +**Fedora:** `sudo dnf install cmake libevdev-devel systemd-devel libconfig-devel gcc-c++ glib2-devel` **Gentoo Linux:** `sudo emerge dev-libs/libconfig dev-libs/libevdev dev-libs/glib dev-util/cmake virtual/libudev` -**Solus:** `sudo eopkg install cmake libevdev-devel libconfig-devel libgudev-devel glib2` +**Solus:** `sudo eopkg install cmake libevdev-devel libconfig-devel libgudev-devel glib2-devel` -**openSUSE:** `sudo zypper install cmake libevdev-devel systemd-devel libconfig-devel gcc-c++ libconfig++-devel libudev-devel glib2` +**openSUSE:** `sudo zypper install cmake libevdev-devel systemd-devel libconfig-devel gcc-c++ libconfig++-devel libudev-devel glib2-devel` ## Building diff --git a/version.txt b/version.txt deleted file mode 100644 index 268b033..0000000 --- a/version.txt +++ /dev/null @@ -1 +0,0 @@ -v0.3.0