Skip to content

Commit

Permalink
Merge branch 'release/0.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
jahnf committed Jun 19, 2020
2 parents 10f9a3e + 197dec1 commit 272b161
Show file tree
Hide file tree
Showing 75 changed files with 6,252 additions and 885 deletions.
221 changes: 221 additions & 0 deletions .github/workflows/ci-build.yml
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

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ CMakeLists.txt.user*
.idea
build
build/*
icons/icon-font/output/
35 changes: 15 additions & 20 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,33 @@ matrix:
- os: linux
dist: bionic
env: DOCKER_IMG=jahnf/projecteur:archlinux
- os: linux
dist: xenial
env: DOCKER_IMG=jahnf/projecteur:debian-stretch
# - os: linux
# dist: xenial
# env: DOCKER_IMG=jahnf/projecteur:debian-stretch
- os: linux
dist: bionic
env: DOCKER_IMG=jahnf/projecteur:debian-buster
- os: linux
dist: xenial
env: DOCKER_IMG=jahnf/projecteur:ubuntu-18.04
- os: linux
dist: xenial
env: DOCKER_IMG=jahnf/projecteur:opensuse-15.0
dist: bionic
env: DOCKER_IMG=jahnf/projecteur:ubuntu-20.04
# - os: linux
# dist: xenial
# env: DOCKER_IMG=jahnf/projecteur:opensuse-15.0
- os: linux
dist: xenial
env: DOCKER_IMG=jahnf/projecteur:opensuse-15.1
# - os: linux
# dist: bionic
# env: DOCKER_IMG=jahnf/projecteur:fedora-30
# - os: linux
# dist: bionic
# env: DOCKER_IMG=jahnf/projecteur:fedora-31
- os: linux
dist: bionic
env: DOCKER_IMG=jahnf/projecteur:fedora-30
- os: linux
dist: bionic
env: DOCKER_IMG=jahnf/projecteur:fedora-31
env: DOCKER_IMG=jahnf/projecteur:fedora-32
- os: linux
dist: bionic
env: DOCKER_IMG=jahnf/projecteur:centos-8
Expand All @@ -41,14 +47,3 @@ script:
- docker cp build:/build/dist-pkg .
- docker cp build:/build/travis-ci-bintray-deploy.json .
- ls -alh dist-pkg
deploy:
provider: bintray
skip_cleanup: true
on:
all_branches: true
condition: "$TRAVIS_BRANCH =~ ^develop|master$"
file: travis-ci-bintray-deploy.json
user:
secure: IiLPERfNp3JOj4kLgAaHFWNhYh8ZEMNwbnToo+eg69QsdKOq4gDyPjVA2pjqNjxkHVC8mP846c4RMdx7B3d78cejS+nN8NgwRkGky6pe15ZW6eZ2Ncn4aIaZ35+yL/VIDei+laJv/LWehYypw5qK8h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MqoDv3AkMSydqzKyMFfzR3EmPC7ZCFoalwkIkK4aVmpRw/EbmjaQ2NOc/N6TNraR5W8JcOhBZNfAQ8gpVXZtQnhxyxdqkrEIO0Glg4IPWonUO2025dq0eycfXyf38NovDz6+weBE=
32 changes: 25 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -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
)
Expand All @@ -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)

Expand Down Expand Up @@ -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()

Loading

0 comments on commit 272b161

Please sign in to comment.