-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
75 changed files
with
6,252 additions
and
885 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,221 @@ | ||
name: ci-build | ||
|
||
on: | ||
push: | ||
branches: | ||
- "**" | ||
pull_request: | ||
branches: | ||
- master | ||
- develop | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
docker_tag: | ||
- archlinux | ||
- fedora-30 | ||
- fedora-31 | ||
- fedora-32 | ||
- debian-stretch | ||
- debian-buster | ||
- ubuntu-18.04 | ||
- ubuntu-20.04 | ||
- opensuse-15.0 | ||
- opensuse-15.1 | ||
- centos-8 | ||
os: | ||
- ubuntu-latest | ||
|
||
runs-on: ${{ matrix.os }} | ||
env: | ||
DOCKER_IMG: jahnf/projecteur | ||
DOCKER_TAG: ${{ matrix.docker_tag }} | ||
MAKEFLAGS: -j2 | ||
CLOUDSMITH_USER: jahnf | ||
CLOUDSMITH_SUMMARY: ci-build from branch '${{ github.ref }}' | ||
CLOUDSMITH_DESC: For more information visit https://github.com/jahnf/Projecteur | ||
|
||
steps: | ||
# =================================================================================== | ||
# ---------- Add ~/.local/bin to PATH ---------- | ||
- run: | | ||
export LOCAL_BIN=~/.local/bin | ||
echo "::set-env name=PATH::${PATH}:${LOCAL_BIN}" | ||
# =================================================================================== | ||
# ---------- Checkout and build inside docker container ---------- | ||
- uses: actions/checkout@v1 | ||
- run: | | ||
export BRANCH=${GITHUB_REF/refs\/heads\//} | ||
echo Deteted branch: ${BRANCH} | ||
echo "::set-env name=BRANCH::${BRANCH}" | ||
- name: Pull ${{ matrix.docker_tag }} docker image | ||
run: docker pull ${DOCKER_IMG}:${{ matrix.docker_tag }} | ||
- name: docker create build container | ||
run: | | ||
docker run --name build --env MAKEFLAGS=${MAKEFLAGS} \ | ||
--env TRAVIS_BRANCH=${BRANCH} \ | ||
-d -v `pwd`:/source:ro -t ${DOCKER_IMG}:${{ matrix.docker_tag }} | ||
- name: cmake configuration | ||
run: docker exec build /bin/bash -c "mkdir -p /build/dist-pkg && cd /build && cmake /source" | ||
- name: cmake build | ||
run: docker exec build /bin/bash -c "cd /build && cmake --build ." | ||
- name: create linux package | ||
run: docker exec build /bin/bash -c "cd /build && cmake --build . --target dist-package" | ||
- name: Run projecteur executable, print version | ||
run: | | ||
docker exec build /bin/bash -c "cd /build && ./projecteur --version" | ||
docker exec build /bin/bash -c "cd /build && ./projecteur -f" | ||
# =================================================================================== | ||
# ---------- Gather artifacts and version information from container build ---------- | ||
- name: Get created artifacts from docker container | ||
run: | | ||
docker cp build:/build/dist-pkg . | ||
docker cp build:/build/version-string . | ||
- name: Set version environment variable | ||
run: | | ||
projecteur_version=`cat version-string` | ||
echo "::set-env name=projecteur_version::${projecteur_version}" | ||
- name: Move source package | ||
if: startsWith(matrix.docker_tag, 'archlinux') | ||
run: mkdir -p source-pkg && mv dist-pkg/*source.tar.gz ./source-pkg || true | ||
|
||
- name: Get source package filename for artifact uploads | ||
run: | | ||
src_pkg_artifact=`ls -1 source-pkg/* | head -n 1` | ||
echo "::set-env name=src_pkg_artifact::${src_pkg_artifact}" | ||
- name: Get binary package filename for artifact uploads | ||
run: | | ||
dist_pkg_artifact=`ls -1 dist-pkg/* | head -n 1` | ||
echo "::set-env name=dist_pkg_artifact::${dist_pkg_artifact}" | ||
# =================================================================================== | ||
# ---------- Upload artifacts to github ---------- | ||
- name: Upload source-pkg artifact to github | ||
if: startsWith(matrix.docker_tag, 'archlinux') | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: source-package | ||
path: ${{ env.src_pkg_artifact }} | ||
|
||
- name: Upload binary package artifact to github | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: ${{ matrix.docker_tag }}-package | ||
path: ${{ env.dist_pkg_artifact }} | ||
|
||
# =================================================================================== | ||
# ---------- Set environment variables depending on branch ---------- | ||
- name: Set environment variable defaults | ||
run: | | ||
echo "::set-env name=upload_bin_pkg::${{ false }}" | ||
echo "::set-env name=upload_src_pkg::${{ false }}" | ||
echo "::set-env name=cloudsmith_upload_repo::projecteur-develop" | ||
echo "::set-env name=REPO_UPLOAD::${{ false }}" | ||
- name: Check for binary-pkg upload conditions | ||
if: env.BRANCH == 'develop' || env.BRANCH == 'master' | ||
run: | | ||
echo "::set-env name=upload_bin_pkg::${{ true }}" | ||
echo "::set-env name=bintray_upload_pkg::projecteur-${{ env.BRANCH }}" | ||
pip install --upgrade wheel | ||
pip install --upgrade cloudsmith-cli | ||
- name: Check for source-pkg upload conditions | ||
if: env.upload_bin_pkg == 'true' && startsWith(matrix.docker_tag, 'archlinux') | ||
run: | | ||
echo "::set-env name=upload_src_pkg::${{ true }}" | ||
- if: env.BRANCH == 'master' | ||
run: echo "::set-env name=cloudsmith_upload_repo::projecteur-stable" | ||
|
||
# =================================================================================== | ||
# ---------- Upload artifacts to cloudsmith ---------- | ||
- name: Upload raw binary-pkg to cloudsmith | ||
if: env.upload_bin_pkg == 'true' | ||
env: | ||
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} | ||
CLOUDSMITH_REPO: ${{ env.cloudsmith_upload_repo }} | ||
run: | | ||
cloudsmith push raw -W -k ${CLOUDSMITH_API_KEY} --name ${{ matrix.docker_tag }} --republish \ | ||
--version ${{ env.projecteur_version }} ${CLOUDSMITH_USER}/${CLOUDSMITH_REPO} \ | ||
--summary "${CLOUDSMITH_SUMMARY}" --description "${CLOUDSMITH_DESC}" ${{ env.dist_pkg_artifact }} | ||
- name: Upload raw source-pkg to cloudsmith | ||
if: env.upload_src_pkg == 'true' | ||
env: | ||
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} | ||
CLOUDSMITH_REPO: ${{ env.cloudsmith_upload_repo }} | ||
run: | | ||
cloudsmith push raw -W -k ${CLOUDSMITH_API_KEY} --name sources --republish \ | ||
--version ${{ env.projecteur_version }} ${CLOUDSMITH_USER}/${CLOUDSMITH_REPO} \ | ||
--summary "${CLOUDSMITH_SUMMARY}" --description "${CLOUDSMITH_DESC}" ${{ env.src_pkg_artifact }} | ||
- name: Get package and repo type for upload | ||
if: env.upload_bin_pkg == 'true' | ||
run: | | ||
filename=$(basename -- "${{ env.dist_pkg_artifact }}") | ||
export PKG_TYPE="${filename##*.}" | ||
declare -A distromap=( ["debian-stretch"]="debian/stretch" ["debian-buster"]="debian/buster" \ | ||
["debian-bullseye"]="debian/bullseye" ["ubuntu-18.04"]="ubuntu/bionic" \ | ||
["ubuntu-20.04"]="ubuntu/focal" ["opensuse-15.1"]="opensuse/15.1" \ | ||
["centos-8"]="el/8" ["fedora-30"]="fedora/30" ["fedora-31"]="fedora/31" \ | ||
["fedora-32"]="fedora/32" ) | ||
export DISTRO=${distromap[${{ matrix.docker_tag }}]} | ||
echo PKGTYPE=$PKG_TYPE | ||
echo DISTRO=$DISTRO | ||
echo "::set-env name=PKG_TYPE::${PKG_TYPE}" | ||
echo "::set-env name=DISTRO::${DISTRO}" | ||
if [ -z ${DISTRO} ] || [ -z ${PKG_TYPE} ]; then \ | ||
export REPO_UPLOAD=false; else export REPO_UPLOAD=true; fi; | ||
echo "::set-env name=REPO_UPLOAD::${REPO_UPLOAD}" | ||
- name: Linux repo upload on cloudsmith for ${{ env.DISTRO }} | ||
if: env.REPO_UPLOAD == 'true' | ||
env: | ||
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} | ||
CLOUDSMITH_REPO: ${{ env.cloudsmith_upload_repo }} | ||
run: | | ||
echo Uploading for ${DISTRO} - ${PKG_TYPE}: ${CLOUDSMITH_USER}/${CLOUDSMITH_REPO}/${DISTRO} | ||
cloudsmith push ${PKG_TYPE} -W -k ${CLOUDSMITH_API_KEY} --republish \ | ||
${CLOUDSMITH_USER}/${CLOUDSMITH_REPO}/${DISTRO} ${{ env.dist_pkg_artifact }} | ||
# =================================================================================== | ||
# ---------- Upload artifacts to bintray ---------- | ||
- name: Upload source-pkg to Bintray | ||
if: env.upload_src_pkg == 'true' | ||
uses: bpicode/github-action-upload-bintray@master | ||
with: | ||
file: ${{ env.src_pkg_artifact }} | ||
api_user: jahnf | ||
api_key: ${{ secrets.BINTRAY_API_KEY }} | ||
repository_user: jahnf | ||
repository: Projecteur | ||
package: ${{ env.bintray_upload_pkg }} | ||
version: ${{ env.projecteur_version }} | ||
upload_path: packages/branches/${{ env.BRANCH }}/${{ env.projecteur_version }} | ||
calculate_metadata: false | ||
publish: 1 | ||
|
||
- name: Upload binary package to Bintray | ||
if: env.upload_bin_pkg == 'true' | ||
uses: bpicode/github-action-upload-bintray@master | ||
with: | ||
file: ${{ env.dist_pkg_artifact }} | ||
api_user: jahnf | ||
api_key: ${{ secrets.BINTRAY_API_KEY }} | ||
repository_user: jahnf | ||
repository: Projecteur | ||
package: ${{ env.bintray_upload_pkg }} | ||
version: ${{ env.projecteur_version }} | ||
upload_path: packages/branches/${{ env.BRANCH }}/${{ env.projecteur_version }} | ||
calculate_metadata: false | ||
publish: 1 | ||
|
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 |
---|---|---|
|
@@ -3,3 +3,4 @@ CMakeLists.txt.user* | |
.idea | ||
build | ||
build/* | ||
icons/icon-font/output/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,9 @@ endif() | |
|
||
project(Projecteur LANGUAGES CXX) | ||
|
||
add_compile_options(-Wall -Wextra -Werror) | ||
#set(CMAKE_CXX_CLANG_TIDY "clang-tidy-9;-checks=*,-fuchsia*,-modernize-pass-by-value") | ||
|
||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules") | ||
include(GitVersion) | ||
include(Translation) | ||
|
@@ -42,12 +45,21 @@ if(Qt5_VERSION VERSION_EQUAL "5.8" | |
endif() | ||
|
||
add_executable(projecteur | ||
src/main.cc | ||
src/main.cc src/enum-helper.h | ||
src/aboutdlg.cc src/aboutdlg.h | ||
src/actiondelegate.cc src/actiondelegate.h | ||
src/colorselector.cc src/colorselector.h | ||
src/device.cc src/device.h | ||
src/deviceinput.cc src/deviceinput.h | ||
src/devicescan.cc src/devicescan.h | ||
src/deviceswidget.cc src/deviceswidget.h | ||
src/linuxdesktop.cc src/linuxdesktop.h | ||
src/iconwidgets.cc src/iconwidgets.h | ||
src/imageitem.cc src/imageitem.h | ||
src/inputmapconfig.cc src/inputmapconfig.h | ||
src/inputseqedit.cc src/inputseqedit.h | ||
src/logging.cc src/logging.h | ||
src/nativekeyseqedit.cc src/nativekeyseqedit.h | ||
src/preferencesdlg.cc src/preferencesdlg.h | ||
src/projecteurapp.cc src/projecteurapp.h | ||
src/runguard.cc src/runguard.h | ||
|
@@ -87,12 +99,12 @@ target_compile_definitions(projecteur PRIVATE | |
|
||
# Set version project properties for builds not from a git repository (e.g. created with git archive) | ||
# If creating the version number via git information fails, the following target properties | ||
# will be used. IMPORTANT - when creating a release tag with git flow: | ||
# will be used. IMPORTANT - when creating a release tag with git flow: | ||
# Update this information - the version numbers and the version type. | ||
# VERSION_TYPE must be either 'release' or 'develop' | ||
set_target_properties(projecteur PROPERTIES | ||
set_target_properties(projecteur PROPERTIES | ||
VERSION_MAJOR 0 | ||
VERSION_MINOR 7 | ||
VERSION_MINOR 8 | ||
VERSION_PATCH 0 | ||
VERSION_TYPE release | ||
) | ||
|
@@ -112,7 +124,7 @@ add_translations_target("projecteur" "${CMAKE_CURRENT_BINARY_DIR}" "${ts_directo | |
add_translation_update_task("projecteur" "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/i18n" "${languages}") | ||
|
||
# Add target with non-source files for convenience when using IDEs like QtCreator and others | ||
add_custom_target(non-sources SOURCES README.md LICENSE.md devices.conf | ||
add_custom_target(non-sources SOURCES README.md LICENSE.md doc/CHANGELOG.md devices.conf | ||
src/extra-devices.cc.in 55-projecteur.rules.in | ||
cmake/templates/Projecteur.desktop.in) | ||
|
||
|
@@ -204,14 +216,20 @@ add_source_archive_target(projecteur) | |
|
||
# Add 'dist-package' target: Creates a deb/rpm/tgz package depending on the current Linux distribution | ||
add_dist_package_target( | ||
PROJECT "${CMAKE_PROJECT_NAME}" | ||
PROJECT "${CMAKE_PROJECT_NAME}" | ||
TARGET projecteur | ||
DESCRIPTION_BRIEF "Linux/X11 application for the Logitech Spotlight device." | ||
DESCRIPTION_FULL "Linux/X11 application for the Logitech Spotlight device.\nHomepage: ${HOMEPAGE}" | ||
CONTACT "Jahn Fuchs <[email protected]>" | ||
CONTACT "Jahn Fuchs <[email protected]>" | ||
HOMEPAGE "${HOMEPAGE}" | ||
DEBIAN_SECTION "utils" | ||
PREINST_SCRIPT "${OUTDIR}/pkg/scripts/preinst" | ||
POSTINST_SCRIPT "${OUTDIR}/pkg/scripts/postinst" | ||
) | ||
|
||
option(ENABLE_IWYU "Enable Include-What-You-Use" OFF) | ||
find_program(iwyu_path NAMES include-what-you-use iwyu) | ||
if(ENABLE_IWYU AND iwyu_path) | ||
set_property(TARGET projecteur PROPERTY CXX_INCLUDE_WHAT_YOU_USE ${iwyu_path}) | ||
endif() | ||
|
Oops, something went wrong.