-
Notifications
You must be signed in to change notification settings - Fork 13
52 lines (44 loc) · 1.92 KB
/
single-header.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
name: CMake
on:
push:
branches: [ main, singleheader_merge ] # singleheader_merge branch used for modifications to the CI
jobs:
build:
name: "Create single-header release"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 100
- name: Cache
uses: actions/cache@v4
env:
cache-name: cache-fetchContent-cache
with:
path: ${{runner.workspace}}/build/_deps
key: ${{ runner.os }}-gcc-Release-${{ hashFiles('CMakeLists.txt') }}-${{ hashFiles('cmake/Dependencies.cmake') }}
- name: Install gcc-12
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa # provides newer gcc 12.2.0 instead of 12.1.0
sudo apt-get install -y gcc-12 g++-12
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 110 --slave /usr/bin/g++ g++ /usr/bin/g++-12 --slave /usr/bin/gcov gcov /usr/bin/gcov-12
- name: Configure CMake to fetch UT dependency
shell: bash
run: cmake -S . -B ./build -DCMAKE_BUILD_TYPE=Release
- name: create single-header
shell: bash
run: |
wget https://raw.githubusercontent.com/edlund/amalgamate/c91f07eea1133aa184f652b8f1398eaf03586208/amalgamate.py
mkdir -p singleheader
python3 amalgamate.py -c devtools/singleheader-config-graph.json -s . -v yes
python3 amalgamate.py -c devtools/singleheader-config-bench.json -s bench/ -v yes
- name: upload to branch # keeping history of single-header branch
run: |
git config --global user.name "single header generator"
git config --global user.email "[email protected]"
git add singleheader
git fetch --depth=1 origin single-header:single-header
git reset --soft origin/single-header
git rev-parse HEAD@{1} > .git/MERGE_HEAD
git commit -m "single-header of $(git rev-parse --short HEAD@{1})"
git push origin HEAD:single-header