-
Notifications
You must be signed in to change notification settings - Fork 0
198 lines (180 loc) · 8.01 KB
/
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
# create a release workflow from the main branch
name: Release LipidSpace
on:
release:
types: [ created ]
workflow_dispatch:
jobs:
build-linux:
runs-on: "ubuntu-latest"
env:
BUILD_DATE: ${{ github.run_id }}.${{ github.run_attempt }}
RELEASE_VERSION: ${{ github.ref_name }}
OS: "Linux"
steps:
- uses: actions/checkout@v3
with:
lfs: 'true'
- name: Set Git user
run: |
git config --global committer.email "[email protected]"
git config --global committer.name "GitHub"
git config --global author.email "${GITHUB_ACTOR}@users.noreply.github.com"
git config --global author.name "${GITHUB_ACTOR}"
- name: Install dependencies
run: |
DEBIAN_FRONTEND=noninteractive sudo apt update
sudo apt install -y --no-install-recommends \
build-essential \
libfontconfig1 \
qt6-base-dev \
qt6-base-dev-tools \
libqt6svg6-dev \
libqt6svgwidgets6 \
libopenblas-base \
libopenblas-dev \
libomp-dev \
mesa-common-dev \
libglu1-mesa-dev \
libc6 \
libstdc++6
- name: Build LipidSpace
run: |
qmake6 LipidSpace.pro
make clean
make build
- name: Attach Binaries to Build
uses: actions/upload-artifact@v4
# action zips automatically
with:
name: "LipidSpace-${{ env.RELEASE_VERSION }}-${{ env.OS }}"
path: "Build/LipidSpace"
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
# only upload binaries on release creation, not on manual trigger
if: github.event_name != 'workflow_dispatch'
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: Build/LipidSpace-${{ env.RELEASE_VERSION }}-${{ env.OS }}.zip
asset_name: LipidSpace-${{ env.RELEASE_VERSION }}-${{ env.OS }}
tag: ${{ github.ref }}
overwrite: true
file_glob: true
build-windows:
runs-on: "windows-2019"
env:
BUILD_DATE: ${{ github.run_id }}.${{ github.run_attempt }}
RELEASE_VERSION: ${{ github.ref_name }}
OS: "Windows"
QT_VERSION: "6.2.4"
QT_ARCH: "win64_mingw"
steps:
- name: Set up MinGW
uses: egor-tensin/[email protected]
with:
platform: x64
version: 11.2.0
- name: Attach mingw to Build
uses: actions/upload-artifact@v4
# action zips automatically
with:
name: "mingw64"
path: "C:/ProgramData/chocolatey/lib/mingw/tools/install/mingw64"
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
aqtversion: '==3.1.*'
version: ${{ env.QT_VERSION }}
target: "desktop"
host: "windows"
arch: ${{ env.QT_ARCH }}
cache: "false"
cache-key-prefix: "install-qt"
set-env: "true"
dir: ${{ runner.workspace }}
- uses: actions/checkout@v3
with:
lfs: 'true'
- name: Set Git user
run: |
git.exe config --global committer.email "[email protected]"
git.exe config --global committer.name "GitHub"
git.exe config --global author.email "${GITHUB_ACTOR}@users.noreply.github.com"
git.exe config --global author.name "${GITHUB_ACTOR}"
shell: cmd
- name: Prepare QT Project makefiles
run: |
qmake LipidSpaceGH.pro
shell: cmd
- name: Attach Makefile.Release to Build
uses: actions/upload-artifact@v4
# action zips automatically
with:
name: "Makefile.Release"
path: "Makefile.Release"
- name: Build LipidSpace
run: |
make -j8
- name: Ensure that .\release\LipidSpaceGH.exe exists
run: |
if not exist ".\release\LipidSpaceGH.exe" exit 1
shell: cmd
- name: Create Distribution Build Directory
run: |
if not exist "Build" mkdir "Build"
if not exist "Build/LipidSpace" mkdir "Build/LipidSpace"
if not exist "Build/LipidSpace/data" mkdir "Build/LipidSpace/data"
if not exist "Build/LipidSpace/examples" mkdir "Build/LipidSpace/examples"
copy "libraries/cppgoslin/bin/win64"\* "Build/LipidSpace"
copy "libraries/OpenBLAS/bin/win64"\* "Build/LipidSpace"
copy "libraries/OpenXLSX/bin/win64"\* "Build/LipidSpace"
copy .\data\classes-matrix.csv "Build/LipidSpace/data"
powershell Copy-Item "data/images" -Destination "Build/LipidSpace/data" -Recurse -force
copy .\examples\Example-Dataset.xlsx "Build/LipidSpace/examples"
copy .\examples\ThreeStudies.xlsx "Build/LipidSpace/examples"
copy LICENSE* "Build/LipidSpace"
copy .\release\LipidSpaceGH.exe "Build/LipidSpace/LipidSpace.exe"
shell: cmd
- name: Copy mingw libgomp-1 DLL (TODO should be used from mingw64/bin)
run: |
copy .\libraries\Qt\bin\win64\libgomp-1.dll "Build/LipidSpace"
shell: cmd
- name: Copy Qt DLLs
run: |
powershell Copy-Item "${{ runner.workspace }}/Qt/${{ env.QT_VERSION }}/mingw_64/plugins/platforms" -Destination "Build/LipidSpace" -Recurse -force
powershell Copy-Item "${{ runner.workspace }}/Qt/${{ env.QT_VERSION }}/mingw_64/bin/d3dcompiler_47.dll" -Destination "Build/LipidSpace" -force
powershell Copy-Item "${{ runner.workspace }}/Qt/${{ env.QT_VERSION }}/mingw_64/bin/libgcc_s_seh-1.dll" -Destination "Build/LipidSpace" -force
powershell Copy-Item "${{ runner.workspace }}/Qt/${{ env.QT_VERSION }}/mingw_64/bin/libstdc++-6.dll" -Destination "Build/LipidSpace" -force
powershell Copy-Item "${{ runner.workspace }}/Qt/${{ env.QT_VERSION }}/mingw_64/bin/libwinpthread-1.dll" -Destination "Build/LipidSpace" -force
powershell Copy-Item "${{ runner.workspace }}/Qt/${{ env.QT_VERSION }}/mingw_64/bin/opengl32sw.dll" -Destination "Build/LipidSpace" -force
powershell Copy-Item "${{ runner.workspace }}/Qt/${{ env.QT_VERSION }}/mingw_64/bin/Qt6Core.dll" -Destination "Build/LipidSpace" -force
powershell Copy-Item "${{ runner.workspace }}/Qt/${{ env.QT_VERSION }}/mingw_64/bin/Qt6Gui.dll" -Destination "Build/LipidSpace" -force
powershell Copy-Item "${{ runner.workspace }}/Qt/${{ env.QT_VERSION }}/mingw_64/bin/Qt6Network.dll" -Destination "Build/LipidSpace" -force
powershell Copy-Item "${{ runner.workspace }}/Qt/${{ env.QT_VERSION }}/mingw_64/bin/Qt6OpenGL.dll" -Destination "Build/LipidSpace" -force
powershell Copy-Item "${{ runner.workspace }}/Qt/${{ env.QT_VERSION }}/mingw_64/bin/Qt6OpenGLWidgets.dll" -Destination "Build/LipidSpace" -force
powershell Copy-Item "${{ runner.workspace }}/Qt/${{ env.QT_VERSION }}/mingw_64/bin/Qt6PrintSupport.dll" -Destination "Build/LipidSpace" -force
powershell Copy-Item "${{ runner.workspace }}/Qt/${{ env.QT_VERSION }}/mingw_64/bin/Qt6Svg.dll" -Destination "Build/LipidSpace" -force
powershell Copy-Item "${{ runner.workspace }}/Qt/${{ env.QT_VERSION }}/mingw_64/bin/Qt6SvgWidgets.dll" -Destination "Build/LipidSpace" -force
powershell Copy-Item "${{ runner.workspace }}/Qt/${{ env.QT_VERSION }}/mingw_64/bin/Qt6Widgets.dll" -Destination "Build/LipidSpace" -force
shell: cmd
- name: Create Distribution Zip
run: |
powershell Compress-Archive "Build/LipidSpace" "Build/LipidSpace-${{ env.RELEASE_VERSION }}-${{ env.OS }}.zip" -force
shell: cmd
- name: Attach Binaries to Build
uses: actions/upload-artifact@v4
# action zips automatically
with:
name: "LipidSpace-${{ env.RELEASE_VERSION }}-${{ env.OS }}"
path: "Build/LipidSpace"
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
# only upload binaries on release creation, not on manual trigger
if: github.event_name != 'workflow_dispatch'
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: Build/LipidSpace-${{ env.RELEASE_VERSION }}-${{ env.OS }}.zip
asset_name: LipidSpace-${{ env.RELEASE_VERSION }}-${{ env.OS }}
tag: ${{ github.ref }}
overwrite: true
file_glob: true