-
Notifications
You must be signed in to change notification settings - Fork 8
83 lines (68 loc) · 2.63 KB
/
release_package.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
77
78
79
80
81
82
83
name: ReleasePackage
on:
push:
branches:
- main
workflow_dispatch:
jobs:
create_package:
timeout-minutes: 10
runs-on: ubuntu-latest # Since fkYAML is a header-only library, just using ubuntu-latest is enough for packaging.
strategy:
matrix:
single_header: ["ON", "OFF"]
include:
- artifact_name: fkYAML
single_header: "OFF"
- artifact_name: fkYAML_single_header
single_header: "ON"
steps:
- uses: actions/checkout@v4
- name: install zip
run: sudo apt-get install zip
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="${{github.workspace}}/build/${{matrix.artifact_name}}" -DFK_YAML_USE_SINGLE_HEADER=${{matrix.single_header}}
- name: Install
run: |
cmake --build ${{github.workspace}}/build --config Release --target install
ls -lAR ${{github.workspace}}/build/${{matrix.artifact_name}}
- name: Create tgz/zip archives of the install package
run: |
cd ${{github.workspace}}/build
tar czvf '${{matrix.artifact_name}}.tgz' ./${{matrix.artifact_name}}
zip -r '${{matrix.artifact_name}}.zip' ./${{matrix.artifact_name}}
- name: Upload Artifacts (tgz)
uses: actions/upload-artifact@v4
with:
name: '${{matrix.artifact_name}}.tgz'
path: '${{github.workspace}}/build/${{matrix.artifact_name}}.tgz'
- name: Upload Artifacts (zip)
uses: actions/upload-artifact@v4
with:
name: '${{matrix.artifact_name}}.zip'
path: '${{github.workspace}}/build/${{matrix.artifact_name}}.zip'
create_minimum_archive:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: install zip
run: sudo apt-get install zip
- name: Create minimum tgz & zip archives
working-directory: ${{github.workspace}}
run: | # create a tgz archive which contains minimum required files to be used as a CMake project (e.g., using FetchContent).
mkdir fkYAML_min
cp -vr CMakeLists.txt fkYAML.natvis LICENSE.txt README.md include single_include ./fkYAML_min
tar czvf fkYAML_min.tgz ./fkYAML_min
zip -r fkYAML_min.zip ./fkYAML_min
rm -rf ./fkYAML_min
- name: Upload the minimum archive (tgz)
uses: actions/upload-artifact@v4
with:
name: fkYAML_min.tgz
path: '${{github.workspace}}/fkYAML_min.tgz'
- name: Upload the minimum archive (zip)
uses: actions/upload-artifact@v4
with:
name: fkYAML_min.zip
path: '${{github.workspace}}/fkYAML_min.zip'