Skip to content

Commit efb319f

Browse files
committed
CI: run CPack on github actions
1 parent 9a0778c commit efb319f

File tree

1 file changed

+24
-11
lines changed

1 file changed

+24
-11
lines changed

.github/workflows/cppcmake.yml

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@ name: C/C++ CI
22

33
on:
44
push:
5-
branches:
6-
- master
5+
branches: ['*']
6+
tags: ['*']
77
pull_request:
8-
branches:
9-
- master
8+
release:
9+
types: ['created', 'edited']
10+
create:
11+
tags: ['*']
1012

1113
jobs:
1214
build:
@@ -28,16 +30,27 @@ jobs:
2830
cmake --version
2931
cmake -E make_directory build
3032
cd build
31-
cmake -DLSL_UNITTESTS=1 ..
33+
cmake -DLSL_UNITTESTS=1 -DCPACK_PACKAGE_DIRECTORY=${PWD}/package ..
3234
- name: make
33-
run: cmake --build build --config Release -j --target install
34-
# - name: pack everything up
35-
# shell: bash
36-
# run: cd build; mkdir upload; cpack -C Release -R $PWD/upload; rm -rf upload/_CPack_Packages/;
37-
- uses: actions/upload-artifact@master
35+
shell: bash
36+
run: |
37+
cmake --build build --config Release -j --target install
38+
echo $GITHUB_REF
39+
if [ $GITHUB_REF != "refs/heads"* ]; then
40+
cmake --build build --config Release -j --target package
41+
cmake -E remove_directory build/uploadpkgs/_CPack_Packages
42+
fi
43+
- name: upload install dir
44+
uses: actions/upload-artifact@master
3845
with:
39-
name: pkg-${{ matrix.os }}
46+
name: build-${{ matrix.os }}
4047
path: build/install
48+
- name: upload package
49+
uses: actions/upload-artifact@master
50+
if: "!startsWith(github.ref, 'refs/heads')"
51+
with:
52+
name: pkg-${{ matrix.os }}
53+
path: build/package
4154
- name: unit tests (internal functions)
4255
run: build/install/bin/lsl_test_internal --order rand --durations yes
4356
- name: unit tests (exported functions)

0 commit comments

Comments
 (0)