forked from sqlitebrowser/sqlitebrowser
-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (66 loc) · 2.49 KB
/
cppcmake.yml
File metadata and controls
71 lines (66 loc) · 2.49 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
name: C/C++ CI
on:
push:
branches: ['*']
tags:
paths_ignore: ['docs/**', '.travis.yml']
pull_request:
release:
types: ['created']
defaults:
run:
shell: bash
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {name: "ubuntu-20.04", os: "ubuntu-20.04"}
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install qttools5-dev libqt5scintilla2-dev libqcustomplot-dev libsqlite3-dev
- name: Configure CMake
run: |
cmake --version
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${PWD}/install \
-DCPACK_PACKAGE_DIRECTORY=${PWD}/package \
-DENABLE_TESTING=ON
- name: make
run: cmake --build build --config Release -j --target install
- name: run tests
run: ctest -C Release
- name: package
run: |
cmake --build build --config Release -j --target package
cmake -E remove_directory package/_CPack_Packages
- name: upload package
uses: actions/upload-artifact@master
with:
name: pkg-${{ matrix.config.name }}
path: package
- name: upload to release page
if: github.event_name == 'release'
env:
TOKEN: "token ${{ secrets.GITHUB_TOKEN }}"
TAG: ${{ github.event.release.tag_name }}
UPLOAD_URL: ${{ github.event.release.upload_url }}
run: |
# Do try this at home! The REST API is documented at
# https://docs.github.com/en/free-pro-team@latest/rest and you can get a personal
# access token at https://github.com/settings/tokens
# (set TOKEN to "bearer abcdef1234")
# you can get the UPLOAD_URL with a short bash snippet; make sure to set the env var TAG:
# UPLOAD_URL=$(curl -H 'Accept: application/vnd.github.v3+json' $GITHUB_API_URL/repos/$GITHUB_REPOSITORY/releases/tags/$TAG | jq -r .upload_url)
UPLOAD_URL=${UPLOAD_URL%\{*} # remove "{name,label}" suffix
for pkg in package/*.*; do
NAME=$(basename $pkg)
MIME=$(file --mime-type $pkg|cut -d ' ' -f2)
curl -X POST -H "Accept: application/vnd.github.v3+json" -H "Authorization: $TOKEN" -H "Content-Type: $MIME" --data-binary @$pkg $UPLOAD_URL?name=$NAME
done