@@ -2,16 +2,17 @@ name: C/C++ CI
22
33on :
44 push :
5- branches :
6- - master
5+ tags :
6+ - v*.*
77 pull_request :
88 branches :
99 - master
1010
1111env :
1212 LSL_URL : ' https://github.com/sccn/liblsl/releases/download'
13- LSL_RELEASE : ' 1.13.0'
14- LSL_RELEASE_SUFFIX : ' '
13+ LSL_RELEASE_PREFIX : ' v'
14+ LSL_RELEASE : ' 1.14.0'
15+ LSL_RELEASE_SUFFIX : ' b1'
1516
1617
1718jobs :
@@ -24,44 +25,120 @@ jobs:
2425 - windows-latest
2526 - macOS-latest
2627 fail-fast : false
28+
2729 steps :
28- - uses : actions/checkout@v1
30+ - uses : actions/checkout@v2
31+
2932 - name : CMake version
3033 run : cmake --version
34+
3135 - name : download liblsl (Ubuntu)
36+ if : matrix.os == 'ubuntu-latest'
3237 run : |
33- curl -L ${LSL_URL}/${LSL_RELEASE}${LSL_RELEASE_SUFFIX}/liblsl-${LSL_RELEASE}-Linux64-bionic.deb -o liblsl.deb
38+ echo ${{ github.ref }}
39+ curl -L ${LSL_URL}/${LSL_RELEASE_PREFIX}${LSL_RELEASE}${LSL_RELEASE_SUFFIX}/liblsl-${LSL_RELEASE}-Linux64-bionic.deb -o liblsl.deb
3440 sudo dpkg -i liblsl.deb
35- sudo apt install -y qtbase5-dev
36- if : matrix.os == 'ubuntu-latest'
41+ sudo apt install -y qtbase5-dev qtmultimedia5-dev
42+
3743 - name : download liblsl (Windows)
44+ if : matrix.os == 'windows-latest'
3845 run : |
39- Invoke-WebRequest -Uri $Env:LSL_URL/$Env:LSL_RELEASE$Env:LSL_RELEASE_SUFFIX/liblsl-$Env:LSL_RELEASE-Win64.zip -o liblsl.7z
46+ 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
4047 7z x liblsl.7z -oLSL
41- if : matrix.os == 'windows-latest'
48+
4249 - name : download liblsl (macOS)
50+ if : matrix.os == 'macOS-latest'
4351 run : |
44- curl -L ${LSL_URL}/${LSL_RELEASE}${LSL_RELEASE_SUFFIX}/liblsl-${LSL_RELEASE}-OSX64.tar.bz2 -o liblsl.tar.bz2
52+ curl -L ${LSL_URL}/${LSL_RELEASE_PREFIX}${ LSL_RELEASE}${LSL_RELEASE_SUFFIX}/liblsl-${LSL_RELEASE}-OSX64.tar.bz2 -o liblsl.tar.bz2
4553 mkdir LSL
4654 tar -xvf liblsl.tar.bz2 -C LSL
4755 brew install qt
4856 echo '::set-env name=CMAKE_PREFIX_PATH::/usr/local/opt/qt'
49- if : matrix.os == 'macOS-latest'
57+ # TODO: Need to fix liblsl CI
58+
5059 - name : Install Qt
60+ if : matrix.os == 'windows-latest'
5161 # uses: jurplel/install-qt-action@v2
5262 uses : ouuan/install-qt-action@v2.3.1 # workaround until the aqtinstall timeout is fixed
5363 with :
5464 version : 5.14.0
55- if : matrix.os == 'windows-latest'
65+
5666 - name : Configure CMake
5767 shell : bash
5868 run : |
5969 cmake -S . -B build -DLSL_INSTALL_ROOT=$PWD/LSL/ -DCPACK_DEBIAN_PACKAGE_SHLIBDEPS=ON -DCPACK_DEBIAN_PACKAGE_DEPENDS=1
60- - name : make
70+
71+ - name : Make
6172 run : cmake --build build --config Release -j
62- - name : package
73+
74+ - name : Install
6375 run : cmake --build build --config Release -j --target install
64- - uses : actions/upload-artifact@master
76+
77+ - name : Package
78+ run : cmake --build build --config Release -j --target package
79+
80+ # TODO: upload-artifact@v2 (in-progress) will support file glob
81+ - name : Upload Artifacts (ubuntu)
82+ if : matrix.os == 'ubuntu-latest'
83+ uses : actions/upload-artifact@master
84+ with :
85+ name : pkg-${{ matrix.os }}
86+ path : build/AppTemplate_cpp_qt-1.13.0-Linux64-bionic.deb
87+
88+ - name : Upload Artifacts (macOS)
89+ if : matrix.os == 'macOS-latest'
90+ uses : actions/upload-artifact@master
91+ with :
92+ name : pkg-${{ matrix.os }}
93+ path : build/AppTemplate_cpp_qt-1.13.0-OSX64.tar.bz2
94+
95+ # TODO: Can reconstruct filename from project name and version in CMakeCache.txt using powershell:
96+ # Select-String -Path build\CMakeCache.txt -Pattern "CMAKE_PROJECT_NAME:STATIC=(.*)" | % { $_.matches.groups[1] } | % {$_.Value}
97+ # Select-String -Path build\CMakeCache.txt -Pattern "CMAKE_PROJECT_VERSION:STATIC=(.*)" | % { $_.matches.groups[1] } | % {$_.Value}
98+ - name : Upload Artifacts (windows)
99+ if : matrix.os == 'windows-latest'
100+ uses : actions/upload-artifact@master
65101 with :
66102 name : pkg-${{ matrix.os }}
67- path : build/install
103+ path : build/AppTemplate_cpp_qt-1.13.0-Win64.zip
104+
105+ release :
106+ needs : build
107+ runs-on : ubuntu-latest
108+ steps :
109+
110+ # TODO: download-artifact@v2 will support multiple download
111+ - name : Download Artifact (ubuntu)
112+ if : startsWith(github.ref, 'refs/tags/')
113+ uses : actions/download-artifact@v1
114+ with :
115+ name : pkg-ubuntu-latest
116+
117+ - name : Download Artifact (windows)
118+ if : startsWith(github.ref, 'refs/tags/')
119+ uses : actions/download-artifact@v1
120+ with :
121+ name : pkg-windows-latest
122+
123+ - name : Download Artifact (macOS)
124+ if : startsWith(github.ref, 'refs/tags/')
125+ uses : actions/download-artifact@v1
126+ with :
127+ name : pkg-macOS-latest
128+
129+ - name : Create Release
130+ if : startsWith(github.ref, 'refs/tags/')
131+ id : create_release
132+ uses : softprops/action-gh-release@v1
133+ env :
134+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
135+ with :
136+ # tag_name: ${{ github.ref }} # ${{ github.ref }} is default
137+ name : Release ${{ github.ref }}
138+ draft : false
139+ prerelease : false
140+ # body_path: CHANGELOG.txt
141+ files : |
142+ pkg-ubuntu-latest/AppTemplate_cpp_qt-1.13.0-Linux64-bionic.deb
143+ pkg-macOS-latest/AppTemplate_cpp_qt-1.13.0-OSX64.tar.bz2
144+ pkg-windows-latest/AppTemplate_cpp_qt-1.13.0-Win64.zip
0 commit comments