Skip to content

Commit 2501dd1

Browse files
committed
Update CI setup, build against liblsl 1.14.0, bump version
1 parent 5d8ba65 commit 2501dd1

2 files changed

Lines changed: 72 additions & 72 deletions

File tree

.github/workflows/cppcmake.yml

Lines changed: 64 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -7,99 +7,94 @@ on:
77
pull_request:
88
branches:
99
- master
10+
release:
11+
types: ['created']
1012

1113
env:
12-
LSL_URL: 'https://github.com/sccn/liblsl/releases/download'
13-
LSL_RELEASE_PREFIX: ''
14-
LSL_RELEASE: '1.13.1'
14+
LSL_RELEASE_URL: 'https://github.com/sccn/liblsl/releases/download/v1.14.0rc1'
15+
LSL_RELEASE: '1.14.0'
16+
17+
defaults:
18+
run:
19+
shell: bash
1520

1621

1722
jobs:
1823
build:
19-
runs-on: ${{ matrix.os }}
24+
name: ${{ matrix.config.name }}
25+
runs-on: ${{ matrix.config.os }}
2026
strategy:
21-
matrix:
22-
os:
23-
- ubuntu-latest
24-
- windows-latest
25-
- macOS-latest
2627
fail-fast: false
27-
28+
matrix:
29+
config:
30+
- {name: "ubuntu-20.04", os: "ubuntu-20.04"}
31+
# - {name: "ubuntu-18.04", os: "ubuntu-18.04"}
32+
- {name: "ubuntu-16.04", os: "ubuntu-16.04"}
33+
- {name: "windows-x64", os: "windows-latest"}
34+
- {name: "macOS-latest", os: "macOS-latest"}
2835
steps:
2936
- uses: actions/checkout@v2
30-
31-
- name: CMake version
32-
run: cmake --version
33-
34-
- name: Install Qt (Windows)
35-
if: matrix.os == 'windows-latest'
36-
uses: jurplel/install-qt-action@v2
37-
with:
38-
version: 5.14.0
39-
40-
- name: Get liblsl (Windows)
41-
if: matrix.os == 'windows-latest'
42-
run: |
43-
Invoke-WebRequest -Uri $Env:LSL_URL/$Env:LSL_RELEASE_PREFIX$Env:LSL_RELEASE/liblsl-$Env:LSL_RELEASE-Win64.zip -o liblsl.7z
44-
7z x liblsl.7z -oLSL
45-
- name: Get liblsl and Qt (Ubuntu)
46-
if: matrix.os == 'ubuntu-latest'
37+
- name: download liblsl (Ubuntu)
38+
if: startsWith(matrix.config.os, 'ubuntu-')
4739
run: |
48-
echo ${{ github.ref }}
49-
curl -L ${LSL_URL}/${LSL_RELEASE_PREFIX}${LSL_RELEASE}/liblsl-${LSL_RELEASE}-Linux64-bionic.deb -o liblsl.deb
40+
curl -L ${LSL_RELEASE_URL}/liblsl-${LSL_RELEASE}-$(lsb_release -sc)_amd64.deb -o liblsl.deb
5041
sudo dpkg -i liblsl.deb
51-
sudo apt install -y qtbase5-dev
42+
sudo apt-get install -y qtbase5-dev
5243
53-
- name: Get liblsl and Qt (macOS)
54-
if: matrix.os == 'macOS-latest'
55-
# curl -L ${LSL_URL}/${LSL_RELEASE_PREFIX}${LSL_RELEASE}/liblsl-${LSL_RELEASE}-MacOS10.13.tar.bz2 -o liblsl.tar.bz2
44+
- name: download liblsl (Windows)
45+
if: matrix.config.os == 'windows-latest'
5646
run: |
57-
curl -L ${LSL_URL}/v1.14.0b3/liblsl-1.14.0-MacOS10.13.tar.bz2 -o liblsl.tar.bz2
47+
curl -L ${LSL_RELEASE_URL}/liblsl-${LSL_RELEASE}-Win_amd64.zip -o liblsl.zip
48+
7z x liblsl.zip -oLSL
49+
50+
- name: download liblsl (macOS)
51+
if: matrix.config.os == 'macOS-latest'
52+
run: |
53+
curl -L ${LSL_RELEASE_URL}/liblsl-${LSL_RELEASE}-OSX_amd64.tar.bz2 -o liblsl.tar.bz2
5854
mkdir LSL
5955
tar -xvf liblsl.tar.bz2 -C LSL
6056
brew install qt
61-
echo '::set-env name=CMAKE_PREFIX_PATH::/usr/local/opt/qt'
57+
58+
- name: Install Qt
59+
if: matrix.config.os == 'windows-latest'
60+
uses: jurplel/install-qt-action@v2
61+
with:
62+
version: 5.15.1
6263

