Skip to content

Commit 953ff56

Browse files
committed
Add macOS release workflow
1 parent 1a8f970 commit 953ff56

File tree

2 files changed

+58
-3
lines changed

2 files changed

+58
-3
lines changed

.github/config.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ installer_repo_name=installer-repo
3434

3535
# Whether to upload new release to the Windows release repository (requires create_windows_installer=1)
3636
# Needs a PUSH_TOKEN secret with a personal access token
37-
update_windows_repository=1
37+
update_windows_repository=0
3838

3939
# Whether to upload WebAssembly build to the online app repository
4040
# Needs a PUSH_TOKEN secret with a personal access token

.github/workflows/release.yml

Lines changed: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ name: Release
33
on:
44
push:
55
tags: '*'
6+
pull_request:
7+
branches: [ "master" ]
68

79
jobs:
810
build-linux-release:
@@ -224,6 +226,60 @@ jobs:
224226
name: build-windows
225227
path: '*installer.exe'
226228

229+
build-macos-release:
230+
runs-on: macos-14
231+
strategy:
232+
matrix:
233+
os: [macos-14]
234+
qt-version: ['6.8']
235+
qt-target: ['desktop']
236+
steps:
237+
- uses: actions/checkout@v4
238+
with:
239+
fetch-depth: 0
240+
submodules: 'recursive'
241+
- name: Setup environment
242+
run: |
243+
sed -i -e '/^#/d' .github/config.env
244+
sed -i -e '/^$/d' .github/config.env
245+
cat .github/config.env >> "${GITHUB_ENV}"
246+
shell: bash
247+
- name: Set up node.js
248+
uses: actions/setup-node@v3
249+
- if: env.build_on_new_tags != 1
250+
name: Cancel if build on new tags is disabled
251+
uses: andymckay/cancel-action@0.2
252+
- name: Get version
253+
run: |
254+
version=$(LC_ALL=en_US.UTF-8 sed -n 's/.*project([^)]* VERSION \([0-9]\+\.[0-9]\+\.[0-9]\+\)).*/\1/p' CMakeLists.txt)
255+
echo "Project version: $version"
256+
echo previous_tag=$version >> "${GITHUB_ENV}"
257+
shell: bash
258+
- if: contains(github.ref, '-')
259+
name: Check if this is a pre-release
260+
run: echo is_prerelease=1 >> "${GITHUB_ENV}"
261+
shell: bash
262+
- name: Set up node.js
263+
uses: actions/setup-node@v3
264+
# Install Qt
265+
- name: Install Qt
266+
uses: jurplel/install-qt-action@v3
267+
with:
268+
version: ${{ matrix.qt-version }}
269+
host: 'mac'
270+
target: ${{ matrix.qt-target }}
271+
modules: ''
272+
# Build
273+
- name: Build
274+
run: .ci/macos_build.sh
275+
shell: bash
276+
# Upload
277+
- name: Upload artifacts
278+
uses: actions/upload-artifact@v4
279+
with:
280+
name: build-Qt-${{ matrix.qt-version }}
281+
path: '*.dmg'
282+
227283
# Release
228284
release:
229285
runs-on: ubuntu-latest
@@ -275,8 +331,7 @@ jobs:
275331
name: Create release
276332
uses: ncipollo/release-action@v1
277333
with:
278-
#artifacts: "build-windows/*.exe,build-linux-*/*.AppImage,build-linux-*/*.zsync,build-macos/*.dmg"
279-
artifacts: "build-windows/*.exe,build-linux-*/*.AppImage,build-linux-*/*.zsync"
334+
artifacts: "build-windows/*.exe,build-linux-*/*.AppImage,build-linux-*/*.zsync,build-macos/*.dmg"
280335
name: "${{ env.app_name }} ${{ env.version }}"
281336
owner: ${{ github.event.pusher.name }}
282337
draft: true

0 commit comments

Comments
 (0)