-
Notifications
You must be signed in to change notification settings - Fork 0
205 lines (180 loc) · 7.54 KB
/
Copy pathrelease.yml
File metadata and controls
205 lines (180 loc) · 7.54 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
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
198
199
200
201
202
203
204
205
on:
[push, workflow_dispatch]
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
jobs:
windows_build:
name: Windows build
runs-on: windows-2019
outputs:
upload_name: ${{steps.windeploy.outputs.file_name}}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Enable Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1.10.0
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
host: windows
modules: 'qtcharts'
archives: 'qtsvg'
extra: --external 7z
- name: Build cryptopp
run: |
cd external-libs/cryptopp
nmake /f cryptest.nmake CXXFLAGS="/DNDEBUG /D_NDEBUG /Oi /Oy /O2 /MD /openmp"
- name: qmake and nmake
run: |
echo $(git rev-parse --short "${{github.sha}}") > text\\REVISION.txt
type text\\REVISION.txt
qmake theoreticaldiary.pro CONFIG+=release
set CL=/MP
nmake qmake_all
nmake
nmake clean
- name: windeployqt
id: windeploy
shell: cmd
run: |
windeployqt --compiler-runtime --release --no-translations release\\theoreticaldiary.exe
set /p VERSION=<"text/VERSION.txt"
set FILE_NAME=TheoreticalDiary-v%VERSION%-x86_64
echo ::set-output name=file_name::%FILE_NAME%
- name: Upload to Github
uses: actions/upload-artifact@v2
with:
name: ${{steps.windeploy.outputs.file_name}}
path: release
osx_build:
name: OSX build
runs-on: macos-10.15
outputs:
upload_name: ${{steps.macdeploy.outputs.full_name}}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
host: mac
modules: 'qtcharts'
archives: 'qtsvg'
extra: --external 7z
- name: Build cryptopp
run: |
brew install llvm libomp
cd external-libs/cryptopp
export CXXFLAGS="-DNDEBUG -g2 -O3 -fopenmp -L/usr/local/opt/llvm/lib -I/usr/local/opt/llvm/include"
export CC="/usr/local/opt/llvm/bin/clang"
export CXX="/usr/local/opt/llvm/bin/clang++"
make -j$(sysctl -n hw.logicalcpu) dynamic cryptest.exe
make -j$(sysctl -n hw.logicalcpu) libcryptopp.a libcryptopp.so cryptest.exe
sudo make install PREFIX=/usr/local
- name: qmake and make
run: |
echo $(git rev-parse --short "$GITHUB_SHA") > text/REVISION.txt
cat text/REVISION.txt
sudo xcode-select -s /Applications/Xcode_12.1.1.app/Contents/Developer
qmake QMAKE_CC="/usr/local/opt/llvm/bin/clang" QMAKE_CXX="/usr/local/opt/llvm/bin/clang++" CONFIG+=release QMAKE_LIBS+="-L/usr/local/opt/llvm/lib -L/usr/local/lib" INCLUDEPATH+="-I/usr/local/opt/llvm/include"
make -j$(sysctl -n hw.logicalcpu)
- name: macdeployqt
id: macdeploy
run: |
export FULL_NAME="TheoreticalDiary-v$(cat text/VERSION.txt)-x86_64.app"
echo ::set-output name=full_name::${FULL_NAME}
macdeployqt TheoreticalDiary.app -verbose=2
- name: Upload to Github
uses: actions/upload-artifact@v2
with:
name: ${{steps.macdeploy.outputs.full_name}}
path: TheoreticalDiary.app
linux_build:
name: Linux build
runs-on: ubuntu-20.04
outputs:
upload_name: ${{steps.build_appimage.outputs.full_name}}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Install packages
run: |
sudo apt-get update
sudo apt install qt5-default patchelf
sudo apt install libqt5charts5 libqt5charts5-dev
sudo apt install libqt5svg5 libqt5svg5-dev
- name: Build cryptopp
run: |
cd external-libs/cryptopp
CXXFLAGS="-DNDEBUG -g2 -O3 -fopenmp" make -j$(nproc) dynamic cryptest.exe
CXXFLAGS="-DNDEBUG -g2 -O3 -fopenmp" make -j$(nproc) libcryptopp.a libcryptopp.so cryptest.exe
sudo make install PREFIX=/usr/local
- name: qmake and make
run: |
echo $(git rev-parse --short "$GITHUB_SHA") > text/REVISION.txt
cat text/REVISION.txt
qmake CONFIG+=release
make -j$(nproc)
make install INSTALL_ROOT=TheoreticalDiary.AppDir
- name: Build AppImage
id: build_appimage
run: |
wget --no-verbose https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
wget --no-verbose https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage
chmod +x ./linuxdeploy-x86_64.AppImage
chmod +x ./linuxdeploy-plugin-qt-x86_64.AppImage
mkdir -p "TheoreticalDiary.AppDir/usr/share/metainfo/"
cp "me.someretical.TheoreticalDiary.appdata.xml" "TheoreticalDiary.AppDir/usr/share/metainfo/"
export VERSION="$(cat text/VERSION.txt)"
export OUTPUT="TheoreticalDiary-v${VERSION}-x86_64.AppImage"
echo ::set-output name=full_name::${OUTPUT}
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
sudo ldconfig /usr/local/lib
./linuxdeploy-x86_64.AppImage --desktop-file="me.someretical.TheoreticalDiary.desktop" --icon-file="images/linux_icons/256x256/theoreticaldiary.png" --appdir="TheoreticalDiary.AppDir" --plugin=qt --output=appimage --executable="TheoreticalDiary.AppDir/usr/bin/theoreticaldiary"
- name: Upload to Github
uses: actions/upload-artifact@v2
with:
name: ${{steps.build_appimage.outputs.full_name}}
path: ${{steps.build_appimage.outputs.full_name}}
draft_release:
name: Create draft release
runs-on: ubuntu-20.04
if: startsWith(github.ref, 'refs/tags/v')
needs: [windows_build, osx_build, linux_build]
steps:
- name: Download all artifacts
uses: actions/download-artifact@v2
- name: Zip Windows build
uses: montudor/action-zip@v1
with:
args: zip -qq -r "${{needs.windows_build.outputs.upload_name}}.zip" ${{needs.windows_build.outputs.upload_name}}
- name: Zip OSX build
uses: montudor/action-zip@v1
with:
args: zip -qq -r "${{needs.osx_build.outputs.upload_name}}.zip" ${{needs.osx_build.outputs.upload_name}}
- name: Generate hashes
run: |
sha256sum "${{needs.windows_build.outputs.upload_name}}.zip" > sha256.txt
md5sum "${{needs.windows_build.outputs.upload_name}}.zip" > md5.txt
sha256sum "${{needs.osx_build.outputs.upload_name}}.zip" >> sha256.txt
md5sum "${{needs.osx_build.outputs.upload_name}}.zip" >> md5.txt
cd ${{needs.linux_build.outputs.upload_name}}
sha256sum ${{needs.linux_build.outputs.upload_name}} >> ../sha256.txt
md5sum ${{needs.linux_build.outputs.upload_name}} >> ../md5.txt
- name: Create draft release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{secrets.GITHUB_TOKEN}}"
draft: true
files: |
${{needs.windows_build.outputs.upload_name}}.zip
${{needs.osx_build.outputs.upload_name}}.zip
${{needs.linux_build.outputs.upload_name}}/${{needs.linux_build.outputs.upload_name}}
sha256.txt
md5.txt