-
-
Notifications
You must be signed in to change notification settings - Fork 559
221 lines (180 loc) · 5.43 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
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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
name: Build Notepad Next
on:
push:
branches:
- master
tags:
- '*'
pull_request:
jobs:
build-linux:
strategy:
fail-fast: false
matrix:
config:
-
qt_version: "5.15.2"
modules: ""
-
qt_version: "6.2.4"
modules: "qt5compat"
-
qt_version: "6.5"
modules: "qt5compat"
runs-on: ubuntu-20.04
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: true
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: ${{ matrix.config.qt_version }}
modules: ${{ matrix.config.modules }}
- name: Setup
run: sudo apt-get install libxkbcommon-dev libxkbcommon-x11-0 fuse libxcb-cursor-dev
- name: Compile
run: |
mkdir build
cd build
qmake ../src/NotepadNext.pro "DISTRIBUTION=AppImage"
make -j$(nproc)
- name: Build AppImage
run: |
cd build
make appimage
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: NotepadNext-Linux-Qt${{ matrix.config.qt_version }}-AppImage
path: ${{ github.workspace }}/build/NotepadNext/NotepadNext*.AppImage
build-mac:
strategy:
fail-fast: false
matrix:
config:
-
qt_version: "5.15.2"
modules: ""
-
qt_version: "6.2.4"
modules: "qt5compat"
-
qt_version: "6.5"
modules: "qt5compat"
runs-on: macos-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: true
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: ${{ matrix.config.qt_version }}
modules: ${{ matrix.config.modules }}
- name: Compile
run: |
mkdir build
cd build
qmake ../src/NotepadNext.pro
make -j$(sysctl -n hw.ncpu)
- name: Build DMG
run: |
cd build
make dmg
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: NotepadNext-macOS-Qt${{ matrix.config.qt_version }}
path: ${{ github.workspace }}/build/NotepadNext/NotepadNext*.dmg
build-windows:
strategy:
fail-fast: false
matrix:
config:
-
qt_version: "5.15.2"
modules: ""
-
qt_version: "6.2.4"
modules: "qt5compat"
-
qt_version: "6.5"
modules: "qt5compat"
runs-on: windows-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: true
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: ${{ matrix.config.qt_version }}
modules: ${{ matrix.config.modules }}
- name: Setup Visual Studio Tools
uses: egor-tensin/vs-shell@v2
with:
arch: x64
- name: Install jom
run: choco install jom
- name: Run QMake
run: |
mkdir build
cd build
qmake ..\src\NotepadNext.pro
- name: Build
run: |
cd build
jom
- name: Create zip Package
run: |
cd build
jom package
- name: Create Installer
run: |
cd build
jom installer
- name: Upload zip Package
uses: actions/upload-artifact@v3
with:
name: NotepadNext-Windows-Qt${{ matrix.config.qt_version }}-Zip
path: ${{ github.workspace }}/build/package/
- name: Upload Installer
uses: actions/upload-artifact@v3
with:
name: NotepadNext-Windows-Qt${{ matrix.config.qt_version }}-Installer
path: ${{ github.workspace }}/installer/NotepadNext*.exe
github:
name: Draft GitHub Release
runs-on: ubuntu-latest
needs: [build-linux, build-mac, build-windows]
if: github.repository == 'dail8859/NotepadNext' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Create Draft Release
run: |
gh release create ${{ github.ref_name }} --title ${{ github.ref_name }} --generate-notes --draft
- name: Download all artifacts
uses: actions/download-artifact@v3
- name: Upload Windows Installer
run: |
gh release upload ${{ github.ref_name }} NotepadNext-Windows-Qt6.5-Installer/NotepadNext-${{ github.ref_name }}-Installer.exe
# The artifact is unzipped, so need to zip it back up so it can be uploaded
- name: Upload Windows Zip
run: |
cd NotepadNext-Windows-Qt6.5-Zip/
zip -r ../NotepadNext-${{ github.ref_name }}-win64.zip .
cd ..
gh release upload ${{ github.ref_name }} NotepadNext-${{ github.ref_name }}-win64.zip
- name: Upload Linux AppImage
run: |
gh release upload ${{ github.ref_name }} NotepadNext-Linux-Qt6.5-AppImage/NotepadNext-${{ github.ref_name }}-x86_64.AppImage
- name: Upload macOS App
run: |
gh release upload ${{ github.ref_name }} NotepadNext-macOS-Qt6.5/NotepadNext-${{ github.ref_name }}.dmg