-
Notifications
You must be signed in to change notification settings - Fork 293
178 lines (151 loc) · 6.13 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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
name: Build
on:
push:
branches:
- "QT6WIP"
jobs:
buildlinux:
name: Linux x64
runs-on: ubuntu-20.04
steps:
- name: Prepare Environment
run: |
sudo apt-get install libxcb-icccm4 libxcb-image0 libxcb-cursor0 libxcb-keysyms1 libxcb-render-util0 libxcb-xinerama0 libxcb-randr0 libxkbcommon-x11-0
- name: Prepare Qt Libraries
uses: jurplel/install-qt-action@v3
with:
version: '6.5.0'
modules: 'qtserialbus qtserialport'
- name: Clone
uses: actions/checkout@v3
- name: Compile
run: |
qmake CONFIG+=release PREFIX=/usr SavvyCAN.pro
make -j`grep -c ^processor /proc/cpuinfo`
- name: Package
run: |
make INSTALL_ROOT=appdir install
wget -c -nv "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage"
chmod a+x linuxdeployqt-continuous-x86_64.AppImage
./linuxdeployqt-continuous-x86_64.AppImage appdir/usr/share/applications/SavvyCAN.desktop -appimage -extra-plugins=iconengines,platformthemes/libqgtk3.so,canbus
- uses: actions/upload-artifact@v4
with:
name: SavvyCAN-Linux_x64.AppImage
path: SavvyCAN-*x86_64.AppImage
buildmacos:
name: macOS x64
runs-on: macos-12
steps:
- name: Prepare macOS Environment
run: |
brew install qt6
brew link qt6 --force
- name: Clone
uses: actions/checkout@v3
- name: Compile
run: |
qmake CONFIG+=release CONFIG+=sdk_no_version_check SavvyCAN.pro
make -j`sysctl kern.aioprocmax | awk '{print $2}'`
- name: Package
run: |
mkdir -p SavvyCAN.app/Contents/MacOS/help
mkdir -p SavvyCAN.app/Frameworks
cp -R help/* SavvyCAN.app/Contents/MacOS/help
cp /usr/local/share/qt/plugins/canbus/* SavvyCAN.app/Frameworks
macdeployqt SavvyCAN.app -dmg
- uses: actions/upload-artifact@v4
with:
name: SavvyCAN-macOS_x64.dmg
path: SavvyCAN.dmg
buildwindows:
name: Windows x64
runs-on: windows-2019
steps:
- name: Prepare Qt Libraries
uses: jurplel/install-qt-action@v3
with:
version: '6.5.0'
modules: 'qtserialbus qtserialport'
- name: Clone
uses: actions/checkout@v3
- name: Compile
shell: cmd
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
qmake CONFIG+=release SavvyCAN.pro
nmake /C
- name: Package
run: |
mkdir package
copy "release/SavvyCAN.exe" package/
mkdir package/help
copy help/*.md package/help/
mkdir package/help/images
copy help/images/*.* package/help/images/
mkdir package/examples
copy examples/*.* package/examples/
copy "${Env:Qt6_Dir}/bin/Qt6Core.dll" package/
copy "${Env:Qt6_Dir}/bin/Qt6Gui.dll" package/
copy "${Env:Qt6_Dir}/bin/Qt6Network.dll" package/
copy "${Env:Qt6_Dir}/bin/Qt6PrintSupport.dll" package/
copy "${Env:Qt6_Dir}/bin/Qt6Qml.dll" package/
copy "${Env:Qt6_Dir}/bin/Qt6SerialBus.dll" package/
copy "${Env:Qt6_Dir}/bin/Qt6SerialPort.dll" package/
copy "${Env:Qt6_Dir}/bin/Qt6Widgets.dll" package/
copy "${Env:Qt6_Dir}/bin/Qt6OpenGL.dll" package/
mkdir package/imageformats
copy "${Env:Qt6_Dir}/plugins/imageformats/*.*" package/imageformats/
mkdir package/platforms
copy "${Env:Qt6_Dir}/plugins/platforms/*.*" package/platforms/
mkdir package/styles
copy "${Env:Qt6_Dir}/plugins/styles/*.*" package/styles/
mkdir package/canbus
copy "${Env:Qt6_Dir}/plugins/canbus/*.*" package/canbus/
- uses: actions/upload-artifact@v4
with:
name: SavvyCAN-Windows_x64
path: package
pre-release:
name: "pre-release"
runs-on: "ubuntu-latest"
needs: [buildwindows, buildmacos, buildlinux]
steps:
- uses: actions/checkout@v3
- uses: actions/[email protected]
- name: Display structure of downloaded files
run: zip -r SavvyCAN-Windows_x64_CIBuild.zip SavvyCAN-Windows_x64
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "continuous-QT6"
prerelease: true
title: "QT6 Development Build"
files: |
SavvyCAN-Linux_x64.AppImage/SavvyCAN-*x86_64.AppImage
SavvyCAN-Windows_x64_CIBuild.zip
SavvyCAN-macOS_x64.dmg/SavvyCAN.dmg
notify:
name: Notify Discord
runs-on: ubuntu-latest
needs: [buildwindows, buildmacos, buildlinux]
steps:
- id: msg_var
name: remove newlines
run: |
export release_msg=$(cat << EOF
${{ github.event.head_commit.message }}
EOF
)
release_msg="${release_msg//$'\n'/'-'}"
release_msg="${release_msg//$'\r'/'-'}"
release_msg="${release_msg//$'('/'-'}"
release_msg="${release_msg//$')'/'-'}"
echo $release_msg
echo "::set-output name=msg::$release_msg"
- name: Notify Discord
run: |
curl -i -H "Accept: application/json" \
-H "Content-Type:application/json" \
-X POST \
--data "{\"content\": null,\"embeds\": [{\"title\": \"${{ github.repository }} QT6 Build Complete\", \"description\": \"${{ steps.msg_var.outputs.msg }} \\nCommit: ${{ github.sha }}\\n[Build Artifacts](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}#artifacts)\", \"color\": 5131997, \"author\": { \"name\": \"Github Builds\" } } ]}" \
https://discord.com/api/webhooks/${{ secrets.WEBHOOK_ID }}/${{ secrets.WEBHOOK_TOKEN }}