forked from mne-tools/mne-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
150 lines (142 loc) · 5.71 KB
/
release-linux.yml
File metadata and controls
150 lines (142 loc) · 5.71 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
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
147
148
149
150
name: Release Linux
on:
workflow_call:
jobs:
LinuxDynamic:
runs-on: ubuntu-24.04
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Determine release info
id: release-info
run: |
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
echo "tag=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT"
echo "prefix=mne-cpp-${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT"
echo "should_upload=true" >> "$GITHUB_OUTPUT"
elif [[ "$GITHUB_REF" == "refs/heads/main" ]]; then
echo "tag=latest" >> "$GITHUB_OUTPUT"
echo "prefix=mne-cpp-latest" >> "$GITHUB_OUTPUT"
echo "should_upload=true" >> "$GITHUB_OUTPUT"
elif [[ "$GITHUB_REF" == "refs/heads/staging" ]]; then
echo "tag=dev_build" >> "$GITHUB_OUTPUT"
echo "prefix=mne-cpp-dev" >> "$GITHUB_OUTPUT"
echo "should_upload=true" >> "$GITHUB_OUTPUT"
else
echo "tag=none" >> "$GITHUB_OUTPUT"
echo "prefix=mne-cpp-local" >> "$GITHUB_OUTPUT"
echo "should_upload=false" >> "$GITHUB_OUTPUT"
fi
- name: Install Python 3.10 version
uses: actions/setup-python@v5
with:
python-version: '3.10'
architecture: 'x64'
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: 6.10.2
modules: qtshadertools
- name: Configure and compile MNE-CPP
run: |
./tools/build_project.bat
- name: Deploy binaries
run: |
echo "Qt environment:"
echo " QT_ROOT_DIR=${QT_ROOT_DIR:-<not set>}"
echo " Qt6_DIR=${Qt6_DIR:-<not set>}"
echo " Qt lib dir contents:"
QT_PREFIX="${QT_ROOT_DIR:-}"
if [ -z "$QT_PREFIX" ] && [ -n "${Qt6_DIR}" ]; then
QT_PREFIX="$(cd "${Qt6_DIR}/../../.." 2>/dev/null && pwd)"
fi
ls "$QT_PREFIX/lib"/libQt6*.so* 2>/dev/null | head -5 || echo " No Qt .so files found at $QT_PREFIX/lib"
./tools/deploy.bat dynamic pack
- name: Upload release binaries
if: steps.release-info.outputs.should_upload == 'true'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GH_PAT || secrets.GITHUB_TOKEN }}
file: mne-cpp-linux-dynamic-x86_64.tar.gz
asset_name: ${{ steps.release-info.outputs.prefix }}-linux-dynamic-x86_64.tar.gz
tag: ${{ steps.release-info.outputs.tag }}
overwrite: true
LinuxStatic:
runs-on: ubuntu-24.04
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Determine release info
id: release-info
run: |
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
echo "tag=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT"
echo "prefix=mne-cpp-${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT"
echo "should_upload=true" >> "$GITHUB_OUTPUT"
elif [[ "$GITHUB_REF" == "refs/heads/main" ]]; then
echo "tag=latest" >> "$GITHUB_OUTPUT"
echo "prefix=mne-cpp-latest" >> "$GITHUB_OUTPUT"
echo "should_upload=true" >> "$GITHUB_OUTPUT"
elif [[ "$GITHUB_REF" == "refs/heads/staging" ]]; then
echo "tag=dev_build" >> "$GITHUB_OUTPUT"
echo "prefix=mne-cpp-dev" >> "$GITHUB_OUTPUT"
echo "should_upload=true" >> "$GITHUB_OUTPUT"
else
echo "tag=none" >> "$GITHUB_OUTPUT"
echo "prefix=mne-cpp-local" >> "$GITHUB_OUTPUT"
echo "should_upload=false" >> "$GITHUB_OUTPUT"
fi
- name: Install Python 3.10 version
uses: actions/setup-python@v5
with:
python-version: '3.10'
architecture: 'x64'
- name: Install dependencies
run: |
sudo apt-get update -q
sudo apt-get install -q build-essential libgl1-mesa-dev libvulkan-dev ninja-build
- name: Cache static Qt binaries
id: cache-qt-static
uses: actions/cache@v4
with:
path: ../Qt6_static
key: qt-6.10.2-static-linux-x86_64
- name: Download pre-built static Qt
id: download-qt-static
if: steps.cache-qt-static.outputs.cache-hit != 'true'
continue-on-error: true
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release download qt_binaries -p "qt6_6102_static_binaries_linux.tar.gz" -D /tmp
mkdir -p ../Qt6_static
tar xfz /tmp/qt6_6102_static_binaries_linux.tar.gz -C ../Qt6_static
- name: Build static Qt from source
if: steps.cache-qt-static.outputs.cache-hit != 'true' && steps.download-qt-static.outcome != 'success'
run: |
cd ..
git clone https://code.qt.io/qt/qt5.git -b v6.10.2
cd qt5
./init-repository -f --module-subset=qtbase,qtsvg,qtshadertools
cd ..
mkdir qt6_shadow
cd qt6_shadow
../qt5/configure -static -release -prefix "$GITHUB_WORKSPACE/../Qt6_static" -skip webengine -nomake tools -nomake tests -nomake examples -no-dbus -no-ssl -no-pch -opensource -confirm-license -qt-libpng -qt-pcre -- -DCMAKE_BUILD_TYPE=Release
cmake --build . --parallel $(nproc)
cmake --install .
- name: Configure and compile MNE-CPP (static)
run: |
export CMAKE_PREFIX_PATH=$GITHUB_WORKSPACE/../Qt6_static
./tools/build_project.bat static
- name: Deploy binaries
run: |
./tools/deploy.bat static pack
- name: Upload release binaries
if: steps.release-info.outputs.should_upload == 'true'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GH_PAT || secrets.GITHUB_TOKEN }}
file: mne-cpp-linux-static-x86_64.tar.gz
asset_name: ${{ steps.release-info.outputs.prefix }}-linux-static-x86_64.tar.gz
tag: ${{ steps.release-info.outputs.tag }}
overwrite: true