6364
- name: Configure CMake
64-
shell: bash
6565
run: |
66-
cmake -S . -B build -DLSL_INSTALL_ROOT=$PWD/LSL/ -DCPACK_DEBIAN_PACKAGE_SHLIBDEPS=ON -DCPACK_DEBIAN_PACKAGE_DEPENDS=1
66+
cmake --version
67+
test "${{ runner.os }}" == "macOS" && export CMAKE_PREFIX_PATH=/usr/local/opt/qt
68+
cmake -S . -B build \
69+
-DCMAKE_BUILD_TYPE=Release \
70+
-DCMAKE_INSTALL_PREFIX=${PWD}/install \
71+
-DCPACK_PACKAGE_DIRECTORY=${PWD}/package \
72+
-DLSL_INSTALL_ROOT=$PWD/LSL/ \
73+
-DCPACK_DEBIAN_PACKAGE_SHLIBDEPS=ON \
74+
-DCPACK_DEBIAN_PACKAGE_DEPENDS=1
6775
68-
- name: Make & Install
76+
- name: make
6977
run: cmake --build build --config Release -j --target install
7078

71-
- name: Package
72-
run: cmake --build build --config Release -j --target package
79+
- name: package
80+
run: |
81+
cmake --build build --config Release -j --target package
82+
cmake -E remove_directory package/_CPack_Packages
7383
7484
- name: Upload Artifacts
75-
uses: actions/upload-artifact@v2-preview
85+
uses: actions/upload-artifact@v2
7686
with:
77-
name: pkg-${{ matrix.os }}
78-
path: build/*.[dbz][ezi][b2p] # Hack to get deb, bz2, zip. Will also get e.g. de2, dep, dzb, dz2, dzp, etc...
79-
80-
release:
81-
needs: build
82-
runs-on: ubuntu-latest
83-
steps:
84-
85-
- name: Download Artifacts
86-
if: startsWith(github.ref, 'refs/tags/')
87-
uses: actions/download-artifact@v2-preview
88-
# By not specifying with: name:, it defaults to downloading all artifacts.
89-
90-
# Official GitHub Upload-Asset action does not allow for uploading multiple files.
91-
# There are many community alternatives. Below is one that combines release and upload, with globbing.
92-
# See also: svenstaro/upload-release-action shogo82148/actions-upload-release-asset meeDamian/github-release csexton/release-asset-action
93-
- name: Create Release
94-
if: startsWith(github.ref, 'refs/tags/')
95-
id: create_release
96-
uses: softprops/action-gh-release@v1
87+
name: pkg-${{ matrix.config.name }}
88+
path: package
89+
- name: upload to release page
90+
if: github.event_name == 'release'
9791
env:
98-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
99-
with:
100-
# tag_name: ${{ github.ref }} # ${{ github.ref }} is default
101-
name: Release ${{ github.ref }}
102-
draft: false
103-
prerelease: false
104-
# body_path: CHANGELOG.txt
105-
files: pkg-*/*
92+
TOKEN: "token ${{ secrets.GITHUB_TOKEN }}"
93+
UPLOAD_URL: ${{ github.event.release.upload_url }}
94+
run: |
95+
UPLOAD_URL=${UPLOAD_URL%\{*} # remove "{name,label}" suffix
96+
for pkg in package/*.*; do
97+
NAME=$(basename $pkg)
98+
MIME=$(file --mime-type $pkg|cut -d ' ' -f2)
99+
curl -X POST -H "Accept: application/vnd.github.v3+json" -H "Authorization: $TOKEN" -H "Content-Type: $MIME" --data-binary @$pkg $UPLOAD_URL?name=$NAME
100+
done

CMakeLists.txt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
cmake_minimum_required(VERSION 3.5)
22

33
project(LabRecorder
4-
LANGUAGES CXX
5-
VERSION 1.13.1)
4+
DESCRIPTION "Record and write LabStreamingLayer streams to an XDF file"
5+
HOMEPAGE_URL "https://github.com/labstreaminglayer/App-LabRecorder/"
6+
LANGUAGES C CXX
7+
VERSION 1.14.0)
68

79
find_package(LSL REQUIRED
810
HINTS ${LSL_INSTALL_ROOT}
@@ -114,7 +116,9 @@ installLSLApp(${PROJECT_NAME})
114116
installLSLApp(LabRecorderCLI)
115117
installLSLApp(testxdfwriter)
116118
installLSLAuxFiles(${PROJECT_NAME}
117-
${PROJECT_NAME}.cfg LICENSE README.md
119+
${PROJECT_NAME}.cfg
120+
LICENSE
121+
README.md
118122
)
119123

120124
if (WIN32)
@@ -137,4 +141,5 @@ if (WIN32)
137141
$<TARGET_FILE_DIR:${PROJECT_NAME}>)
138142
endif(WIN32)
139143

144+
set(CPACK_DEBIAN_LABRECORDER_PACKAGE_SECTION "science" CACHE INTERNAL "")
140145
LSLGenerateCPackConfig()

0 commit comments

Comments
 (0)