mirror of
https://github.com/PixlOne/logiops.git
synced 2025-07-13 12:52:42 +08:00
Add GitHub Actions for build test and releases
Adds a build test for ubuntu (latest, 20.04), archlinux, and fedora and makes a tarball including submodules.
This commit is contained in:
parent
a96036c97d
commit
bb8e0b4a78
55
.github/workflows/build-test.yml
vendored
Normal file
55
.github/workflows/build-test.yml
vendored
Normal file
@ -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)
|
33
.github/workflows/make-release.yml
vendored
Normal file
33
.github/workflows/make-release.yml
vendored
Normal file
@ -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
|
37
.github/workflows/release.yml
vendored
37
.github/workflows/release.yml
vendored
@ -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/'
|
@ -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)
|
||||
|
14
README.md
14
README.md
@ -1,4 +1,6 @@
|
||||
# logiops
|
||||
# LogiOps
|
||||
|
||||

|
||||
|
||||
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
|
||||
|
||||
|
@ -1 +0,0 @@
|
||||
v0.3.0
|
Loading…
Reference in New Issue
Block a user