forked from PixlOne/logiops
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
6 changed files
with
102 additions
and
49 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/[email protected] | ||
with: | ||
files: logiops-${{ github.ref_name }}.tar.gz |
This file was deleted.
Oops, something went wrong.
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
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
This file was deleted.
Oops, something went wrong.