-
Notifications
You must be signed in to change notification settings - Fork 0
146 lines (131 loc) · 4.82 KB
/
build_and_release.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: Build Corsika8
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
fmt_version: 10.2.1
spdlog_version: 1.14.1
cubic_version: 0.1.5
proposal_version: 7.6.2
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-22.04 ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Install prerequisites
shell: bash
run: |
sudo apt-get update -y
sudo apt-get install -y python3 python3-pip cmake g++ gfortran git doxygen graphviz \
libboost-all-dev libcli11-dev libeigen3-dev libyaml-cpp-dev \
libre2-dev libzstd-dev liblz4-dev catch2 zlib1g-dev libprotobuf-dev \
nlohmann-json3-dev ca-certificates lsb-release wget
wget https://apache.jfrog.io/artifactory/arrow/$(lsb_release --id --short | tr 'A-Z' 'a-z')/apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb
sudo apt install -y ./apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb
sudo apt update -y
sudo apt install -y -V libarrow-dev libarrow-dataset-dev libparquet-dev
pip install pyarrow
- name: Build pre-installation file list
shell: bash
run: sudo find /usr -print > filelist_before.txt
- name: Install fmt library
shell: bash
run: |
mkdir fmt
cd fmt
wget https://github.com/fmtlib/fmt/archive/refs/tags/${{ env.fmt_version }}.tar.gz
tar zxf ${{ env.fmt_version }}.tar.gz
cd fmt-${{ env.fmt_version }}
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr
make -j4
sudo make install
- name: Install spdlog library
shell: bash
run: |
mkdir spdlog
cd spdlog
wget https://github.com/gabime/spdlog/archive/refs/tags/v${{ env.spdlog_version }}.tar.gz
tar zxf v${{ env.spdlog_version }}.tar.gz
cd spdlog-${{ env.spdlog_version }}
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr
make -j4
sudo make install
- name: Install Cubic Interpolation
shell: bash
run: |
mkdir cubic_interpolation
cd cubic_interpolation
wget https://github.com/tudo-astroparticlephysics/cubic_interpolation/archive/refs/tags/v${{ env.cubic_version }}.tar.gz
tar zxf v${{ env.cubic_version }}.tar.gz
cd cubic_interpolation-${{ env.cubic_version }}
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr
make -j4
sudo make install
- name: Install PROPOSAL
shell: bash
run: |
mkdir proposal
cd proposal
wget https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/${{ env.proposal_version }}.tar.gz
tar zxf ${{ env.proposal_version }}.tar.gz
cd PROPOSAL-${{ env.proposal_version }}
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr
make -j4
sudo make install
sudo sed -i -e '/PROPOSAL_INCLUDE_DIR/s/\/include/\/usr\/include/' /usr/lib/x86_64-linux-gnu/cmake/PROPOSAL/PROPOSALConfig.cmake
sudo sed -i -e '/PROPOSAL_LIBRARIES/s/\/lib/\/usr\/lib/' /usr/lib/x86_64-linux-gnu/cmake/PROPOSAL/PROPOSALConfig.cmake
- name: Install Corsika 8
continue-on-error: true
shell: bash
run: |
git clone --recursive https://gitlab.iap.kit.edu/AirShowerPhysics/corsika.git
sed -i -e 's/yaml-cpp::yaml-cpp/${yaml-cpp_LIBRARY}/' corsika/CMakeLists.txt
sed -i -e '/^find_package(Arrow/s/$/\nfind_package(Parquet REQUIRED)/' corsika/CMakeLists.txt
mkdir corsika/build
cd corsika/build
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=x86_64-linux-gnu \
-DCMAKE_PREFIX_PATH=/usr \
..
make -j4
sudo make install
- name: Build post-installation file list
shell: bash
run: sudo find /usr -print > filelist_after.txt
- name: Package Corsika 8 in TGZ file
shell: bash
run: |
cat filelist_before.txt filelist_after.txt | sort | uniq -u > filelist_diff.txt
tar -zcvf corsika8_installed.tgz -C / -T filelist_diff.txt
ls -l corsika8_installed.tgz
- uses: actions/upload-artifact@v4
with:
name: Filelist
path: filelist_after.txt
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "${{ matrix.os }}"
prerelease: true
title: "Build of Corsika8 on ${{ matrix.os }}"
files: |
corsika8_installed.tgz