-
-
Notifications
You must be signed in to change notification settings - Fork 325
303 lines (234 loc) · 8.11 KB
/
ci.yml
File metadata and controls
303 lines (234 loc) · 8.11 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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
name: CI/CD
on:
push:
branches: [ "main", "dev", "devel" ]
tags: '*'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
SourceArtifact:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3
with:
submodules: 'recursive'
path: source
- name: Upload source artifact
uses: actions/upload-artifact@v4
with:
name: source-artifact
include-hidden-files: true
path: source
ReleaseSourceArchives:
needs: SourceArtifact
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Download source artifact
uses: actions/download-artifact@v4
with:
name: source-artifact
path: albert
- name: Create archives
run: |
tar --exclude=".*" -czvf ${{ github.ref_name }}.tar.gz albert
zip -r ${{ github.ref_name }}.zip albert -x "*/.*"
- name: Release
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
files: |
${{ github.ref_name }}.tar.gz
${{ github.ref_name }}.zip
LinuxBuilds:
needs: SourceArtifact
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
dockerfile: [arch.Dockerfile, fedora.Dockerfile, ubuntu.Dockerfile]
steps:
- name: Download source artifact
uses: actions/download-artifact@v4
with:
name: source-artifact
- name: Build docker test image
run: docker build . --file .docker/${{ matrix.dockerfile }} --target build-plugin
MacBuilds:
needs: SourceArtifact
name: ${{matrix.buildname}}
runs-on: ${{matrix.os}}
strategy:
matrix:
include:
- os: macos-15-intel
buildname: macOS x86_64
arch: 'x86_64'
- os: macos-15
buildname: macOS arm64
arch: 'arm64'
steps:
- name: Download source artifact
uses: actions/download-artifact@v4
with:
name: source-artifact
path: source
- name: Install dependencies available at homebrew
env:
#HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
HOMEBREW_NO_INSTALL_UPGRADE: 1
run: |
brew install llvm@18 qt qcoro6
brew install --ignore-dependencies libqalculate qtkeychain # python libarchive sparkle
- name: Build and package
run: |
cmake -S source -B build \
-DCMAKE_C_COMPILER=$(brew --prefix llvm@18)/bin/clang \
-DCMAKE_CXX_COMPILER=$(brew --prefix llvm@18)/bin/clang++ \
-DCMAKE_OSX_DEPLOYMENT_TARGET=11 \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_OSX_ARCHITECTURES="${{ matrix.arch }}" \
-DBUILD_PLUGIN_DEBUG=OFF \
-DBUILD_PLUGIN_DOCS=OFF
cmake --build build
- name: Build and package
run: cd build && cpack -V
- name: Append suffix
run: |
set -x
dmg=$(echo build/Albert-*.dmg)
new_dmg="${dmg::${#dmg} - 4}-${{ matrix.arch }}.dmg"
mv "${dmg}" "${new_dmg}"
mv "${dmg}.sha256" "${new_dmg}.sha256"
- name: Upload macOS bundle artifact
uses: actions/upload-artifact@v4
with:
name: macos-bundle-artifact-${{ matrix.arch }}
path: |
build/*.dmg
build/*.sha256
#appcast_item.txt
RelaseMacBuilds:
needs: MacBuilds
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Get all build artifacts
uses: actions/download-artifact@v4
with:
pattern: macos-bundle-artifact-*
merge-multiple: true
- name: Upload
uses: softprops/action-gh-release@v1
with:
files: |
Albert-*.dmg
Albert-*.sha256
UpdateTap:
needs: RelaseMacBuilds
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4 # deletes .
with:
repository: albertlauncher/homebrew-albert
token: ${{ secrets.PAT }}
- name: Get all build artifacts
uses: actions/download-artifact@v4
with:
pattern: macos-bundle-artifact-*
merge-multiple: true
- name: Update cask
run: |
find .
ver=${{ github.ref_name }}
ver="${ver#v}" # Remove leading 'v'
sha_arm=$(cut -f 1 -d " " Albert-v$ver-arm64.dmg.sha256)
sha_intel=$(cut -f 1 -d " " Albert-v$ver-x86_64.dmg.sha256)
# Note this is GNU sed
sed -i "s/version .*$/version \"$ver\"/; s/^ sha256.*$/ sha256 arm: \"${sha_arm}\", intel: \"${sha_intel}\"/" Casks/albert.rb
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add Casks/albert.rb
git commit -m "${{ github.ref_name }}"
git push
# Appcast:
# needs: RelaseMacBuilds
# if: startsWith(github.ref, 'refs/tags/')
# runs-on: ubuntu-latest
# steps:
# - name: Checkout website source code
# uses: actions/checkout@v3
# with:
# repository: albertlauncher/documentation
# ref: 'master'
# token: ${{ secrets.PAT }}
#- name: list files
# run: find .
#- run: sed -i -e '/<\/language>/r appcast_item.txt' src/appcast.xml
#- name: Push appcast
# run: |
# git config --local user.name "GitHub Action"
# git config --local user.email "action@github.com"
# git add src/appcast.xml
# git commit -m "Update appcast"
# git push origin master
#- name: Restore macports dependencies
# id: cache-macports # ref'ed below
# uses: actions/cache/restore@v4
# with:
# path: |
# /opt/local/lib
# /opt/local/include
# key: ${{ matrix.os }}-macports-r2
#- name: Install macports (for universal binaries of libqalculate and libarchive)
# if: steps.cache-macports.outputs.cache-hit != 'true'
# run: |
# case ${{ matrix.os }} in
# macos-11)
# wget "https://github.com/macports/macports-base/releases/download/v2.8.1/MacPorts-2.8.1-11-BigSur.pkg"
# sudo installer -pkg ./MacPorts-2.8.1-11-BigSur.pkg -target /
# ;;
# macos-12)
# wget "https://github.com/macports/macports-base/releases/download/v2.8.1/MacPorts-2.8.1-12-Monterey.pkg"
# sudo installer -pkg ./MacPorts-2.8.1-12-Monterey.pkg -target /
# ;;
# macos-13)
# wget "https://github.com/macports/macports-base/releases/download/v2.8.1/MacPorts-2.8.1-13-Ventura.pkg"
# sudo installer -pkg ./MacPorts-2.8.1-13-Ventura.pkg -target /
# ;;
# esac
# sudo sh -c 'echo "\n+universal" >> /opt/local/etc/macports/variants.conf'
#- name: Install dependencies using macports
# if: steps.cache-macports.outputs.cache-hit != 'true'
# run : sudo /opt/local/bin/port install libqalculate libarchive # increase steps.cache-macports.outputs.cache-primary-key revision on change
#- name: Save macports dependencies
# uses: actions/cache/save@v4
# with:
# path: |
# /opt/local/lib
# /opt/local/include
# key: ${{ steps.cache-macports.outputs.cache-primary-key }}
# - name: Checkout source code
# uses: actions/checkout@v3
# with:
# submodules: recursive
# - name: Get latest CMake and ninja
# uses: lukka/get-cmake@latest
#- name: Install Qt dependencies
# uses: jurplel/install-qt-action@v3
# with:
# version: ${{ matrix.qt_version }}
# cache: true
# modules: 'qtscxml qt5compat qtshadertools'
#- name: Create writable /opt/local
# run: sudo install -d -o $UID -m 755 /opt/local
#- name: Generate appcast item
# env:
# EDDSA_PRIVATE_KEY: ${{ secrets.EDDSA_PRIVATE_KEY }}
# VERSION: ${{ github.ref_name }}
# run: ./dist/macos/generate_appcast_item.sh "build/Albert-${{ github.ref_name }}.dmg" "${VERSION:1}" "$EDDSA_PRIVATE_KEY" appcast_item.txt