-
Notifications
You must be signed in to change notification settings - Fork 13
76 lines (63 loc) · 2.06 KB
/
cppcmake.yml
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
name: C/C++ CI
on:
push:
tags:
- v*.*
pull_request:
branches:
- main
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
matrix:
config:
- {name: "ubuntu-latest", os: ubuntu-latest, cmake_extra: ""}
- {name: "windows-x64", os: windows-latest, cmake_extra: "-T v143"}
- {name: "windows-32", os: windows-latest, cmake_extra: "-T v143 -A Win32"}
- {name: "macOS-latest", os: macOS-latest, cmake_extra: ""}
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: CMake version
run: cmake --version
- name: Configure CMake
shell: bash
run: |
cmake -S . -B build ${{ matrix.config.cmake_extra }} -DCMAKE_INSTALL_PREFIX=${PWD}/build/install -DCPACK_PACKAGE_DIRECTORY=${PWD}/build/package -DCPACK_DEBIAN_PACKAGE_SHLIBDEPS=ON
- name: Make
run: cmake --build build --config Release -j
- name: Install
run: cmake --build build --config Release -j --target install
- name: Package
run: cmake --build build --config Release -j --target package
- name: Upload Artifact
uses: actions/upload-artifact@v3
# if: "!startsWith(github.ref, 'refs/heads')"
with:
name: pkg-${{ matrix.config.name }}
path: |
build/package/*.deb
build/package/*.tar.bz2
build/package/*.zip
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download Artifacts
if: startsWith(github.ref, 'refs/tags/')
uses: actions/download-artifact@v3
- 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: false
# body_path: CHANGELOG.txt
files: 'pkg-*/*'