-
Notifications
You must be signed in to change notification settings - Fork 3
103 lines (87 loc) · 3.25 KB
/
cppcmake.yml
File metadata and controls
103 lines (87 loc) · 3.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: C/C++ CI
on:
push:
tags:
- v*.*
pull_request:
branches:
- master
env:
LSL_URL: 'https://github.com/sccn/liblsl/releases/download'
LSL_RELEASE_PREFIX: 'v'
LSL_RELEASE: '1.14.0'
LSL_RELEASE_SUFFIX: 'b1'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
- macOS-latest
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Install Qt (Windows)
if: matrix.os == 'windows-latest'
uses: jurplel/install-qt-action@v2
with:
version: 5.14.0
- name: Get liblsl (Windows)
if: matrix.os == 'windows-latest'
run: |
Invoke-WebRequest -Uri $Env:LSL_URL/$Env:LSL_RELEASE_PREFIX$Env:LSL_RELEASE$Env:LSL_RELEASE_SUFFIX/liblsl-$Env:LSL_RELEASE-Win64.zip -o liblsl.7z
7z x liblsl.7z -oLSL
- name: Get liblsl and Qt (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
echo ${{ github.ref }}
curl -L ${LSL_URL}/${LSL_RELEASE_PREFIX}${LSL_RELEASE}${LSL_RELEASE_SUFFIX}/liblsl-${LSL_RELEASE}-Linux64-bionic.deb -o liblsl.deb
sudo dpkg -i liblsl.deb
sudo apt install -y qtbase5-dev qtmultimedia5-dev
- name: Get liblsl and Qt (macOS)
if: matrix.os == 'macOS-latest'
run: |
curl -L ${LSL_URL}/${LSL_RELEASE_PREFIX}${LSL_RELEASE}${LSL_RELEASE_SUFFIX}/liblsl-${LSL_RELEASE}-OSX64.tar.bz2 -o liblsl.tar.bz2
mkdir LSL
tar -xvf liblsl.tar.bz2 -C LSL
brew install qt
echo '::set-env name=CMAKE_PREFIX_PATH::/usr/local/opt/qt'
- name: Configure CMake
shell: bash
run: |
cmake -S . -B build -DLSL_INSTALL_ROOT=$PWD/LSL/ -DCPACK_DEBIAN_PACKAGE_SHLIBDEPS=ON -DCPACK_DEBIAN_PACKAGE_DEPENDS=1
- name: Make & Install
run: cmake --build build --config Release -j --target install
- name: Package
run: cmake --build build --config Release -j --target package
- name: Upload Artifacts
uses: actions/upload-artifact@v2-preview
with:
name: pkg-${{ matrix.os }}
path: build/*.[dbz][ezi][b2p] # Hack to get deb, bz2, zip. Will also get e.g. de2, dep, dzb, dz2, dzp, etc...
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download Artifacts
if: startsWith(github.ref, 'refs/tags/')
uses: actions/download-artifact@v2-preview
# By not specifying with: name:, it defaults to downloading all artifacts.
# Official GitHub Upload-Asset action does not allow for uploading multiple files.
# There are many community alternatives. Below is one that combines release and upload, with globbing.
# See also: svenstaro/upload-release-action shogo82148/actions-upload-release-asset meeDamian/github-release csexton/release-asset-action
- name: Create Release
if: startsWith(github.ref, 'refs/tags/')
id: create_release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# tag_name: ${{ github.ref }} # ${{ github.ref }} is default
name: Release ${{ github.ref }}
draft: false
prerelease: true
# body_path: CHANGELOG.txt
files: pkg-*-latest/*