-
Notifications
You must be signed in to change notification settings - Fork 56
164 lines (135 loc) · 4.45 KB
/
build.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
name: Candle2 Linux64
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build_linux:
runs-on: ubuntu-20.04
env:
SOURCE_DIR: ${{ github.workspace }}
QT_VERSION: 5.15.2
ARTIFACT: Candle2_AppImage
defaults:
run:
shell: bash
steps:
- name: Install QT
run: |
sudo apt install qt5-default qt5-qmake qtbase5-dev-tools libqt5serialport5-dev -y
- name: Checkout repo
uses: actions/checkout@v3
- name: Configure
run: |
mkdir build && cd build
qmake ../src/candle2.pro
cd ..
- name: Build
run: |
cd build
make -j6
cd ..
- name: Deploy
run: |
mkdir -p AppDir/usr/bin
mkdir deploy && cd deploy
wget "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage"
chmod a+x *.AppImage
cp ../build/Candle2 ../AppDir/usr/bin
./linuxdeployqt-continuous-x86_64.AppImage ../AppDir/usr/share/applications/Candle2.desktop -verbose=2
./linuxdeployqt-continuous-x86_64.AppImage ../AppDir/usr/share/applications/Candle2.desktop -verbose=2 -appimage
cd ..
- name: Upload
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT }}
path: |
deploy/Candle2*.AppImage
build_win:
runs-on: windows-2022
env:
SOURCE_DIR: ${{ github.workspace }}
QT_VERSION: 5.15.2
ARTIFACT: candle2-win.zip
defaults:
run:
shell: cmd
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
submodules: recursive
- name: Get all tags for correct version determination
working-directory: ${{ github.workspace }}
run: |
git fetch --all --tags -f
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: ${{ env.QT_VERSION }}
host: windows
target: desktop
arch: win64_msvc2019_64
dir: ${{ runner.temp }}
setup-python: false
- name: Download JOM
uses: suisei-cn/actions-download-file@master
with:
url: http://download.qt.io/official_releases/jom/jom.zip
target: ${{ runner.temp }}\
- name: Unzip JOM
working-directory: ${{ runner.temp }}
run: |
7z x jom.zip -ojom
- name: Create build directory
run: mkdir ${{ runner.temp }}\build
- name: Set up Visual Studio shell
uses: egor-tensin/vs-shell@v2
with:
arch: x64
- name: Build
working-directory: ${{ runner.temp }}\build
run: |
qmake -r ${{ env.SOURCE_DIR }}\src\candle2.pro
${{ runner.temp }}\jom\jom -j3
cd release
windeployqt --qmldir ${{ env.SOURCE_DIR }} Candle2.exe --pdb --release --compiler-runtime
copy C:\Windows\System32\concrt140.dll .
copy C:\Windows\System32\vccorlib140.dll .
copy C:\Windows\System32\msvcp140.dll .
copy C:\Windows\System32\vcruntime140.dll .
- name: Zip build
working-directory: ${{ runner.temp }}
run: |
7z a candle2-win.zip ${{ runner.temp }}\build\* -r -x!*.h -x!*.obj -x!*.cpp -x!*.rc -x!*.stash -x!*.Debug -x!*.Release -x!Makefile
- name: Save build artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT }}
path: ${{ runner.temp }}\${{ env.ARTIFACT }}
release:
needs: [build_linux, build_win]
runs-on: ubuntu-latest
steps:
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
path: ./
- name: List files
run: ls -R ./
shell: bash
- name: Update Current Release
uses: andelf/nightly-release@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: latest
name: "Latest Release $$"
draft: false
prerelease: true
body: |
This is the latest binary release.
files: |
Candle2_AppImage/Candle2*.AppImage
candle2-win.zip/candle2-win.zip